Re: [PATCH v1] slab: support for compiler-assisted type-based slab cache partitioning
From: Marco Elver
Date: Thu Apr 02 2026 - 15:09:39 EST
On Thu, 2 Apr 2026 at 19:05, Dan Carpenter <error27@xxxxxxxxx> wrote:
>
> On Thu, Apr 02, 2026 at 03:48:20PM +0200, Marco Elver wrote:
> > On Thu, 2 Apr 2026 at 15:33, Dan Carpenter <error27@xxxxxxxxx> wrote:
> > >
> > > Hi Marco,
> > >
> > > kernel test robot noticed the following build warnings:
> > >
> > > https://git-scm.com/docs/git-format-patch#_base_tree_information]
> > >
> > > url: https://github.com/intel-lab-lkp/linux/commits/Marco-Elver/slab-support-for-compiler-assisted-type-based-slab-cache-partitioning/20260401-035608
> > > base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
> > > patch link: https://lore.kernel.org/r/20260331111240.153913-1-elver%40google.com
> > > patch subject: [PATCH v1] slab: support for compiler-assisted type-based slab cache partitioning
> > > config: um-randconfig-r072-20260401
> > > compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
> > > smatch: v0.5.0-9004-gb810ac53
> > >
> > > If you fix the issue in a separate patch/commit (i.e. not just a new version of
> > > the same patch/commit), kindly add following tags
> > > | Reported-by: kernel test robot <lkp@xxxxxxxxx>
> > > | Reported-by: Dan Carpenter <error27@xxxxxxxxx>
> > > | Closes: https://lore.kernel.org/r/202604020400.jEq32K95-lkp@xxxxxxxxx/
> > >
> > > New smatch warnings:
> > > drivers/misc/lkdtm/heap.c:118 lkdtm_READ_AFTER_FREE() warn: potential pointer math issue ('base' is a 32 bit pointer)
> > > drivers/misc/lkdtm/heap.c:169 lkdtm_KFENCE_READ_AFTER_FREE() warn: potential pointer math issue ('base' is a 32 bit pointer)
> >
> > How is this related to the patch I sent? Did the <linux/slab.h> change
> > force rechecking of all these files and it found latent issues?
> >
>
> Oh, crud. It turns out that for this check Smatch allows
> integer_array[sizeof()]so long as we know that the index is within
> bounds. What happened is that your patch renamed the kmalloc()
> function so Smatch stopped knowing the size of the buffer.
Oh, I see. Smatch doesn't respect the __alloc_size attribute then?
> For these zero day bot warnings, the emails are automatically generated
> so I don't have any context outside what's in the email. I saw that
> Kees wrote the code, but I figured maybe you forwarded it or something.
> Sorry about that.
No worries and thanks!