Commit 01cdf03b authored by Thorsten Blum's avatar Thorsten Blum Committed by Theodore Ts'o
Browse files

ext4: annotate struct ext4_xattr_inode_array with __counted_by()



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

Remove the now obsolete comment on the count field.

In ext4_expand_inode_array(), use struct_size() instead of offsetof()
and remove the local variable count. Increment the count field before
adding a new inode to the inodes array.

Compile-tested only.

Signed-off-by: default avatarThorsten Blum <thorsten.blum@toblux.com>
Link: https://patch.msgid.link/20240730220200.410939-3-thorsten.blum@toblux.com


Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
parent 736c24e6
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment