lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPcyv4hO1XEMHPLY-W6g_=TK2Dv=rLgJoVeKrBEHP63zTeq-sA@mail.gmail.com>
Date:   Wed, 27 May 2020 16:13:07 -0700
From:   Dan Williams <dan.j.williams@...el.com>
To:     Arvind Sankar <nivedita@...m.mit.edu>
Cc:     "linux-efi@...r.kernel.org" <linux-efi@...r.kernel.org>,
        "mingo@...nel.org" <mingo@...nel.org>,
        "tglx@...utronix.de" <tglx@...utronix.de>,
        "ardb@...nel.org" <ardb@...nel.org>,
        "linux@...ck-us.net" <linux@...ck-us.net>,
        "joe@...ches.com" <joe@...ches.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "arnd@...db.de" <arnd@...db.de>
Subject: Re: [PATCH 08/15] efi/x86: Move command-line initrd loading to efi_main

On Wed, May 27, 2020 at 4:02 PM Arvind Sankar <nivedita@...m.mit.edu> wrote:
>
> On Wed, May 27, 2020 at 03:56:45PM -0700, Dan Williams wrote:
> > On Wed, May 27, 2020 at 3:47 PM Arvind Sankar <nivedita@...m.mit.edu> wrote:
> > >
> > > On Wed, May 27, 2020 at 10:30:18PM +0000, Williams, Dan J wrote:
> > > > On Fri, 2020-05-08 at 20:01 +0200, Ard Biesheuvel wrote:
> > > > > From: Arvind Sankar <nivedita@...m.mit.edu>
> > > > >
> > > > > Consolidate the initrd loading in efi_main.
> > > > >
> > > > > The command line options now need to be parsed only once.
> > > > >
> > > > > Signed-off-by: Arvind Sankar <nivedita@...m.mit.edu>
> > > > > Link:
> > > > > https://lore.kernel.org/r/20200430182843.2510180-9-nivedita@alum.mit.edu
> > > > > Signed-off-by: Ard Biesheuvel <ardb@...nel.org>
> > > >
> > > > Hi,
> > > >
> > > > This patch patch in tip/master as:
> > > >
> > > > 987053a30016 efi/x86: Move command-line initrd loading to efi_main
> > > >
> > > > ...regresses my nfs root configuration. It hangs trying to mount the
> > > > nfs root filesystem "root=/dev/nfs ip=dhcp".
> > > >
> > > > It does not revert cleanly.
> > > >
> > > >
> > >
> > > Does this fix it?
> > >
> > > diff --git a/drivers/firmware/efi/libstub/x86-stub.c b/drivers/firmware/efi/libstub/x86-stub.c
> > > index defeb6035109..f53362efef84 100644
> > > --- a/drivers/firmware/efi/libstub/x86-stub.c
> > > +++ b/drivers/firmware/efi/libstub/x86-stub.c
> > > @@ -771,10 +771,12 @@ unsigned long efi_main(efi_handle_t handle,
> > >                         efi_err("Failed to load initrd!\n");
> > >                         goto fail;
> > >                 }
> > > -               efi_set_u64_split(addr, &hdr->ramdisk_image,
> > > -                                 &boot_params->ext_ramdisk_image);
> > > -               efi_set_u64_split(size, &hdr->ramdisk_size,
> > > -                                 &boot_params->ext_ramdisk_size);
> > > +               if (size > 0) {
> > > +                       efi_set_u64_split(addr, &hdr->ramdisk_image,
> > > +                                         &boot_params->ext_ramdisk_image);
> > > +                       efi_set_u64_split(size, &hdr->ramdisk_size,
> > > +                                         &boot_params->ext_ramdisk_size);
> > > +               }
> >
> > I'll give it a shot, but my guess would have been something related to
> > the fact that this patch moves the initrd loading relative to when the
> > command line is being parsed. In this case it's a dracut initrd built
> > by:
> >
> >     dracut -m "nfs network base"
> >
> > ...with a kernel built with:
> >
> > CONFIG_IP_PNP_DHCP=y
> >
> > ...and a built-in network interface. The behavior seems to be that the
> > kernel gets an IP address just fine, but there's no initrd userspace
> > to mount nfs and the kernel eventually gives up looking for root.
>
> It's an oversight in this patch: I set addr/size to 0 in the case where
> the EFI stub is not supposed to handle the initrd loading (because a
> bootloader ran before it and was responsible for handling the loading),
> but then those 0's get written into the bootparams structure anyway,
> blowing away whatever the bootloader had loaded.

Ah, ok.

...and yes, it works. You can add:

Tested-by: Dan Williams <dan.j.williams@...el.com>

Thanks for the lightning quick turnaround!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ