diff options
author | Thorsten Blum <thorsten.blum@linux.dev> | 2024-11-05 11:18:14 +0100 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2024-11-13 18:56:48 +0100 |
commit | de183b2baf90f0acc1854a3998c14b8b228f9643 (patch) | |
tree | e05f6ed8caf2a394a11085750ef6c5825abbcb43 /fs/ext4 | |
parent | jbd2: avoid dozens of -Wflex-array-member-not-at-end warnings (diff) | |
download | linux-de183b2baf90f0acc1854a3998c14b8b228f9643.tar.xz linux-de183b2baf90f0acc1854a3998c14b8b228f9643.zip |
ext4: annotate struct fname with __counted_by()
Add the __counted_by compiler attribute to the flexible array member
name 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/20241105101813.10864-2-thorsten.blum@linux.dev
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/ext4')
-rw-r--r-- | fs/ext4/dir.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ext4/dir.c b/fs/ext4/dir.c index ef6a3c8f3a9a..233479647f1b 100644 --- a/fs/ext4/dir.c +++ b/fs/ext4/dir.c @@ -418,7 +418,7 @@ struct fname { __u32 inode; __u8 name_len; __u8 file_type; - char name[]; + char name[] __counted_by(name_len); }; /* |