From: Nir Lichtman <nir_lichtman@hotmail.com>
To: Peter Zijlstra <peterz@infradead.org>, Borislav Petkov <bp@alien8.de>
Cc: "dave.hansen@linux.intel.com" <dave.hansen@linux.intel.com>,
"luto@kernel.org" <luto@kernel.org>,
"tglx@linutronix.de" <tglx@linutronix.de>,
"mingo@redhat.com" <mingo@redhat.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"m.younesbadr@gmail.com" <m.younesbadr@gmail.com>,
Nir Lichtman <nir@lichtman.org>
Subject: RE: [PATCH v2 RESEND] x86/kaslr: Ingest nokaslr to avoid passing it to init process
Date: Tue, 14 Jan 2025 14:37:52 +0000 [thread overview]
Message-ID: <IA2PR20MB720674D577BE4ADCA183F9DAFD182@IA2PR20MB7206.namprd20.prod.outlook.com> (raw)
In-Reply-To: <20250114140954.GR5388@noisy.programming.kicks-ass.net>
> On Tue, Jan 14, 2025 at 01:31:42PM +0100, Borislav Petkov wrote:
> > On Tue, Jan 14, 2025 at 10:36:43AM +0100, Peter Zijlstra wrote:
> > > On Sat, Jan 11, 2025 at 02:17:43PM +0000, Nir Lichtman wrote:
> > > > Problem: Currently booting the kernel with "nokaslr" on x86
> > > > incorrectly doesn't recognize this parameter and passes it on to
> > > > the init process
> > >
> > > What now? I'm pretty sure nokaslr works, it's in all my test
> > > machines and qemu scripts. Without it faddr2line wouldn't work,
> > > which I would notice in a hurry.
> >
> > Yeah, the param itself works - he doesn't want to pass it on to the
> > init process because then it says:
> >
> > [ 0.073613] Unknown kernel command line parameters "nokaslr", will be
> passed to user space.
> >
> > due to our detection of which parameters got eaten and which didn't.
>
> I had never noticed; random machine of mine says:
>
> [ 0.591565] Unknown kernel command line parameters "force_early_printk
> nokaslr kgdboc=ttyS0", will be passed to user space.
>
> *shrug*, who cares.
I agree that the warning is not a big deal, thing is the kernel has a fallback behavior
in which unrecognized boot parameters are passed to the init process, this causes
the nokaslr to be passed to the init process, you probably haven't stumbled upon
this since it may be swallowed in your system, but when I made an initramfs with bash
as the init process, bash got the nokaslr as an argument and crashed since it treated it
as a file.
Borslav, print_unknown_bootoptions is an interesting alternative idea,
I could amend this patch to swallow the early parameters over there,
Thing is this, from what I understand it would require the code to keep
a list of possible early parameters and check if one of them arrived into the
print_unknown_bootoptions function and if so swallow in that function,
what do you think about this idea, to implement this?
Thanks,
Nir
next prev parent reply other threads:[~2025-01-14 14:37 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-11 14:17 Nir Lichtman
2025-01-14 9:36 ` Peter Zijlstra
2025-01-14 12:31 ` Borislav Petkov
2025-01-14 14:09 ` Peter Zijlstra
2025-01-14 14:37 ` Nir Lichtman [this message]
2025-01-14 14:55 ` Borislav Petkov
2025-01-14 15:02 ` Nir Lichtman
2025-01-14 20:30 ` Borislav Petkov
2025-01-14 22:29 ` Nir Lichtman
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=IA2PR20MB720674D577BE4ADCA183F9DAFD182@IA2PR20MB7206.namprd20.prod.outlook.com \
--to=nir_lichtman@hotmail.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=m.younesbadr@gmail.com \
--cc=mingo@redhat.com \
--cc=nir@lichtman.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
/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®