From: Thomas Gleixner <tglx@kernel.org>
To: Avi Weiss <thnkslprpt@gmail.com>
Cc: radu@rendec.net, linux-kernel@vger.kernel.org,
Avi Weiss <thnkslprpt@gmail.com>
Subject: Re: [PATCH] genirq/core: Fall back to a static default affinity mask
Date: Tue, 03 Nov 2026 00:22:13 +0100 [thread overview]
Message-ID: <87bj86yg2i.ffs@fw13> (raw)
In-Reply-To: <20261031133851.181601-1-thnkslprpt@gmail.com>
On Sat, Oct 31 2026 at 15:38, Avi Weiss wrote:
> With CONFIG_CPUMASK_OFFSTACK=y, init_irq_default_affinity() does not
> check whether zalloc_cpumask_var() succeeds. If the GFP_NOWAIT allocation
> fails, cpumask_empty() dereferences a NULL mask during early boot.
>
> Use a private static cpumask when allocation fails, keeping the default
> IRQ affinity mask available and writable.
>
> In a QEMU guest, a test-only allocation failure triggered the boot fault
> without this change. The patched kernel booted with the same injected
> failure and allowed the default affinity mask to be read and written.
> Normal and irqaffinity=0 boots also passed.
If that allocation fails the kernel won't boot at all.
Aside of that the fallback mask defeats the whole purpose of allocating
the mask at runtime.
I'm all for defensive programming, but this is just trying to "fix" a
problem which does not exist to begin with.
If you really want to do something when that allocation theoretically
fails then panic the machine because it is going to die on the next
allocation anyway.
Thanks,
tglx
prev parent reply other threads:[~2026-11-02 23:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-31 13:38 Avi Weiss
2026-11-02 23:22 ` Thomas Gleixner [this message]
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=87bj86yg2i.ffs@fw13 \
--to=tglx@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=radu@rendec.net \
--cc=thnkslprpt@gmail.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
all inboxes | Powered by JetHome®