llvm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Add __counted_by_ptr macro
@ 2025-11-21 19:39 Bill Wendling
  2025-11-21 19:39 ` [PATCH 1/2] Compiler Attributes: " Bill Wendling
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Bill Wendling @ 2025-11-21 19:39 UTC (permalink / raw)
  To: linux-kernel
  Cc: Bill Wendling, Kees Cook, Gustavo A. R. Silva, Nathan Chancellor,
	Nick Desaulniers, Justin Stitt, linux-hardening, llvm

These patches add the __counted_by_ptr macro and then uses it in
mm/memblock.h. The name of the __counted_by_ptr attribute is the same as
__counted_by, but two different macros are needed, because of feature
skew in GCC and clang. Once the minmum versions of the compilers support
'counted_by' on both flexible array members and pointers in structs,
this macro will become obsolete.

Bill Wendling (2):
  Compiler Attributes: Add __counted_by_ptr macro
  memblock: annotate struct memblock_type with __counted_by_ptr

 include/linux/compiler_types.h | 11 +++++++++++
 include/linux/memblock.h       |  2 +-
 init/Kconfig                   |  5 +++++
 3 files changed, 17 insertions(+), 1 deletion(-)

-- 
2.52.0.rc2.455.g230fcf2819-goog


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

end of thread, other threads:[~2025-11-24 20:16 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-21 19:39 [PATCH 0/2] Add __counted_by_ptr macro Bill Wendling
2025-11-21 19:39 ` [PATCH 1/2] Compiler Attributes: " Bill Wendling
2025-11-21 19:46   ` Bill Wendling
2025-11-21 19:54   ` [PATCH v2 " Bill Wendling
2025-11-21 21:47     ` Miguel Ojeda
2025-11-24 20:01       ` Bill Wendling
2025-11-21 19:39 ` [PATCH 2/2] memblock: annotate struct memblock_type with __counted_by_ptr Bill Wendling
2025-11-22  0:30   ` Kees Cook
2025-11-22 22:16     ` Andrew Morton
2025-11-24 19:19       ` Kees Cook
2025-11-24 20:15         ` Bill Wendling
2025-11-21 23:25 ` [PATCH 0/2] Add __counted_by_ptr macro Kees Cook
2025-11-24 20:05   ` Bill Wendling

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).