Skip to content

Commit 6f9ccda

Browse files
tobluxMiklos Szeredi
authored andcommitted
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 <[email protected]> Signed-off-by: Miklos Szeredi <[email protected]>
1 parent 7314166 commit 6f9ccda

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/overlayfs/ovl_entry.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ struct ovl_path {
5151

5252
struct ovl_entry {
5353
unsigned int __numlower;
54-
struct ovl_path __lowerstack[];
54+
struct ovl_path __lowerstack[] __counted_by(__numlower);
5555
};
5656

5757
/* private information held for overlayfs's superblock */

0 commit comments

Comments
 (0)