All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2][next] Add STACK_FLEX_ARRAY_SIZE() helper
@ 2025-04-22 17:20 Gustavo A. R. Silva
  2025-04-22 17:21 ` [PATCH 1/2][next] overflow: " Gustavo A. R. Silva
  2025-04-22 17:22 ` [PATCH 2/2][next] kunit/overflow: Add tests for " Gustavo A. R. Silva
  0 siblings, 2 replies; 6+ messages in thread
From: Gustavo A. R. Silva @ 2025-04-22 17:20 UTC (permalink / raw)
  To: Kees Cook, Gustavo A. R. Silva; +Cc: linux-hardening, linux-kernel

Add new STACK_FLEX_ARRAY_SIZE() helper to get the size of a
flexible-array member defined using DEFINE_FLEX()/DEFINE_RAW_FLEX()
at compile time.

This is essentially the same as ARRAY_SIZE() but for on-stack
flexible-array members.

Gustavo A. R. Silva (2):
  overflow: Add STACK_FLEX_ARRAY_SIZE() helper
  kunit/overflow: Add tests for STACK_FLEX_ARRAY_SIZE() helper

 include/linux/overflow.h   | 13 +++++++++++++
 lib/tests/overflow_kunit.c |  3 +++
 2 files changed, 16 insertions(+)

-- 
2.43.0


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

end of thread, other threads:[~2025-04-22 20:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-22 17:20 [PATCH 0/2][next] Add STACK_FLEX_ARRAY_SIZE() helper Gustavo A. R. Silva
2025-04-22 17:21 ` [PATCH 1/2][next] overflow: " Gustavo A. R. Silva
2025-04-22 20:39   ` Kees Cook
2025-04-22 17:22 ` [PATCH 2/2][next] kunit/overflow: Add tests for " Gustavo A. R. Silva
2025-04-22 20:39   ` Kees Cook
2025-04-22 20:48     ` Gustavo A. R. Silva

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.