lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <174119638803.14745.5873726326719106728.tip-bot2@tip-bot2>
Date: Wed, 05 Mar 2025 17:39:47 -0000
From: "tip-bot2 for Thorsten Blum" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Thorsten Blum <thorsten.blum@...ux.dev>, Ingo Molnar <mingo@...nel.org>,
 x86@...nel.org, linux-kernel@...r.kernel.org
Subject: [tip: perf/core] perf/x86: Annotate struct bts_buffer::buf with
 __counted_by()

The following commit has been merged into the perf/core branch of tip:

Commit-ID:     5e7adc81ae1b27ff565714d2933b291cf1e1271f
Gitweb:        https://git.kernel.org/tip/5e7adc81ae1b27ff565714d2933b291cf1e1271f
Author:        Thorsten Blum <thorsten.blum@...ux.dev>
AuthorDate:    Wed, 05 Mar 2025 13:31:34 +01:00
Committer:     Ingo Molnar <mingo@...nel.org>
CommitterDate: Wed, 05 Mar 2025 18:28:22 +01:00

perf/x86: Annotate struct bts_buffer::buf with __counted_by()

Add the __counted_by() compiler attribute to the flexible array member
buf to improve access bounds-checking via CONFIG_UBSAN_BOUNDS and
CONFIG_FORTIFY_SOURCE.

No functional changes intended.

Signed-off-by: Thorsten Blum <thorsten.blum@...ux.dev>
Signed-off-by: Ingo Molnar <mingo@...nel.org>
Link: https://lore.kernel.org/r/20250305123134.215577-2-thorsten.blum@linux.dev
---
 arch/x86/events/intel/bts.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/events/intel/bts.c b/arch/x86/events/intel/bts.c
index 8e09319..953868d 100644
--- a/arch/x86/events/intel/bts.c
+++ b/arch/x86/events/intel/bts.c
@@ -58,7 +58,7 @@ struct bts_buffer {
 	local_t		head;
 	unsigned long	end;
 	void		**data_pages;
-	struct bts_phys	buf[];
+	struct bts_phys	buf[] __counted_by(nr_bufs);
 };
 
 static struct pmu bts_pmu;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ