Re: [PATCH v2 23/23] mm/sl[au]b: check if large object is valid in __ksize()

From: Hyeonggon Yoo
Date: Thu Apr 14 2022 - 07:47:06 EST


On Thu, Apr 14, 2022 at 11:58:01AM +0200, Christoph Lameter wrote:
> On Thu, 14 Apr 2022, Hyeonggon Yoo wrote:
>
> > If address of large object is not beginning of folio or size of
> > the folio is too small, it must be invalid. Return zero in such cases.
>
> This looks like a slab usage error on the part of the caller that would
> benefit from a kernel log entry. A warning or an error?


I think a WARN_ON() would be sufficient. here, will do in v3.
Thanks!

--
Thanks,
Hyeonggon