Linux Hardening
 help / color / mirror / Atom feed
* [PATCH] unwind deferred: Annotate struct unwind_cache with __counted_by
@ 2025-11-14 12:27 Thorsten Blum
  2025-11-14 13:43 ` Steven Rostedt
  0 siblings, 1 reply; 11+ messages in thread
From: Thorsten Blum @ 2025-11-14 12:27 UTC (permalink / raw)
  To: Josh Poimboeuf, Steven Rostedt, Kees Cook, Gustavo A. R. Silva
  Cc: Thorsten Blum, linux-kernel, linux-hardening

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

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
 include/linux/unwind_deferred_types.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/unwind_deferred_types.h b/include/linux/unwind_deferred_types.h
index 33b62ac25c86..d4b67f0116f3 100644
--- a/include/linux/unwind_deferred_types.h
+++ b/include/linux/unwind_deferred_types.h
@@ -5,7 +5,7 @@
 struct unwind_cache {
 	unsigned long		unwind_completed;
 	unsigned int		nr_entries;
-	unsigned long		entries[];
+	unsigned long		entries[] __counted_by(nr_entries);
 };
 
 /*
-- 
2.51.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2025-11-14 16:15 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-14 12:27 [PATCH] unwind deferred: Annotate struct unwind_cache with __counted_by Thorsten Blum
2025-11-14 13:43 ` Steven Rostedt
2025-11-14 13:53   ` Steven Rostedt
2025-11-14 14:57     ` Steven Rostedt
2025-11-14 15:02     ` David Laight
2025-11-14 15:48       ` Steven Rostedt
2025-11-14 14:31   ` David Laight
2025-11-14 14:56     ` Steven Rostedt
2025-11-14 15:49       ` Steven Rostedt
2025-11-14 15:53         ` Steven Rostedt
2025-11-14 16:15         ` Thorsten Blum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox