Linux-EFI Archive on lore.kernel.org
 help / color / Atom feed
From: Ard Biesheuvel <ardb@kernel.org>
To: Hans de Goede <hdegoede@redhat.com>
Cc: linux-efi <linux-efi@vger.kernel.org>,
	Arvind Sankar <nivedita@alum.mit.edu>,
	Andy Lutomirski <luto@amacapital.net>
Subject: Re: [PATCH 1/3] efi/x86: align GUIDs to their size in the mixed mode runtime wrapper
Date: Fri, 14 Feb 2020 13:35:41 +0000
Message-ID: <CAKv+Gu8Fw=jbaoC4+6Cc2ySHAa5z_ku7-BhHTQjHW58XSP46ww@mail.gmail.com> (raw)
In-Reply-To: <116eb62a-8067-b4f1-171a-2659bcaa94bf@redhat.com>

On Fri, 14 Feb 2020 at 13:55, Hans de Goede <hdegoede@redhat.com> wrote:
>
> Hi,
>
> On 2/13/20 11:21 AM, Ard Biesheuvel wrote:
> > The mixed mode runtime wrappers are fragile when it comes to how the
> > memory referred to by its pointer arguments are laid out in memory,
> > due to the fact that it translates these addresses to physical addresses
> > that the runtime services can dereference when running in 1:1 mode.
> >
> > As a quick (i.e., backportable) fix, copy GUID pointer arguments to
> > the local stack into a buffer that is naturally aligned to its size,
> > so that is guaranteed to cover only one physical page.
> >
> > Note that on x86, we cannot rely on the stack pointer being aligned
> > the way the compiler expects, so we need to allocate an 8-byte aligned
> > buffer of sufficient size, and copy the GUID into that buffer at an
> > offset that is aligned to 16 bytes.
> >
> > Reported-by: Hans de Goede <hdegoede@redhat.com>
> > Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
>
> I can confirm that this fixes the WARN_ON triggering I was seeing,
> thanks:
>
> Tested-by: Hans de Goede <hdegoede@redhat.com>
>

Thanks Hans

I'll let these soak a bit in efi/urgent before I send them to tip.

  reply index

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-13 10:20 [PATCH 0/3] efi/x86: Some mixed mode fixes Ard Biesheuvel
2020-02-13 10:21 ` [PATCH 1/3] efi/x86: align GUIDs to their size in the mixed mode runtime wrapper Ard Biesheuvel
2020-02-14 12:55   ` Hans de Goede
2020-02-14 13:35     ` Ard Biesheuvel [this message]
2020-02-13 10:21 ` [PATCH 2/3] efi/x86: remove support for EFI time and counter services in mixed mode Ard Biesheuvel
2020-02-13 10:21 ` [PATCH 3/3] efi/x86: Handle by-ref arguments covering multiple pages " Ard Biesheuvel

Reply instructions:

You may reply publically 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='CAKv+Gu8Fw=jbaoC4+6Cc2ySHAa5z_ku7-BhHTQjHW58XSP46ww@mail.gmail.com' \
    --to=ardb@kernel.org \
    --cc=hdegoede@redhat.com \
    --cc=linux-efi@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=nivedita@alum.mit.edu \
    /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

Linux-EFI Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-efi/0 linux-efi/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-efi linux-efi/ https://lore.kernel.org/linux-efi \
		linux-efi@vger.kernel.org
	public-inbox-index linux-efi

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-efi


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git