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: <20160815160949.b6sccopomrn54c76@x>
Date:	Mon, 15 Aug 2016 09:09:49 -0700
From:	Josh Triplett <josh@...htriplett.org>
To:	Matt Fleming <matt@...eblueprint.co.uk>
Cc:	Icenowy Zheng <icenowy@...c.xyz>,
	Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...hat.com>,
	"H . Peter Anvin" <hpa@...or.com>, x86@...nel.org,
	linux-efi@...r.kernel.org, linux-kernel@...r.kernel.org,
	Dave Young <dyoung@...hat.com>,
	Josh Boyer <jwboyer@...hat.com>,
	Andy Lutomirski <luto@...capital.net>
Subject: Re: [PATCH] x86/efi-bgrt: remove the check of the version field

On Mon, Aug 15, 2016 at 01:56:43PM +0100, Matt Fleming wrote:
> On Tue, 09 Aug, at 01:25:46PM, Icenowy Zheng wrote:
> > Some broken firmwares have a wrongly filled version field in BGRT table.
> > (See http://wiki.osdev.org/Broken_UEFI_implementations )
> > 
> > As we know, these firmwares can also provide correct BGRT image, although
> > the table is wrong.
> > 
> > After removing the check of the version field, the kernel can now extract
> > the image correctly, and the information is also correct.
> > 
> > Tested on a Thinkpad E531 (68854UC).
> > 
> > Signed-off-by: Icenowy Zheng <icenowy@...c.xyz>
> > ---
> >  arch/x86/platform/efi/efi-bgrt.c | 5 -----
> >  1 file changed, 5 deletions(-)
> > 
> > diff --git a/arch/x86/platform/efi/efi-bgrt.c b/arch/x86/platform/efi/efi-bgrt.c
> > index 6a2f569..f492ea0 100644
> > --- a/arch/x86/platform/efi/efi-bgrt.c
> > +++ b/arch/x86/platform/efi/efi-bgrt.c
> > @@ -47,11 +47,6 @@ void __init efi_bgrt_init(void)
> >  		       bgrt_tab->header.length, sizeof(*bgrt_tab));
> >  		return;
> >  	}
> > -	if (bgrt_tab->version != 1) {
> > -		pr_notice("Ignoring BGRT: invalid version %u (expected 1)\n",
> > -		       bgrt_tab->version);
> > -		return;
> > -	}
> >  	if (bgrt_tab->status & 0xfe) {
> >  		pr_notice("Ignoring BGRT: reserved status bits are non-zero %u\n",
> >  		       bgrt_tab->status);
> 
> This would be less scary if we checked for known broken and known good
> version values instead of removing the check altogether, i.e. 0 and 1.
> 
> The whole point of the version field is that it tells us about the
> layout of the BGRT table, so it's not exactly a useless check.

Agreed.  It seems likely that BIOSes would have incorrectly left the
version at 0.  It seems less likely that they'd set it to some other
random value.

So, I'd suggest changing the check to pr_debug and continue for 0,
continue for 1, and pr_notice and abort for anything else.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ