Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1696715

Re: [PATCH v3 2/2] x86/efi: clean up dead code around efi_reserve_boot_services()

From Baoquan He <bhe@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH v3 2/2] x86/efi: clean up dead code around efi_reserve_boot_services()
Date 2017-07-26 03:40 +0200
Message-ID <u7jsS-29R-15@gated-at.bofh.it> (permalink)
References <u1zK2-Wq-9@gated-at.bofh.it> <u1zTI-Zs-5@gated-at.bofh.it> <u6LAR-5qf-5@gated-at.bofh.it> <u7idr-1t6-5@gated-at.bofh.it> <u7j9v-22G-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 07/26/17 at 09:13am, Baoquan He wrote:
> On 07/26/17 at 12:12am, Naoya Horiguchi wrote:
> > On Mon, Jul 24, 2017 at 02:20:44PM +0100, Matt Fleming wrote:
> > > On Mon, 10 Jul, at 02:51:36PM, Naoya Horiguchi wrote:
> > > > EFI_BOOT_SERVICES_{CODE|DATA} regions never overlap the kernel now,
> > > > so we can clean up the check in efi_reserve_boot_services().
> > > > 
> > > > Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
> > > > ---
> > > >  arch/x86/platform/efi/quirks.c | 23 +----------------------
> > > >  1 file changed, 1 insertion(+), 22 deletions(-)
> > > 
> > > Is this true for kernels not using KASLR? 
> > 
> > Thank you for pointing out this. It's not true depending on memmap layout.
> > If a firmware does not define the memory around the kernel address
> > (0x1000000 or CONFIG_PHYSICAL_START) as EFI_BOOT_SERVICES_*, no overlap
> > happens.  That's true in my testing server, but I don't think that we can
> > expect it generally.
> > 
> > So I think of adding some assertion in the patch 1/2 to detect this overlap
> > in extract_kernel() even for no KASLR case.
> 
> EFI_BOOT_SERVICES_* memory are collected as e820 region of
> E820_TYPE_RAM, how can we guarantee kernel won't use them after jumping
> into the running kernel whether KASLR enabled or not? We can only wish
> that EFI firmware engineer don't put EFI_BOOT_SERVICES_* far from
					sorry, typo.  I meant EFI boot
service region need be put far from 0x1000000. Otherwise normal kernel could
allocate memory bottom up and stomp on them. It's embarassment caused by
the hardware flaw of x86 platfrom.
> 0x1000000 where normal kernel is loaded.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH v3 2/2] x86/efi: clean up dead code around  efi_reserve_boot_services() Matt Fleming <matt@codeblueprint.co.uk> - 2017-07-24 15:30 +0200
  Re: [PATCH v3 2/2] x86/efi: clean up dead code around  efi_reserve_boot_services() Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> - 2017-07-26 02:20 +0200
    Re: [PATCH v3 2/2] x86/efi: clean up dead code around  efi_reserve_boot_services() Baoquan He <bhe@redhat.com> - 2017-07-26 03:20 +0200
      Re: [PATCH v3 2/2] x86/efi: clean up dead code around  efi_reserve_boot_services() Baoquan He <bhe@redhat.com> - 2017-07-26 03:40 +0200
        [PATCH] x86/boot: check overlap between kernel and  EFI_BOOT_SERVICES_* Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> - 2017-07-28 09:00 +0200
          Re: [PATCH] x86/boot: check overlap between kernel and  EFI_BOOT_SERVICES_* kbuild test robot <lkp@intel.com> - 2017-07-29 12:10 +0200
          Re: [PATCH] x86/boot: check overlap between kernel and  EFI_BOOT_SERVICES_* kbuild test robot <lkp@intel.com> - 2017-07-29 15:10 +0200
          [RFC PATCH] x86/boot: efi_kernel_boot_services_overlap can be static kbuild test robot <lkp@intel.com> - 2017-07-29 15:10 +0200

csiph-web