public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH RESEND] crypto: af_alg - Annotate struct af_alg_iv with __counted_by
@ 2026-01-05 12:24 Thorsten Blum
  2026-01-12 22:30 ` Kees Cook
  0 siblings, 1 reply; 2+ messages in thread
From: Thorsten Blum @ 2026-01-05 12:24 UTC (permalink / raw)
  To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Kees Cook, Gustavo A. R. Silva
  Cc: Thorsten Blum, Simon Horman, netdev, linux-kernel,
	linux-hardening

Add the __counted_by() compiler attribute to the flexible array member
'iv' to improve access bounds-checking via CONFIG_UBSAN_BOUNDS and
CONFIG_FORTIFY_SOURCE.

Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
 include/uapi/linux/if_alg.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/uapi/linux/if_alg.h b/include/uapi/linux/if_alg.h
index b35871cbeed7..4f51e198ac2e 100644
--- a/include/uapi/linux/if_alg.h
+++ b/include/uapi/linux/if_alg.h
@@ -42,7 +42,7 @@ struct sockaddr_alg_new {
 
 struct af_alg_iv {
 	__u32	ivlen;
-	__u8	iv[];
+	__u8	iv[] __counted_by(ivlen);
 };
 
 /* Socket options */
-- 
Thorsten Blum <thorsten.blum@linux.dev>
GPG: 1D60 735E 8AEF 3BE4 73B6  9D84 7336 78FD 8DFE EAD4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH RESEND] crypto: af_alg - Annotate struct af_alg_iv with __counted_by
  2026-01-05 12:24 [PATCH RESEND] crypto: af_alg - Annotate struct af_alg_iv with __counted_by Thorsten Blum
@ 2026-01-12 22:30 ` Kees Cook
  0 siblings, 0 replies; 2+ messages in thread
From: Kees Cook @ 2026-01-12 22:30 UTC (permalink / raw)
  To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Gustavo A. R. Silva, Thorsten Blum
  Cc: Kees Cook, Simon Horman, netdev, linux-kernel, linux-hardening

On Mon, 05 Jan 2026 13:24:03 +0100, Thorsten Blum wrote:
> Add the __counted_by() compiler attribute to the flexible array member
> 'iv' to improve access bounds-checking via CONFIG_UBSAN_BOUNDS and
> CONFIG_FORTIFY_SOURCE.
> 
> 

Applied to for-next/hardening, thanks!

[1/1] crypto: af_alg - Annotate struct af_alg_iv with __counted_by
      https://git.kernel.org/kees/c/98569017111e

Take care,

-- 
Kees Cook


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-01-12 22:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-05 12:24 [PATCH RESEND] crypto: af_alg - Annotate struct af_alg_iv with __counted_by Thorsten Blum
2026-01-12 22:30 ` Kees Cook

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox