]> git.ipfire.org Git - thirdparty/linux.git/commit
Merge tag 'kmalloc_obj-v7.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 10 Feb 2026 17:11:21 +0000 (09:11 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 10 Feb 2026 17:11:21 +0000 (09:11 -0800)
commit958f7fb68c6be4e2d9dcb5bf31bfe746f6744aa3
tree84dfdd8d52eec4cfe4e05723bf31a2a197dc0388
parent85f24b0ace9aa79142f632fc3ccc730a8d2a4a28
parentbdc5071d7f7bb82589737741e9bf19820ceb7a6a
Merge tag 'kmalloc_obj-v7.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux

Pull kmalloc_obj updates from Kees Cook:
 "Introduce the kmalloc_obj* family of APIs for switching to type-based
  kmalloc allocations, away from purely size-based allocations.
  Discussed on lkml, with you, and at Linux Plumbers. It's been in -next
  for the entire dev cycle.

  Before the merge window closes, I'd like to send the treewide
  change (generated from the Coccinelle script included here), which
  mechanically converts almost 20k callsites from kmalloc* to
  kmalloc_obj*:

   8007 files changed, 19980 insertions(+), 20838 deletions(-)

  This change needed fixes for mismatched types (since now the return
  type from allocations is a pointer to the requested type, not "void
  *"), and I've been fixing these over the last 4 releases.

  These fixes have mostly been trivial mismatches with const qualifiers
  or accidentally identical sizes (e.g. same object size: "struct kvec"
  vs "struct iovec", or differing pointers to pointers), but I did catch
  one case of too-small allocation.

  Summary:

   - Introduce kmalloc_obj*() family of type-based allocator APIs

   - checkpatch: Suggest kmalloc_obj family for sizeof allocations

   - coccinelle: Add kmalloc_objs conversion script"

* tag 'kmalloc_obj-v7.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
  coccinelle: Add kmalloc_objs conversion script
  slab: Introduce kmalloc_flex() and family
  compiler_types: Introduce __flex_counter() and family
  checkpatch: Suggest kmalloc_obj family for sizeof allocations
  slab: Introduce kmalloc_obj() and family
include/linux/compiler_types.h
scripts/checkpatch.pl