From: sayo <rg32@ciallo.tech>
To: Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>,
Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
"H . Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org, linux-kernel@vger.kernel.org,
m.younesbadr@gmail.com, nir@lichtman.org
Subject: [PATCH v3 0/2] x86: stop handing boot-stage parameters to init
Date: Mon, 5 Oct 2026 13:13:44 -0400 [thread overview]
Message-ID: <20261005171815.49494-1-rg32@ciallo.tech> (raw)
Some kernel parameters are consumed before the main kernel is running: the
boot stub, the decompressor and the EFI stub read the command line directly
and act on options that the main kernel never registers, because they
describe things that are already decided by then - the kernel's load
address, the paging mode, the memory encryption mode. parse_args() cannot
know they were eaten, so unknown_bootoption() hands them to init: valueless
options in argv, "key=value" ones in the environment.
On x86 that is nokaslr [KNL,EARLY], no5lvl [X86-64,RISCV,EARLY],
mem_encrypt= [X86-64] and edd= [EDD] - all documented kernel parameters.
That collides with init's own argument convention: busybox init does
"if (argv[1]) xsetenv("RUNLEVEL", argv[1]);", openrc-init takes the
runlevel from argv[1], and a shell used as init treats the argument as a
script name and exits, so a plain "nokaslr" boot reaches userspace as a
bogus RUNLEVEL.
Earlier attempts at this (2024-03, 2024-10, 2025-01) added a stub handler
for "nokaslr" alone; Boris preferred the generic version over per-parameter
stubs that only silence a warning. So patch 1 adds the hook and patch 2
fills in the x86 list. Nothing changes for parameters that are genuinely
unknown - they still reach init, and the notice names only those again.
Link: https://lore.kernel.org/all/20240331200546.869343-1-m.younesbadr@gmail.com/
Link: https://lore.kernel.org/all/20250114145521.GDZ4Z62dOwYffaUrsr@fat_crate.local/
sayo (2):
init: claim parameters consumed before the main kernel
x86: claim the parameters consumed by the boot stub and decompressor
arch/x86/kernel/setup.c | 40 ++++++++++++++++++++++++++++++++++++++++
include/linux/init.h | 12 ++++++++++++
init/main.c | 16 ++++++++++++++++
3 files changed, 68 insertions(+)
next reply other threads:[~2026-10-05 17:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-05 17:13 sayo [this message]
2026-10-05 17:13 ` [PATCH v3 1/2] init: claim parameters consumed before the main kernel sayo
2026-10-05 17:13 ` [PATCH v3 2/2] x86: claim the parameters consumed by the boot stub and decompressor sayo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261005171815.49494-1-rg32@ciallo.tech \
--to=rg32@ciallo.tech \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=m.younesbadr@gmail.com \
--cc=mingo@redhat.com \
--cc=nir@lichtman.org \
--cc=tglx@kernel.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®