From nobody Tue Dec 16 13:49:47 2025 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E0928CE7B19 for ; Thu, 28 Sep 2023 10:32:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231321AbjI1Kcr (ORCPT ); Thu, 28 Sep 2023 06:32:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231277AbjI1Kcm (ORCPT ); Thu, 28 Sep 2023 06:32:42 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F3C7122; Thu, 28 Sep 2023 03:32:41 -0700 (PDT) Date: Thu, 28 Sep 2023 10:32:38 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1695897159; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tYmau7IMl7WD2vSqAsJO1NOZjklCa/Lh+h32BSGKsfg=; b=dq9tZ/c6tKrFbBdurzccbRSM4NT/LiWfOSNApkP0hxdWF5JtgR45DwlWSGedTwqs/4Myen WyGMQ1doOG9XCSGZ+pyTgE+BMxVj0jwKtb1ZkOyoFcRmKwaXTwMKuz6IRmMzCpZxbW7br8 9BXdzsGkx+VNbogDftJS2RjvcNGWA3FINyftTEJYYBvJ6VSxZSe6Y4BJ/2mXUiXCcGCEzx 0bBz30V44qkdENThcfGvXw889e5HMm65HMI1SSXohhyZP/JRWc9FA3BslqLuxc4mmcNtZE fF1uglxixSvwOz3xWOfrAjNJ+kyJ0B58/RuRytz7PukYzxFANKFtz0U3VvpmVA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1695897159; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tYmau7IMl7WD2vSqAsJO1NOZjklCa/Lh+h32BSGKsfg=; b=OjLa2oqg288XV6d2qE/rfOCJsuuRZ0uUWotWLBBFxO+3qqDn6HGauMKpbRa5MelEocOIfG p6ZXKRB/UAyiHyDg== From: "tip-bot2 for Kees Cook" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: irq/core] irqdomain: Annotate struct irq_domain with __counted_by Cc: Kees Cook , Thomas Gleixner , "Gustavo A. R. Silva" , x86@kernel.org, linux-kernel@vger.kernel.org, maz@kernel.org In-Reply-To: <20230922175127.work.214-kees@kernel.org> References: <20230922175127.work.214-kees@kernel.org> MIME-Version: 1.0 Message-ID: <169589715833.27769.918219900124749489.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the irq/core branch of tip: Commit-ID: 6260ecd04594360ae2af104fb2641317728a66e4 Gitweb: https://git.kernel.org/tip/6260ecd04594360ae2af104fb26413177= 28a66e4 Author: Kees Cook AuthorDate: Fri, 22 Sep 2023 10:51:27 -07:00 Committer: Thomas Gleixner CommitterDate: Thu, 28 Sep 2023 12:25:31 +02:00 irqdomain: Annotate struct irq_domain with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct irq_domain. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/cou= nted_by.cocci Signed-off-by: Kees Cook Signed-off-by: Thomas Gleixner Reviewed-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/20230922175127.work.214-kees@kernel.org --- include/linux/irqdomain.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h index 51c254b..ee0a82c 100644 --- a/include/linux/irqdomain.h +++ b/include/linux/irqdomain.h @@ -174,7 +174,7 @@ struct irq_domain { irq_hw_number_t hwirq_max; unsigned int revmap_size; struct radix_tree_root revmap_tree; - struct irq_data __rcu *revmap[]; + struct irq_data __rcu *revmap[] __counted_by(revmap_size); }; =20 /* Irq domain flags */