Hi,
Here's a refresh and update on the kmalloc_obj() API proposal for
discussion here and at LPC[1]. Please see patch 2 for the bulk of the
details. And note that this is obviously not v6.19 material! :)
The tree-wide patch for conversions is here:
https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git/commit/?h=dev/v6.18-rc6/alloc_obj/v5&id=f79ee96ad6a3cafdb274fe15d3ae067724e72327
Thanks!
-Kees
[1] https://lpc.events/event/19/contributions/2136/
v5:
- switch to using assignment with type as first argument (Linus)
- fix various comment, commit log, and kern-docs (Randy, Miguel)
- renamed flex_counter internal helpers with "__" prefix (Przemek)
v4: https://lore.kernel.org/lkml/20250315025852.it.568-kees@kernel.org/
v3: https://lore.kernel.org/lkml/20240822231324.make.666-kees@kernel.org/
v2: https://lore.kernel.org/lkml/20240807235433.work.317-kees@kernel.org/
v1: https://lore.kernel.org/lkml/20240719192744.work.264-kees@kernel.org/
Kees Cook (4):
compiler_types: Introduce __flex_counter() and family
slab: Introduce kmalloc_obj() and family
checkpatch: Suggest kmalloc_obj family for sizeof allocations
coccinelle: Add kmalloc_objs conversion script
scripts/checkpatch.pl | 39 ++++-
scripts/coccinelle/api/kmalloc_objs.cocci | 168 +++++++++++++++++++++
Documentation/process/deprecated.rst | 42 ++++++
include/linux/compiler_types.h | 31 ++++
include/linux/overflow.h | 40 +++++
include/linux/slab.h | 172 ++++++++++++++++++++++
6 files changed, 486 insertions(+), 6 deletions(-)
create mode 100644 scripts/coccinelle/api/kmalloc_objs.cocci
--
2.34.1