Re: [PATCH] mm: debug_page_alloc: fix NULL buf in debug_guardpage_minorder_setup

From: Zi Yan

Date: Wed Aug 05 2026 - 21:00:44 EST


On Wed Aug 5, 2026 at 8:45 PM EDT, Ye Liu wrote:
> From: Ye Liu <liuye@xxxxxxxxxx>
>
> If the kernel command line includes "debug_guardpage_minorder" without
> an equals sign (i.e., no value is provided), the early parameter
> parser passes a NULL buf pointer to the setup function.
>
> kstrtouint() does not perform a NULL check on its input and calls
> directly into kstrtoull() which dereferences s[0] unconditionally,
> leading to a NULL pointer dereference and early boot crash.
>
> Additionally, the error path's pr_err("%s", buf) would also crash with
> a NULL format argument.
>
> Signed-off-by: Ye Liu <liuye@xxxxxxxxxx>
> ---
> mm/debug_page_alloc.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
LGTM.

Acked-by: Zi Yan <ziy@xxxxxxxxxx>


--
Best Regards,
Yan, Zi