diff options
| author | Thorsten Blum <thorsten.blum@linux.dev> | 2026-01-05 15:20:53 +0300 |
|---|---|---|
| committer | Kees Cook <kees@kernel.org> | 2026-01-15 01:43:18 +0300 |
| commit | 7583873c31147be9869902e3274e3faa67e06176 (patch) | |
| tree | ffddb51a4cb9c9adbb9faf8db5efab34a36ef7b4 /include | |
| parent | dacbfc16780837aa3e00c684d89492d211fd809f (diff) | |
| download | linux-7583873c31147be9869902e3274e3faa67e06176.tar.xz | |
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>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/xattr.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/xattr.h b/include/linux/xattr.h index 64e9afe7d647..296b5ee5c979 100644 --- a/include/linux/xattr.h +++ b/include/linux/xattr.h @@ -114,7 +114,7 @@ struct simple_xattr { struct rb_node rb_node; char *name; size_t size; - char value[]; + char value[] __counted_by(size); }; void simple_xattrs_init(struct simple_xattrs *xattrs); |
