All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2][next] Add STACK_FLEX_ARRAY_SIZE() helper
@ 2025-04-22 21:04 Gustavo A. R. Silva
  2025-04-22 21:05 ` [PATCH v2 1/2][next] overflow: " Gustavo A. R. Silva
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Gustavo A. R. Silva @ 2025-04-22 21:04 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   | 15 +++++++++++++++
 lib/tests/overflow_kunit.c |  4 ++++
 2 files changed, 19 insertions(+)

-- 
2.43.0


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

end of thread, other threads:[~2025-04-30 21:29 UTC | newest]

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

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.