summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThorsten Blum <thorsten.blum@linux.dev>2025-05-03 16:25:36 +0300
committerMiklos Szeredi <mszeredi@redhat.com>2025-05-05 13:49:20 +0300
commit6f9ccdad0feaef58b05f07e0fc9d31004147177c (patch)
treed2c031bc02c3993e5a5e61724e71f34e5ac3221f
parent7314166ee7592513c77cfbb8ff579f376039f9c4 (diff)
downloadlinux-6f9ccdad0feaef58b05f07e0fc9d31004147177c.tar.xz
ovl: Annotate struct ovl_entry with __counted_by()
Add the __counted_by() compiler attribute to the flexible array member '__lowerstack' to improve access bounds-checking via CONFIG_UBSAN_BOUNDS and CONFIG_FORTIFY_SOURCE. Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
-rw-r--r--fs/overlayfs/ovl_entry.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/overlayfs/ovl_entry.h b/fs/overlayfs/ovl_entry.h
index cb449ab310a7..afb7762f873f 100644
--- a/fs/overlayfs/ovl_entry.h
+++ b/fs/overlayfs/ovl_entry.h
@@ -51,7 +51,7 @@ struct ovl_path {
struct ovl_entry {
unsigned int __numlower;
- struct ovl_path __lowerstack[];
+ struct ovl_path __lowerstack[] __counted_by(__numlower);
};
/* private information held for overlayfs's superblock */