Skip to content

Commit cc34c66

Browse files
tobluxkees
authored andcommitted
ecryptfs: Annotate struct ecryptfs_message with __counted_by
Add the __counted_by() compiler attribute to the flexible array member 'data' to improve access bounds-checking via CONFIG_UBSAN_BOUNDS and CONFIG_FORTIFY_SOURCE. Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> Acked-by: Tyler Hicks <code@tyhicks.com> Link: https://patch.msgid.link/20260112115314.739612-2-thorsten.blum@linux.dev Signed-off-by: Kees Cook <kees@kernel.org>
1 parent 7583873 commit cc34c66

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

fs/ecryptfs/ecryptfs_kernel.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ struct ecryptfs_message {
359359
/* Inherits from msg_ctx->index */
360360
u32 index;
361361
u32 data_len;
362-
u8 data[];
362+
u8 data[] __counted_by(data_len);
363363
};
364364

365365
struct ecryptfs_msg_ctx {

0 commit comments

Comments
 (0)