Skip to content

Commit 8d8d244

Browse files
tobluxsmfrench
authored andcommitted
smb: Annotate struct xattr_smb_acl with __counted_by()
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 <thorsten.blum@toblux.com> Acked-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent 780bdc1 commit 8d8d244

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

fs/smb/server/xattr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ struct xattr_acl_entry {
7676
struct xattr_smb_acl {
7777
int count;
7878
int next;
79-
struct xattr_acl_entry entries[];
79+
struct xattr_acl_entry entries[] __counted_by(count);
8080
};
8181

8282
/* 64bytes hash in xattr_ntacl is computed with sha256 */

0 commit comments

Comments
 (0)