Re: [PATCH 01/10] mm/kasan: implement kasan_poison_range
From: Andy Shevchenko
Date: Thu Dec 04 2025 - 10:31:39 EST
On Thu, Dec 4, 2025 at 5:17 PM Andrey Konovalov <andreyknvl@xxxxxxxxx> wrote:
> On Thu, Dec 4, 2025 at 3:13 PM Ethan Graham <ethan.w.s.graham@xxxxxxxxx> wrote:
> > Introduce a new helper function, kasan_poison_range(), to encapsulate
> > the logic for poisoning an arbitrary memory range of a given size, and
> > expose it publically in <include/linux/kasan.h>.
publicly
> > This is a preparatory change for the upcoming KFuzzTest patches, which
> > requires the ability to poison the inter-region padding in its input
> > buffers.
> >
> > No functional change to any other subsystem is intended by this commit.
...
> > +/**
> > + * kasan_poison_range - poison the memory range [@addr, @addr + @size)
> > + *
> > + * The exact behavior is subject to alignment with KASAN_GRANULE_SIZE, defined
> > + * in <mm/kasan/kasan.h>: if @start is unaligned, the initial partial granule
> > + * at the beginning of the range is only poisoned if CONFIG_KASAN_GENERIC=y.
>
> You can also mention that @addr + @size must be aligned.
>
> > + */
> > +int kasan_poison_range(const void *addr, size_t size);
And also run a kernel-doc with all warnings enabled and fix the
descriptions respectively.
--
With Best Regards,
Andy Shevchenko