[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
<IA2PR20MB720674D577BE4ADCA183F9DAFD182@IA2PR20MB7206.namprd20.prod.outlook.com>
Date: Tue, 14 Jan 2025 14:37:52 +0000
From: Nir Lichtman <nir_lichtman@...mail.com>
To: Peter Zijlstra <peterz@...radead.org>, Borislav Petkov <bp@...en8.de>
CC: "dave.hansen@...ux.intel.com" <dave.hansen@...ux.intel.com>,
"luto@...nel.org" <luto@...nel.org>, "tglx@...utronix.de"
<tglx@...utronix.de>, "mingo@...hat.com" <mingo@...hat.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"m.younesbadr@...il.com" <m.younesbadr@...il.com>, Nir Lichtman
<nir@...htman.org>
Subject: RE: [PATCH v2 RESEND] x86/kaslr: Ingest nokaslr to avoid passing it
to init process
> 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
Powered by blists - more mailing lists