From: Marc Zyngier <maz@kernel.org>
To: Zhu Ling <zhuling2709@phytium.com.cn>
Cc: tglx@kernel.org, radu@rendec.net, zenghui.yu@linux.dev,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] irqchip/gic: Fix UBSAN shift-out-of-bounds in GIC helpers
Date: Thu, 24 Sep 2026 18:48:02 +0100 [thread overview]
Message-ID: <86o6dm4k31.wl-maz@kernel.org> (raw)
In-Reply-To: <20260923082804.13197-1-zhuling2709@phytium.com.cn>
On Wed, 23 Sep 2026 09:28:04 +0100,
Zhu Ling <zhuling2709@phytium.com.cn> wrote:
>
> When running with UBSAN enabled, enabling a GPIO controller that uses a
> GIC interrupt as its parent triggers several shift-out-of-bounds warnings:
>
> shift-out-of-bounds in drivers/irqchip/irq-gic-common.c:50:21
> left shift of 2 by 30 places cannot be represented in type 'int'
>
> Similar reports are emitted from gic_poke_irq() and gic_peek_irq() in
> drivers/irqchip/irq-gic-v3.c. The corresponding GICv2 helpers use the
> same signed-shift pattern. These masks are generated by shifting signed
> integer constants, which invokes undefined behavior when bit 31 is
> selected.
>
> Use BIT() to generate the masks with an unsigned type and make their
> intent explicit.
>
> Signed-off-by: Zhu Ling <zhuling2709@phytium.com.cn>
Acked-by: Marc Zyngier <maz@kernel.org>
M.
--
Without deviation from the norm, progress is not possible.
next prev parent reply other threads:[~2026-09-24 17:48 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-02 10:53 [PATCH] irqchip/gic: Fix UBSAN shift-out-of-bounds in GIC helpers zhuling0805
2025-12-02 11:44 ` Marc Zyngier
2026-09-21 2:21 ` [PATCH v2] " Zhu Ling
2026-09-21 9:31 ` Zenghui Yu
2026-09-23 8:21 ` 朱领
2026-09-23 8:28 ` [PATCH v3] " Zhu Ling
2026-09-23 9:20 ` Zenghui Yu
2026-09-24 17:48 ` Marc Zyngier [this message]
2026-09-27 19:27 ` Radu Rendec
2026-09-28 1:32 ` [PATCH v4] " Zhu Ling
2026-09-29 2:28 ` Radu Rendec
2026-09-29 3:10 ` [PATCH v5] " Zhu Ling
2026-09-30 11:55 ` Radu Rendec
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=86o6dm4k31.wl-maz@kernel.org \
--to=maz@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=radu@rendec.net \
--cc=tglx@kernel.org \
--cc=zenghui.yu@linux.dev \
--cc=zhuling2709@phytium.com.cn \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.