Skip to content

Commit

Permalink
smb: Annotate struct xattr_smb_acl 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
entries to improve access bounds-checking via CONFIG_UBSAN_BOUNDS and
CONFIG_FORTIFY_SOURCE.

Signed-off-by: Thorsten Blum <[email protected]>
Acked-by: Namjae Jeon <[email protected]>
Signed-off-by: Steve French <[email protected]>
  • Loading branch information
toblux authored and Steve French committed Aug 30, 2024
1 parent 780bdc1 commit 8d8d244
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/smb/server/xattr.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ struct xattr_acl_entry {
struct xattr_smb_acl {
int count;
int next;
struct xattr_acl_entry entries[];
struct xattr_acl_entry entries[] __counted_by(count);
};

/* 64bytes hash in xattr_ntacl is computed with sha256 */
Expand Down

0 comments on commit 8d8d244

Please sign in to comment.