lkml.org 
[lkml]   [2022]   [Oct]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] mm: Make ksize() a reporting-only function
On Tue, Oct 25, 2022 at 01:53:54PM +0200, Vlastimil Babka wrote:
> On 10/22/22 20:08, Kees Cook wrote:
> > With all "silently resizing" callers of ksize() refactored, remove the
> > logic in ksize() that would allow it to be used to effectively change
> > the size of an allocation (bypassing __alloc_size hints, etc). Users
> > wanting this feature need to either use kmalloc_size_roundup() before an
> > allocation, or use krealloc() directly.
> >
> > For kfree_sensitive(), move the unpoisoning logic inline. Replace the
> > some of the partially open-coded ksize() in __do_krealloc with ksize()
> > now that it doesn't perform unpoisoning.
> >
> > [...]
> > Signed-off-by: Kees Cook <keescook@chromium.org>
>
> Acked-by: Vlastimil Babka <vbabka@suse.cz>

Thanks!

> > ---
> > This requires at least this be landed first:
> > https://lore.kernel.org/lkml/20221021234713.you.031-kees@kernel.org/
>
> Don't we need all parts to have landed first, even if the skbuff one is the
> most prominent?

Yes, though, I suspect there will be some cases we couldn't easily find.

Here are the prerequisites I'm aware of:

in -next:
36875a063b5e ("net: ipa: Proactively round up to kmalloc bucket size")
ab3f7828c979 ("openvswitch: Use kmalloc_size_roundup() to match ksize() usage")
d6dd508080a3 ("bnx2: Use kmalloc_size_roundup() to match ksize() usage")

reviewed, waiting to land (should I take these myself?)
btrfs: send: Proactively round up to kmalloc bucket size
https://lore.kernel.org/lkml/20220923202822.2667581-8-keescook@chromium.org/
dma-buf: Proactively round up to kmalloc bucket size
https://lore.kernel.org/lkml/20221018090858.never.941-kees@kernel.org/

partially reviewed:
igb: Proactively round up to kmalloc bucket size
https://lore.kernel.org/lkml/20221018092340.never.556-kees@kernel.org/

unreviewed:
coredump: Proactively round up to kmalloc bucket size
https://lore.kernel.org/lkml/20221018090701.never.996-kees@kernel.org/
devres: Use kmalloc_size_roundup() to match ksize() usage
https://lore.kernel.org/lkml/20221018090406.never.856-kees@kernel.org/

needs updating:
mempool: Use kmalloc_size_roundup() to match ksize() usage
https://lore.kernel.org/lkml/20221018090323.never.897-kees@kernel.org/
bpf: Use kmalloc_size_roundup() to match ksize() usage
https://lore.kernel.org/lkml/20221018090550.never.834-kees@kernel.org/

--
Kees Cook

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