lkml.org 
[lkml]   [2022]   [Oct]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] mempool: Use kmalloc_size_roundup() to match ksize() usage
On Tue, Oct 18, 2022 at 03:51:37PM -0700, Andrew Morton wrote:
> On Tue, 18 Oct 2022 02:03:29 -0700 Kees Cook <keescook@chromium.org> wrote:
>
> > Round up allocations with kmalloc_size_roundup() so that mempool's use
> > of ksize() is always accurate and no special handling of the memory is
> > needed by KASAN, UBSAN_BOUNDS, nor FORTIFY_SOURCE.
>
> Confused. If the special handling is not needed, why doesn't the patch
> removed the no longer needed special handling?

The special handling is in the ksize() implementation, so it can't be
removed[1] until all the ksize()-affected users are updated to see their
true allocation sizes first.

[1] https://lore.kernel.org/lkml/20220923202822.2667581-16-keescook@chromium.org/

--
Kees Cook

\
 
 \ /
  Last update: 2022-10-19 07:38    [W:0.051 / U:0.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site