Re: [PATCH] ext4: Annotate struct ext4_xattr_inode_array with __counted_by()

From: Thorsten Blum
Date: Tue Jul 30 2024 - 13:13:32 EST


On 29. Jul 2024, at 16:09, Gustavo A. R. Silva <gustavo@xxxxxxxxxxxxxx> wrote:
> On 29/07/24 05:04, Thorsten Blum wrote:
>> 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.
>
> This change seems to be incomplete. The relationship between `count` and
> accesses to `inodes` should be adjusted at least in `ext4_expand_inode_array()`
>
> See this for more details:
>
> https://embeddedor.com/blog/2024/06/18/how-to-use-the-new-counted_by-attribute-in-c-and-linux/

Thanks. I'll submit a v2 shortly.

Thorsten