Skip to content

Commit de183b2

Browse files
tobluxtytso
authored andcommitted
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 <[email protected]> Signed-off-by: Thorsten Blum <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Theodore Ts'o <[email protected]>
1 parent 2bd9077 commit de183b2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/ext4/dir.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ struct fname {
418418
__u32 inode;
419419
__u8 name_len;
420420
__u8 file_type;
421-
char name[];
421+
char name[] __counted_by(name_len);
422422
};
423423

424424
/*

0 commit comments

Comments
 (0)