[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aWWiuLuqdhIIPgkJ@yaupon>
Date: Mon, 12 Jan 2026 19:41:12 -0600
From: Tyler Hicks <code@...icks.com>
To: Thorsten Blum <thorsten.blum@...ux.dev>
Cc: Kees Cook <kees@...nel.org>,
"Gustavo A. R. Silva" <gustavoars@...nel.org>,
Christian Brauner <brauner@...nel.org>,
Al Viro <viro@...iv.linux.org.uk>,
Eric Biggers <ebiggers@...nel.org>,
Ard Biesheuvel <ardb@...nel.org>, ecryptfs@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-hardening@...r.kernel.org
Subject: Re: [PATCH] ecryptfs: Annotate struct ecryptfs_message with
__counted_by
On 2026-01-12 12:53:11, Thorsten Blum wrote:
> 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@...ux.dev>
Nice! I wasn't aware of this attribute. I'm surprised it isn't
documented under Documentation/.
Acked-by: Tyler Hicks <code@...icks.com>
Thank you!
Tyler
> ---
> fs/ecryptfs/ecryptfs_kernel.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/ecryptfs/ecryptfs_kernel.h b/fs/ecryptfs/ecryptfs_kernel.h
> index 62a2ea7f59ed..f58b12be8267 100644
> --- a/fs/ecryptfs/ecryptfs_kernel.h
> +++ b/fs/ecryptfs/ecryptfs_kernel.h
> @@ -359,7 +359,7 @@ struct ecryptfs_message {
> /* Inherits from msg_ctx->index */
> u32 index;
> u32 data_len;
> - u8 data[];
> + u8 data[] __counted_by(data_len);
> };
>
> struct ecryptfs_msg_ctx {
> --
> Thorsten Blum <thorsten.blum@...ux.dev>
> GPG: 1D60 735E 8AEF 3BE4 73B6 9D84 7336 78FD 8DFE EAD4
>
Powered by blists - more mailing lists