Skip to content

Commit e8e26a0

Browse files
tobluxTrond Myklebust
authored andcommitted
nfs: Annotate struct pnfs_commit_array with __counted_by()
Add the __counted_by compiler attribute to the flexible array member buckets to improve access bounds-checking via CONFIG_UBSAN_BOUNDS and CONFIG_FORTIFY_SOURCE. Compile-tested only. Signed-off-by: Thorsten Blum <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
1 parent 79a66e1 commit e8e26a0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/linux/nfs_xdr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1336,7 +1336,7 @@ struct pnfs_commit_array {
13361336
struct rcu_head rcu;
13371337
refcount_t refcount;
13381338
unsigned int nbuckets;
1339-
struct pnfs_commit_bucket buckets[];
1339+
struct pnfs_commit_bucket buckets[] __counted_by(nbuckets);
13401340
};
13411341

13421342
struct pnfs_ds_commit_info {

0 commit comments

Comments
 (0)