From: Avi Weiss <thnkslprpt@gmail.com>
To: tglx@kernel.org
Cc: radu@rendec.net, linux-kernel@vger.kernel.org,
Avi Weiss <thnkslprpt@gmail.com>
Subject: [PATCH] genirq: Avoid signed shift when probing IRQ 31
Date: Sun, 1 Nov 2026 09:05:32 +0200 [thread overview]
Message-ID: <20261101070531.192212-2-thnkslprpt@gmail.com> (raw)
probe_irq_on() uses a signed int literal to set bits in an unsigned
long mask. For IRQ 31, the shift results in undefined behavior and
can set bits 32-63 on 64-bit systems.
Use UL suffix - promote to unsigned long so we set only the intended
IRQ bit. Current in-tree callers do not appear to use the affected
upper bits, but better to clean it up now for future correctness
and safety.
Signed-off-by: Avi Weiss <thnkslprpt@gmail.com>
---
kernel/irq/autoprobe.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/irq/autoprobe.c b/kernel/irq/autoprobe.c
index d0af8a8b3ae67..a46376373b3ea 100644
--- a/kernel/irq/autoprobe.c
+++ b/kernel/irq/autoprobe.c
@@ -88,7 +88,7 @@ unsigned long probe_irq_on(void)
desc->istate &= ~IRQS_AUTODETECT;
irq_shutdown_and_deactivate(desc);
} else if (i < 32) {
- mask |= 1 << i;
+ mask |= 1UL << i;
}
}
}
--
2.43.0
reply other threads:[~2026-11-01 7:05 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=20261101070531.192212-2-thnkslprpt@gmail.com \
--to=thnkslprpt@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=radu@rendec.net \
--cc=tglx@kernel.org \
/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®