2022-04-14 13:21:21

by Christoph Lameter

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

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?


2022-04-15 10:20:53

by Hyeonggon Yoo

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

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