Re: [PATCH] slab: Introduce kmalloc_obj() and family

2024-08-12 Thread Kees Cook
On Fri, Aug 09, 2024 at 10:59:52AM +0200, Vlastimil Babka wrote: > On 8/8/24 01:54, Kees Cook wrote: > > Introduce type-aware kmalloc-family helpers to replace the common > > idioms for single, array, and flexible object allocations: > > > > ptr = kmalloc(sizeof(*ptr), gfp); > > ptr = kcal

Re: [PATCH] slab: Introduce kmalloc_obj() and family

2024-08-09 Thread Vlastimil Babka
On 8/8/24 01:54, Kees Cook wrote: > Introduce type-aware kmalloc-family helpers to replace the common > idioms for single, array, and flexible object allocations: > > ptr = kmalloc(sizeof(*ptr), gfp); > ptr = kcalloc(count, sizeof(*ptr), gfp); > ptr = kmalloc_array(count, sizeof(

[PATCH] slab: Introduce kmalloc_obj() and family

2024-08-07 Thread Kees Cook
Introduce type-aware kmalloc-family helpers to replace the common idioms for single, array, and flexible object allocations: ptr = kmalloc(sizeof(*ptr), gfp); ptr = kcalloc(count, sizeof(*ptr), gfp); ptr = kmalloc_array(count, sizeof(*ptr), gfp); ptr = kcalloc(count

Re: [PATCH] slab: Introduce kmalloc_obj() and family

2024-07-20 Thread Kees Cook
On Fri, Jul 19, 2024 at 08:50:41PM -0700, David Rientjes wrote: > On Fri, 19 Jul 2024, Kees Cook wrote: > > > diff --git a/include/linux/slab.h b/include/linux/slab.h > > index 7247e217e21b..3817554f2d51 100644 > > --- a/include/linux/slab.h > > +++ b/include/linux/slab.h > > @@ -665,6 +665,44 @@

Re: [PATCH] slab: Introduce kmalloc_obj() and family

2024-07-19 Thread David Rientjes
On Fri, 19 Jul 2024, Kees Cook wrote: > diff --git a/include/linux/slab.h b/include/linux/slab.h > index 7247e217e21b..3817554f2d51 100644 > --- a/include/linux/slab.h > +++ b/include/linux/slab.h > @@ -665,6 +665,44 @@ static __always_inline __alloc_size(1) void > *kmalloc_noprof(size_t size, gf

[PATCH] slab: Introduce kmalloc_obj() and family

2024-07-19 Thread Kees Cook
Introduce type-aware kmalloc-family helpers to replace the common idioms for single, array, and flexible object allocations: ptr = kmalloc(sizeof(*ptr), gfp); ptr = kcalloc(count, sizeof(*ptr), gfp); ptr = kmalloc_array(count, sizeof(*ptr), gfp); ptr = kcalloc(count