ext4: Annotate struct fname with __counted_by()
PATCH RESEND v2 1/1 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]>
---
Changes in v2:
- Split the patch into two separate patches as suggested by Greg KH
- Link to v1: https://lore.kernel.org/r/[email protected]/
--- fs/ext4/dir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ext4/dir.c +1 -1
@@ -418,7 +418,7 @@ struct fname {__u32 inode;__u8 name_len;__u8 file_type; -char name[]; + char name[] __counted_by(name_len); };/*
Signature · 1 line
2.47.0