public inbox for linux-efi@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>,
	linux-efi <linux-efi@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	the arch/x86 maintainers <x86@kernel.org>,
	"Neri, Ricardo" <ricardo.neri@intel.com>,
	Matt Fleming <matt@codeblueprint.co.uk>,
	Al Stone <astone@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Ingo Molnar <mingo@kernel.org>, Andy Lutomirski <luto@kernel.org>,
	Bhupesh Sharma <bhsharma@redhat.com>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH V3 3/5] x86/efi: Permanently save the EFI_MEMORY_MAP passed by the firmware
Date: Wed, 5 Sep 2018 14:56:45 +0200	[thread overview]
Message-ID: <20180905125645.GX24082@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <CAKv+Gu9mfWYww49OmBETutSsaTDfE6VFJjbf+LWAoXF=mNmDBA@mail.gmail.com>

On Wed, Sep 05, 2018 at 02:27:49PM +0200, Ard Biesheuvel wrote:
> On 5 September 2018 at 00:12, Sai Praneeth Prakhya
> <sai.praneeth.prakhya@intel.com> wrote:
> > From: Sai Praneeth <sai.praneeth.prakhya@intel.com>
> >
> > The efi page fault handler that recovers from page faults caused by the
> > firmware needs the original memory map passed by the firmware. It looks
> > up this memory map to find the type of the memory region at which the
> > page fault occurred. Presently, EFI subsystem discards the original
> > memory map passed by the firmware and replaces it with a new memory map
> > that has only EFI_RUNTIME_SERVICES_<CODE/DATA> regions. But illegal
> > accesses by firmware can occur at any region. Hence, _only_ if
> > CONFIG_EFI_WARN_ON_ILLEGAL_ACCESS is defined, create a backup of the
> > original memory map passed by the firmware, so that efi page fault
> > handler could detect/recover from illegal accesses to *any* efi region.
> >
> 
> Why do we care about the memory map at all when a fault occurs during
> the invocation of a EFI runtime service?
> 
> I think reasoning about what went wrong and why, and distinguishing
> between allowable and non-allowable faults is a slippery slope, so
> [taking Thomas's feedback into account], I think we can simplify this
> series further and just block all subsequent EFI runtime services
> calls if any permission or page fault occurs while executing them.
> 
> Would we still need to preserve the old memory map in that case?

I thought the reason for having this was being able to know the fault is
in an EFI area. But of course, I'm not wel versed in this whole EFI
crapola.

  reply	other threads:[~2018-09-05 12:56 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-04 22:12 [PATCH V3 0/5] Add efi page fault handler to detect and recover Sai Praneeth Prakhya
2018-09-04 22:12 ` [PATCH V3 1/5] efi: Make efi_rts_work accessible to efi page fault handler Sai Praneeth Prakhya
2018-09-04 22:12 ` [PATCH V3 2/5] efi: Introduce __efi_init attribute Sai Praneeth Prakhya
2018-09-04 22:25   ` Prakhya, Sai Praneeth
2018-09-04 22:12 ` [PATCH V3 3/5] x86/efi: Permanently save the EFI_MEMORY_MAP passed by the firmware Sai Praneeth Prakhya
2018-09-05 11:48   ` Peter Zijlstra
2018-09-05 12:27   ` Ard Biesheuvel
2018-09-05 12:56     ` Peter Zijlstra [this message]
2018-09-05 13:03       ` Ard Biesheuvel
2018-09-05 13:06         ` Thomas Gleixner
2018-09-05 17:53           ` Prakhya, Sai Praneeth
2018-09-06 12:56             ` Ard Biesheuvel
2018-09-06 17:34               ` Prakhya, Sai Praneeth
2018-09-04 22:12 ` [PATCH V3 4/5] x86/efi: Add efi page fault handler to recover from the page faults caused by firmware Sai Praneeth Prakhya
2018-09-04 22:12 ` [PATCH V3 5/5] x86/efi: Introduce EFI_WARN_ON_ILLEGAL_ACCESS Sai Praneeth Prakhya

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=20180905125645.GX24082@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=ard.biesheuvel@linaro.org \
    --cc=astone@redhat.com \
    --cc=bhsharma@redhat.com \
    --cc=bp@alien8.de \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=matt@codeblueprint.co.uk \
    --cc=mingo@kernel.org \
    --cc=ricardo.neri@intel.com \
    --cc=sai.praneeth.prakhya@intel.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox