summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThorsten Blum <thorsten.blum@linux.dev>2024-10-15 22:27:31 +0200
committerTrond Myklebust <trond.myklebust@hammerspace.com>2024-11-08 14:26:20 -0500
commite8e26a0b09f5783be471b5ffb1e31822b1272c1d (patch)
treeeec1b5f10017b2ee187b93f03d97728e5c5053a4
parent79a66e1465561f7baa3ff3daf79800fc241afeeb (diff)
downloadlwn-e8e26a0b09f5783be471b5ffb1e31822b1272c1d.tar.gz
lwn-e8e26a0b09f5783be471b5ffb1e31822b1272c1d.zip
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 <thorsten.blum@linux.dev> Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
-rw-r--r--include/linux/nfs_xdr.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index 12d8e47bc5a3..559273a0f16d 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -1336,7 +1336,7 @@ struct pnfs_commit_array {
struct rcu_head rcu;
refcount_t refcount;
unsigned int nbuckets;
- struct pnfs_commit_bucket buckets[];
+ struct pnfs_commit_bucket buckets[] __counted_by(nbuckets);
};
struct pnfs_ds_commit_info {