Skip to content
Unverified Commit 8c6e03ff authored by Thorsten Blum's avatar Thorsten Blum Committed by Christian Brauner
Browse files

acl: Annotate struct posix_acl with __counted_by()



Add the __counted_by compiler attribute to the flexible array member
a_entries to improve access bounds-checking via CONFIG_UBSAN_BOUNDS and
CONFIG_FORTIFY_SOURCE.

Use struct_size() to calculate the number of bytes to allocate for new
and cloned acls and remove the local size variables.

Change the posix_acl_alloc() function parameter count from int to
unsigned int to match posix_acl's a_count data type. Add identifier
names to the function definition to silence two checkpatch warnings.

Reviewed-by: default avatarJan Kara <jack@suse.cz>
Signed-off-by: default avatarThorsten Blum <thorsten.blum@linux.dev>
Link: https://lore.kernel.org/r/20241018121426.155247-2-thorsten.blum@linux.dev


Cc: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
parent 99bdadbd
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment