* + init-fix-early-boot-crash-with-bare-hostname-parameter.patch added to mm-nonmm-unstable branch
@ 2026-08-27 2:02 Andrew Morton
0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2026-08-27 2:02 UTC (permalink / raw)
To: mm-commits, stable, dmoulding, blum, akpm
The patch titled
Subject: init: Fix early boot crash with bare hostname parameter
has been added to the -mm mm-nonmm-unstable branch. Its filename is
init-fix-early-boot-crash-with-bare-hostname-parameter.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/init-fix-early-boot-crash-with-bare-hostname-parameter.patch
This patch will later appear in the mm-nonmm-unstable branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
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: Thorsten Blum <blum@kernel.org>
Subject: init: Fix early boot crash with bare hostname parameter
Date: Wed, 26 Aug 2026 12:09:03 +0200
When a bare hostname parameter is specified on the kernel command line
without the '=' separator, early parameter parsing passes NULL to
early_hostname(), which dereferences it in strscpy() and can crash the
system during early boot.
Reject NULL values in early_hostname() and return -EINVAL instead.
Link: https://lore.kernel.org/20260826100904.296151-2-blum@kernel.org
Fixes: 5a704629f2c1 ("init: add "hostname" kernel parameter")
Signed-off-by: Thorsten Blum <blum@kernel.org>
Cc: Dan Moulding <dmoulding@me.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
init/version.c | 3 +++
1 file changed, 3 insertions(+)
--- a/init/version.c~init-fix-early-boot-crash-with-bare-hostname-parameter
+++ a/init/version.c
@@ -23,6 +23,9 @@ static int __init early_hostname(char *a
size_t maxlen = bufsize - 1;
ssize_t arglen;
+ if (!arg)
+ return -EINVAL;
+
arglen = strscpy(init_uts_ns.name.nodename, arg, bufsize);
if (arglen < 0) {
pr_warn("hostname parameter exceeds %zd characters and will be truncated",
_
Patches currently in -mm which might be from blum@kernel.org are
maintainers-mailmap-update-entries-for-thorsten-blum.patch
init-fix-early-boot-crash-with-bare-hostname-parameter.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-08-27 2:02 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-27 2:02 + init-fix-early-boot-crash-with-bare-hostname-parameter.patch added to mm-nonmm-unstable branch Andrew Morton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox