From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B1C9AC9830E for ; Thu, 24 Sep 2026 17:48:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: References:In-Reply-To:Subject:Cc:To:From:Message-ID:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=HrDCAQV1pZi3wvTFhrBJGDrVzvo7VEXwMuFwKQsn68I=; b=RUEcfLb8v1qrMEFodped/iaVNm T2QJHBPeJZSoGM1wtSLt8VAFy6CSqHY8JS9Bg1pzWZy3i3NzUlyNRHUjmTiuDEeZZRbaadhtMQ0A5 zykLWQSsocLD7jJYgLRLksAmT37QD/2elfewQqz1Ld65Ml6ky9anzm78koHwYhJRUQ1pNwMN+gr/a GoVYN5v7U9iOU+wiVWGfNKHE7uuCi3q8Nc4bgLCWQNO0CjBJkTATXEQCsM6wCKg9gsK9GKez73e07 eAQNRMlbU+Dx6a3SqZORin8RtaLUSwi/mTSpTgAItrQ6sbwNKbGsoc0KFCTIBwLa0Qj83dg/ctQ2n hgJd4FWA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1x9nYF-0000000BpWH-3HMB; Thu, 24 Sep 2026 17:48:07 +0000 Received: from tor.source.kernel.org ([2600:3c04:e001:324:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1x9nYE-0000000BpW9-1vzk for linux-arm-kernel@lists.infradead.org; Thu, 24 Sep 2026 17:48:06 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id CDD6C601E4; Thu, 24 Sep 2026 17:48:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 85E091F000FF; Thu, 24 Sep 2026 17:48:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1790272085; bh=HrDCAQV1pZi3wvTFhrBJGDrVzvo7VEXwMuFwKQsn68I=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=cuwDHg0M0dcx8Zn4ENcoBoRVIKryfT/MqeBIfA/QVhTV75W6toAGmEqnAE3nm0ce9 hn07it7qaLs/bzlXIDQbToAPmQrc+w9VI/KaODzn0tTAzXN0JJE/nd69D6gQAAoRzS C8/hXdw9LuaDKyTiQqqB9jDh5KON7/ynOg5vX56gHc4G5Q1hfe4pT5aSorJ/ZP6GKU 8pNlcBBafUDjkcbWrWmGhb2ZVcQl+nHkaWrzV6+zg1E2qPFI7pdyQhcJZ21Irijzlq zIrGwNDveL0rH6dfE0qmRzA9qltaxQea62eC6nnfTuybfZbh7eJBoQHIFxhHjc4IR1 ToavUt2S74D2w== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1x9nYB-0000000D8pg-1TQT; Thu, 24 Sep 2026 17:48:03 +0000 Date: Thu, 24 Sep 2026 18:48:02 +0100 Message-ID: <86o6dm4k31.wl-maz@kernel.org> From: Marc Zyngier To: Zhu Ling 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 In-Reply-To: <20260923082804.13197-1-zhuling2709@phytium.com.cn> References: <6b668efe-ef7a-474a-957c-893755ebba46@linux.dev> <20260923082804.13197-1-zhuling2709@phytium.com.cn> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/30.1 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: zhuling2709@phytium.com.cn, tglx@kernel.org, radu@rendec.net, zenghui.yu@linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, 23 Sep 2026 09:28:04 +0100, Zhu Ling 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 Acked-by: Marc Zyngier M. -- Without deviation from the norm, progress is not possible.