From: Thorsten Blum Date: Sat, 3 May 2025 13:25:36 +0000 (+0200) Subject: ovl: Annotate struct ovl_entry with __counted_by() X-Git-Tag: v6.16-rc1~22^2 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=6f9ccdad0feaef58b05f07e0fc9d31004147177c;p=linux-block.git 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 Signed-off-by: Miklos Szeredi --- 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 */