From: "Gustavo A. R. Silva" <gustavoars@kernel.org>
To: Kees Cook <kees@kernel.org>,
"Gustavo A. R. Silva" <gustavoars@kernel.org>
Cc: linux-hardening@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 0/2][next] Add STACK_FLEX_ARRAY_SIZE() helper
Date: Tue, 22 Apr 2025 11:20:40 -0600 [thread overview]
Message-ID: <cover.1745342381.git.gustavoars@kernel.org> (raw)
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
next reply other threads:[~2025-04-22 17:20 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-22 17:20 Gustavo A. R. Silva [this message]
2025-04-22 17:21 ` [PATCH 1/2][next] overflow: Add STACK_FLEX_ARRAY_SIZE() helper 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1745342381.git.gustavoars@kernel.org \
--to=gustavoars@kernel.org \
--cc=kees@kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox