Re: [PATCH v2 1/2] mm/mm_init: Introduce a boot parameter for check_pages

From: SeongJae Park
Date: Mon Nov 24 2025 - 20:11:19 EST


On Mon, 24 Nov 2025 14:54:06 -0800 Joshua Hahn <joshua.hahnjy@xxxxxxxxx> wrote:

> Use-after-free and double-free bugs can be very difficult to track down.
> The kernel is good at tracking these and preventing bad pages from being
> used/created through simple checks gated behind "check_pages_enabled".
>
> Currently, the only ways to enable this flag is by building with
> CONFIG_DEBUG_VM, or as a side effect of other checks such as
> init_on_{alloc, free}, page_poisoning, or debug_pagealloc among others.
> These solutions are powerful, but may often be too coarse in balancing
> the performance vs. safety that a user may want, particularly in
> latency-sensitive production environments.
>
> Introduce a new boot parameter "check_pages", which enables page checking
> with no other side effects. It takes kstrbool-able inputs as an argument
> (i.e. 0/1, true/false, on/off, ...). This patch is backwards-compatible;
> setting CONFIG_DEBUG_VM still enables page checking.
>
> Signed-off-by: Joshua Hahn <joshua.hahnjy@xxxxxxxxx>

Acked-by: SeongJae Park <sj@xxxxxxxxxx>


Thanks,
SJ

[...]