public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
From: "Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>
To: linux-wireless@vger.kernel.org,
	Johannes Berg <johannes.berg@intel.com>,
	Luca Coelho <luciano.coelho@intel.com>
Subject: GPF on memory allocation, bisected down to "iwlwifi: fix leaks/bad data after failed firmware load"
Date: Tue, 8 Feb 2022 03:49:22 +0100	[thread overview]
Message-ID: <YgHaMm7ibTHgxHLn@mail-itl> (raw)

[-- Attachment #1: Type: text/plain, Size: 1569 bytes --]

Hi,

After updating from 5.15.14 to 5.16.5, I started getting GPF at
seemingly random places, but always(?) related to some memory allocation
(kmalloc, kmem_cache_alloc_trace etc). Since I had very specific good
and bad versions, and trivial reproducer (it crashes on boot rather
quickly), I bisected it, and ended up with:

    iwlwifi: fix leaks/bad data after failed firmware load

    If firmware load fails after having loaded some parts of the
    firmware, e.g. the IML image, then this would leak. For the
    host command list we'd end up running into a WARN on the next
    attempt to load another firmware image.

    Fix this by calling iwl_dealloc_ucode() on failures, and make
    that also clear the data so we start fresh on the next round.

    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
    Link: https://lore.kernel.org/r/iwlwifi.20211210110539.1f742f0eb58a.I1315f22f6aa632d94ae2069f85e1bca5e734dce0@changeid
    Signed-off-by: Luca Coelho <luciano.coelho@intel.com>

as the first bad commit.

And indeed, after reverting it on top of 5.16.5, the problem disappears.

What I think is an important details, I don't have any firmware for the
network card on this setup, so all attempts fails (several messages
about failed firmware load, for a variety of versions).

Some more details (including specific crash log) are at https://github.com/QubesOS/qubes-issues/issues/7241


-- 
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

                 reply	other threads:[~2022-02-08  2:56 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YgHaMm7ibTHgxHLn@mail-itl \
    --to=marmarek@invisiblethingslab.com \
    --cc=johannes.berg@intel.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=luciano.coelho@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox