Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

fs/xattr: Annotate struct simple_xattr with __counted_by

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

Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Link: https://patch.msgid.link/20260105122057.2347-2-thorsten.blum@linux.dev
Signed-off-by: Kees Cook <kees@kernel.org>

authored by

Thorsten Blum and committed by
Kees Cook
7583873c dacbfc16

+1 -1
+1 -1
include/linux/xattr.h
··· 114 114 struct rb_node rb_node; 115 115 char *name; 116 116 size_t size; 117 - char value[]; 117 + char value[] __counted_by(size); 118 118 }; 119 119 120 120 void simple_xattrs_init(struct simple_xattrs *xattrs);