Re: [PATCH] slab: Saturate to SIZE_MAX for allocation size overflows
From: Harry Yoo
Date: Tue Feb 24 2026 - 21:37:06 EST
On Tue, Feb 24, 2026 at 05:40:02PM -0800, Kees Cook wrote:
> Instead of silently returning NULL on size overflows from array
> allocations, saturate the request to SIZE_MAX so the error will be
> surfaced to the allocator (and still return NULL).
>
> Suggested-by: Vlastimil Babka <vbabka@xxxxxxx>
> Link: https://lore.kernel.org/lkml/a144cd1e-8bfc-4380-8f1b-071db0af0b2c@xxxxxxx/
> Signed-off-by: Kees Cook <kees@xxxxxxxxxx>
> ---
Yes, since it's larger than order-1, it'll be passed to
the page allocator and will hit the order > MAX_PAGE_ORDER warning in
__alloc_frozen_pages_noprof().
Looks good to me,
Reviewed-by: Harry Yoo <harry.yoo@xxxxxxxxxx>
--
Cheers,
Harry / Hyeonggon