All of lore.kernel.org
 help / color / mirror / Atom feed
From: Josh Triplett <josh-iaAMLnmF4UmaiuxdJuQwMA@public.gmane.org>
To: Dave Young <dyoung-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: "Matt Fleming"
	<matt-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org>,
	"Môshe van der Sterre" <me-A/3C56C7qwM@public.gmane.org>,
	"Andy Lutomirski" <luto-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	"linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: BGRT warns again on my system
Date: Mon, 20 Jun 2016 08:50:17 -0700	[thread overview]
Message-ID: <20160620155017.GA31649@x> (raw)
In-Reply-To: <20160620053819.GB13633-0VdLhd/A9Pl+NNSt+8eSiB/sF2h8X+2i0E9HWUfgJXw@public.gmane.org>

On Mon, Jun 20, 2016 at 01:38:19PM +0800, Dave Young wrote:
> On 06/02/16 at 10:24am, Matt Fleming wrote:
> > On Sun, 29 May, at 06:09:01AM, Môshe van der Sterre wrote:
> > > ---
> > >  arch/x86/platform/efi/efi-bgrt.c | 7 +++++++
> > >  1 file changed, 7 insertions(+)
> > > 
> > > diff --git a/arch/x86/platform/efi/efi-bgrt.c b/arch/x86/platform/efi/efi-bgrt.c
> > > index 6a2f569..a7fdb61 100644
> > > --- a/arch/x86/platform/efi/efi-bgrt.c
> > > +++ b/arch/x86/platform/efi/efi-bgrt.c
> > > @@ -19,6 +19,8 @@
> > >  #include <linux/efi.h>
> > >  #include <linux/efi-bgrt.h>
> > >  
> > > +#include "../../mm/physaddr.h"
> > > +
> > >  struct acpi_table_bgrt *bgrt_tab;
> > >  void *__initdata bgrt_image;
> > >  size_t __initdata bgrt_image_size;
> > > @@ -67,6 +69,11 @@ void __init efi_bgrt_init(void)
> > >  		return;
> > >  	}
> > >  
> > > +	if (!phys_addr_valid(bgrt_tab->image_address)) {
> > > +		pr_notice("Ignoring BGRT: image address is bogus\n");
> > > +		return;
> > > +	}
> > > +
> > >  	image = memremap(bgrt_tab->image_address, sizeof(bmp_header), MEMREMAP_WB);
> > >  	if (!image) {
> > >  		pr_notice("Ignoring BGRT: failed to map image header memory\n");
> > > -- 
> > > 2.4.3
> > > 
> > 
> > If this does indeed fix Andy's immediate issue (and it looks like
> > it would) I'm happy to apply this as an interim solution.
> > 
> > Once we have a persistent EFI memmap available at runtime on x86 we
> > should attempt to see whether the physical address in ->image_address
> > is covered by some region in that table. The persistent EFI memmap
> > patches should be posted in the coming weeks.
> 
> I may missed the background but I worry about who knows if it is meant
> to be used for BGRT image. Some vendors could respect the BGRT valid
> bit and just leave the address as a random address. And the random
> address could be a valid physical address though. It is possible to
> leak memory infomation. 

Not unless the random address they point to happens to work as a valid
BMP image.  And even then, we figure all this out and copy the BGRT out
of that memory before we actually create the non-early memory map.

> Could we reconsider about below commit? It may be a Windows 10 bug?
> 
> commit 66dbe99cfe30e113d2e571e68b9b6a1a8985a157
> Author: Môshe van der Sterre <me-A/3C56C7qwM@public.gmane.org>
> Date:   Mon Feb 1 22:07:03 2016 +0000
> 
>     x86/efi/bgrt: Don't ignore the BGRT if the 'valid' bit is 0

I'd certainly welcome further investigation there. But if it is a bug,
it's one that BIOSes take advantage of.

  parent reply	other threads:[~2016-06-20 15:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-28 20:46 BGRT warns again on my system Andy Lutomirski
     [not found] ` <CALCETrUJ2QoUSYY82Q1BN3niasiunktnrmdE9Lmi2PZnCJRdag-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-05-28 22:25   ` Josh Triplett
2016-05-29  4:09     ` Môshe van der Sterre
     [not found]       ` <574A6B5D.60200-A/3C56C7qwM@public.gmane.org>
2016-06-02  9:24         ` Matt Fleming
     [not found]           ` <20160602092438.GD2658-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org>
2016-06-19 13:14             ` Môshe van der Sterre
     [not found]               ` <57669AC0.7010905-A/3C56C7qwM@public.gmane.org>
2016-06-19 14:38                 ` Josh Triplett
2016-06-19 14:57                   ` Môshe van der Sterre
2016-06-20  5:38             ` Dave Young
     [not found]               ` <20160620053819.GB13633-0VdLhd/A9Pl+NNSt+8eSiB/sF2h8X+2i0E9HWUfgJXw@public.gmane.org>
2016-06-20 15:50                 ` Josh Triplett [this message]
2016-06-23 12:01                 ` Matt Fleming

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=20160620155017.GA31649@x \
    --to=josh-iaamlnmf4umaiuxdjuqwma@public.gmane.org \
    --cc=dyoung-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=luto-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=matt-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org \
    --cc=me-A/3C56C7qwM@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.