Skip to content

Commit

Permalink
btrfs: send: annotate struct name_cache_entry with __counted_by()
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Thorsten Blum <[email protected]>
Reviewed-by: David Sterba <[email protected]>
Signed-off-by: David Sterba <[email protected]>
  • Loading branch information
toblux authored and kdave committed Aug 15, 2024
1 parent 6252690 commit c0247d2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/btrfs/send.c
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ struct name_cache_entry {
int ret;
int need_later_update;
int name_len;
char name[];
char name[] __counted_by(name_len);
};

/* See the comment at lru_cache.h about struct btrfs_lru_cache_entry. */
Expand Down

0 comments on commit c0247d2

Please sign in to comment.