Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp758086rdh; Sun, 24 Sep 2023 10:20:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEoiHB0rAs3xwir0fAOOfkBERPdAZ8eetF1VUj0DKbnJCZoo8NxivXMxU/N2bBUSAaIieeu X-Received: by 2002:a17:90a:a516:b0:277:3565:30cf with SMTP id a22-20020a17090aa51600b00277356530cfmr4812477pjq.6.1695576032876; Sun, 24 Sep 2023 10:20:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695576032; cv=none; d=google.com; s=arc-20160816; b=IRm7/vZw8El3Cwc2lWFy5bkYP6VcgpeUqGNXUJP7O17c8jjs/pAo1Prggtx3dLaTXU wdRjMrf62Up/ZE0DqXUzg3BQPrvnqWy6yMpPdz1pKCPmsk0ROE8/vN4bCmRyc7+LLuG6 Dj//ndM/nMPN0R2oZ7TLbGn205iYdW3esJy6LGKZoFVMOmBZZF79oIFQAM8qieHOAZym /MkWB5YhLGbZwV4BqcTEBDzgn58GhpeYHrwRHc7+OfXunVyYMp61kQa7WPkXXkW0s3om GQOXXPbfJYal5ZjIjbCJxxE/RF74L677A5/gSvT/Y3blagfQTW/1IdrFGPxmAqNis32/ qtNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=fT6iTXbOHGfCjfaGt+1WCThYSn0gcCFJToGGpaQ5K74=; fh=yiWHAZDJiVufVm+SQRQdUs1S+qWh2QVPsdwpUIYQGgo=; b=gP+udtZoapHvo1CVmbKbJazCzsGBgI0VKotPiyvbnnSXfVbY4fsafpZS5jMwjrfBfG /fTBg9HmGQiuGyrrxYgJsPIMcgHuHUIqacUIlzcWtfPV32sQaLQOTtNAEdo4XByfF3ha 8gicCJbYa3hEXoTvsToWO9M762tWWRIjLFyRhjmkeAEYR/hnrAid73RJTiTdoFo2qlP7 Z/JnC51axq3X7pt2FuSO0EfbdwSX67lK7CpyF4q9PRVoXfZLvKImYjpMEL4wH9WapK3W HxARms+i5MwhS4m3MO5eH2TCrZp+zog1B/jEwnOMPXxorWDCBZKIwaW7HWoVSRYCOEq8 wA0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=G0LbBYFV; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=A3xfMTfx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id cf4-20020a056a02084400b00577ed0133d2si8038801pgb.453.2023.09.24.10.20.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Sep 2023 10:20:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=G0LbBYFV; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=A3xfMTfx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 4540F8075B24; Sun, 24 Sep 2023 03:40:51 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229918AbjIXKkX (ORCPT + 99 others); Sun, 24 Sep 2023 06:40:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229646AbjIXKkW (ORCPT ); Sun, 24 Sep 2023 06:40:22 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C015100; Sun, 24 Sep 2023 03:40:16 -0700 (PDT) Date: Sun, 24 Sep 2023 10:40:14 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1695552015; 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=fT6iTXbOHGfCjfaGt+1WCThYSn0gcCFJToGGpaQ5K74=; b=G0LbBYFVICUFsrdU5v+tbadO9WEMUZVMcXarsZ2ud9VTSfBiHE8YDO4hoD3RSEXS2/+FAq vgAMNjfGbQGawNYSncCeM3QnS9oL4TKFbURG7cS3bKY1YW1gQNuPWn0gUofAIh3L4C6Yah iM3kjbeMvYrUHntsFFPNs8jvn9qiBh4cvG9xVC3+UGgHFaxYUWPjyXB63BM6t7UseFtHK8 Du170ptkRYYDhXtstRxrAdY/NPgpIq67YuC7WoD4u7E2dWBHMxrlY9Qea8+bYD+juTfF3l vJ34+C7XOFKAV030KrayHK6Mbh04OjdtHL7Perp8aAmJMe118rYziagBUMBqEQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1695552015; 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=fT6iTXbOHGfCjfaGt+1WCThYSn0gcCFJToGGpaQ5K74=; b=A3xfMTfxE+VcZK5OQ4LUUOA1JEKZ+kQDmj352wo0zdzH1RZxohl65Rc6xuMUbzITC+E4rh GaKcRXTyCHcY+pCg== 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: x86/platform] x86/platform/uv: Annotate struct uv_rtc_timer_head with __counted_by Cc: Kees Cook , Ingo Molnar , "Gustavo A. R. Silva" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230922175151.work.118-kees@kernel.org> References: <20230922175151.work.118-kees@kernel.org> MIME-Version: 1.0 Message-ID: <169555201447.27769.7624440543285631039.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: 7bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Sun, 24 Sep 2023 03:40:51 -0700 (PDT) The following commit has been merged into the x86/platform branch of tip: Commit-ID: d9a01959d9c954c8fe1d132b52401b0e219e37f6 Gitweb: https://git.kernel.org/tip/d9a01959d9c954c8fe1d132b52401b0e219e37f6 Author: Kees Cook AuthorDate: Fri, 22 Sep 2023 10:51:51 -07:00 Committer: Ingo Molnar CommitterDate: Sun, 24 Sep 2023 12:02:58 +02:00 x86/platform/uv: Annotate struct uv_rtc_timer_head 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). Found with Coccinelle: https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Add __counted_by for struct uv_rtc_timer_head. Signed-off-by: Kees Cook Signed-off-by: Ingo Molnar Reviewed-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/20230922175151.work.118-kees@kernel.org --- arch/x86/platform/uv/uv_time.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/platform/uv/uv_time.c b/arch/x86/platform/uv/uv_time.c index 54663f3..ff5afc8 100644 --- a/arch/x86/platform/uv/uv_time.c +++ b/arch/x86/platform/uv/uv_time.c @@ -53,7 +53,7 @@ struct uv_rtc_timer_head { struct { int lcpu; /* systemwide logical cpu number */ u64 expires; /* next timer expiration for this cpu */ - } cpu[]; + } cpu[] __counted_by(ncpus); }; /*