* + mm-debug_page_alloc-fix-null-buf-in-debug_guardpage_minorder_setup.patch added to mm-new branch
@ 2026-08-06 5:48 Andrew Morton
0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2026-08-06 5:48 UTC (permalink / raw)
To: mm-commits, ziy, vbabka, surenb, mhocko, jhubbard, hannes, akpm,
liuye, akpm
The patch titled
Subject: mm: debug_page_alloc: fix NULL buf in debug_guardpage_minorder_setup
has been added to the -mm mm-new branch. Its filename is
mm-debug_page_alloc-fix-null-buf-in-debug_guardpage_minorder_setup.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-debug_page_alloc-fix-null-buf-in-debug_guardpage_minorder_setup.patch
This patch will later appear in the mm-new branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Note, mm-new is a provisional staging ground for work-in-progress
patches, and acceptance into mm-new is a notification for others take
notice and to finish up reviews. Please do not hesitate to respond to
review feedback and post updated versions to replace or incrementally
fixup patches in mm-new.
The mm-new branch of mm.git is not included in linux-next
If a few days of testing in mm-new is successful, the patch will me moved
into mm.git's mm-unstable branch, which is included in linux-next
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next via various
branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there most days
------------------------------------------------------
From: Ye Liu <liuye@kylinos.cn>
Subject: mm: debug_page_alloc: fix NULL buf in debug_guardpage_minorder_setup
Date: Thu, 6 Aug 2026 08:45:55 +0800
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.
Link: https://lore.kernel.org/20260806004556.2633049-1-ye.liu@linux.dev
Fixes: c0a32fc5a2e4 ("mm: more intensive memory corruption debugging")
Signed-off-by: Ye Liu <liuye@kylinos.cn>
Acked-by: Zi Yan <ziy@nvidia.com>
Reviewed-by: John Hubbard <jhubbard@nvidia.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Vlastimil Babka <vbabka@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/debug_page_alloc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/mm/debug_page_alloc.c~mm-debug_page_alloc-fix-null-buf-in-debug_guardpage_minorder_setup
+++ a/mm/debug_page_alloc.c
@@ -22,8 +22,8 @@ static int __init debug_guardpage_minord
{
unsigned int res;
- if (kstrtouint(buf, 10, &res) < 0 || res > MAX_PAGE_ORDER / 2) {
- pr_err("Bad debug_guardpage_minorder value: %s\n", buf);
+ if (!buf || kstrtouint(buf, 10, &res) < 0 || res > MAX_PAGE_ORDER / 2) {
+ pr_err("Bad debug_guardpage_minorder value: %s\n", buf ?: "(missing)");
return 0;
}
_debug_guardpage_minorder = res;
_
Patches currently in -mm which might be from liuye@kylinos.cn are
mm-debug_page_alloc-fix-type-mismatch-for-debug_guardpage_minorder.patch
mm-show_mem-fix-format-string-inconsistencies-and-type-mismatches.patch
mm-debug_page_alloc-fix-null-buf-in-debug_guardpage_minorder_setup.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-08-06 5:48 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-06 5:48 + mm-debug_page_alloc-fix-null-buf-in-debug_guardpage_minorder_setup.patch added to mm-new branch Andrew Morton
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.