All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matt Fleming <matt-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org>
To: Jeffrey Hugo <jhugo-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
Cc: Ard Biesheuvel
	<ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
	"linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Timur Tabi <timur-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
	Leif Lindholm
	<leif.lindholm-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Subject: Re: [RFC PATCH] efi/libstub: Retry ExitBootServices if map key is invalid
Date: Mon, 4 Jul 2016 14:44:23 +0100	[thread overview]
Message-ID: <20160704134423.GO8415@codeblueprint.co.uk> (raw)
In-Reply-To: <1b487d6d-624c-6acb-d9c1-318cd63070d5-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>

On Thu, 30 Jun, at 03:05:12PM, Jeffrey Hugo wrote:
> On 6/30/2016 12:31 PM, Ard Biesheuvel wrote:
> >
> >No, I think x86's implementation is incorrect. efi_get_memory_map()
> >should allocate some slack (i.e., the 8 entries you mentioned), and if
> >the first call to ExitBootServices() fails, we should reuse the memory
> >map buffer, and call GetMemoryMap() directly to repopulate it. Then,
> >we call ExitBootServices() once more, or give up if either call fails.
> >
> >This way, we are 100% compliant with the wording of the spec, and err
> >on the side of caution.
> >
> 
> Ok.  Let me take some time to think upon this approach and develop a working
> prototype.
 
If possible I'd much prefer to see this fixed only once in the
shared part of efi/libstub, so that the code in arch/x86 can be
deleted in favour of your more robust patch.

FYI, commit d3768d885c6c ("x86, efi: retry ExitBootServices() on
failure") illustrates that we have hit this bug in the wild on x86.

  parent reply	other threads:[~2016-07-04 13:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-30 15:35 [RFC PATCH] efi/libstub: Retry ExitBootServices if map key is invalid Jeff Hugo
     [not found] ` <1467300933-3991-1-git-send-email-jhugo-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2016-06-30 16:27   ` Mark Rutland
2016-06-30 16:47     ` Ard Biesheuvel
     [not found]       ` <CAKv+Gu_PLqOVZQC4i3v75M0a-Z9tuE86DSU4v=Vg_pBj-5Y1WQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-06-30 17:56         ` Jeffrey Hugo
     [not found]           ` <36dc8c28-e659-7d93-d705-ccc7734fd3d2-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2016-06-30 18:31             ` Ard Biesheuvel
     [not found]               ` <CAKv+Gu8N3ORp_tg80wxJAgyYbNNPtfw2h-Hxy3DMkDcM6MQbAg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-06-30 21:05                 ` Jeffrey Hugo
     [not found]                   ` <1b487d6d-624c-6acb-d9c1-318cd63070d5-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2016-07-04 13:44                     ` Matt Fleming [this message]
2016-07-01 10:00         ` Mark Rutland

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=20160704134423.GO8415@codeblueprint.co.uk \
    --to=matt-mf/unelci9gs6ibeejttw/xrex20p6io@public.gmane.org \
    --cc=ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=jhugo-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
    --cc=leif.lindholm-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
    --cc=timur-sgV2jX0FEOL9JmXXK+q4OQ@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.