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


Groups > linux.kernel > #1698706

Re: [PATCH v6 RESEND] x86/boot/KASLR: Restrict kernel to be randomized in mirror regions

From Baoquan He <bhe@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH v6 RESEND] x86/boot/KASLR: Restrict kernel to be randomized in mirror regions
Date 2017-07-28 13:30 +0200
Message-ID <u8bCV-335-9@gated-at.bofh.it> (permalink)
References <u5fMK-5hG-23@gated-at.bofh.it> <u5DvI-3Ew-3@gated-at.bofh.it> <u5Gaf-5lR-35@gated-at.bofh.it> <u6LKy-5uV-23@gated-at.bofh.it> <u8adS-247-39@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi Matt,

On 07/28/17 at 11:55am, Ingo Molnar wrote:
> 
> * Matt Fleming <matt@codeblueprint.co.uk> wrote:
> 
> > On Fri, 21 Jul, at 09:19:56PM, Baoquan He wrote:
> > >
> > > There are places where the efi map is getting and used like this. E.g
> > > in efi_high_alloc() of drivers/firmware/efi/libstub/efi-stub-helper.c.
> > > EFI developers worry the size of efi_memory_desc_t could not be the same
> > > as e->efi_memdesc_size?
> > > 
> > > Hi Matt,
> > > 
> > > Could you help have a look at this?
> > 
> > You're exactly right. The code guards against the size of the
> > efi_memory_desc_t struct changing. The UEFI spec says to traverse the
> > memory map this way.
> 
> This is not obvious and looks pretty ugly as well, and open coded in several 
> places.
> 
> At minimum we should have an efi_memdesc_ptr(efi, i) wrapper inline (or so) that 
> gives us the entry pointer, plus a comment that points out that ->memdesc_size 
> might not be equal to sizeof(efi_memory_memdesc_t).

I can make a efi_memdesc_ptr(efi, i) wrapper as Ingo suggested and use
it here if you agree. Seems it might be not good to add another
for_each_efi_memory_desc_xxxx wrapper since there are different memmap
data structures in x86 boot and in general efi libstub. Or any other
idea?

Thanks
Baoquan

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


Thread

[PATCH v6 RESEND] x86/boot/KASLR: Restrict kernel to be randomized in mirror regions Baoquan He <bhe@redhat.com> - 2017-07-20 11:20 +0200
  Re: [PATCH v6 RESEND] x86/boot/KASLR: Restrict kernel to be  randomized in mirror regions Ingo Molnar <mingo@kernel.org> - 2017-07-21 12:40 +0200
    Re: [PATCH v6 RESEND] x86/boot/KASLR: Restrict kernel to be  randomized in mirror regions Baoquan He <bhe@redhat.com> - 2017-07-21 15:30 +0200
      Re: [PATCH v6 RESEND] x86/boot/KASLR: Restrict kernel to be  randomized in mirror regions Ingo Molnar <mingo@kernel.org> - 2017-07-21 19:40 +0200
        Re: [PATCH v6 RESEND] x86/boot/KASLR: Restrict kernel to be  randomized in mirror regions Baoquan He <bhe@redhat.com> - 2017-07-22 01:50 +0200
      Re: [PATCH v6 RESEND] x86/boot/KASLR: Restrict kernel to be  randomized in mirror regions Matt Fleming <matt@codeblueprint.co.uk> - 2017-07-24 15:40 +0200
        Re: [PATCH v6 RESEND] x86/boot/KASLR: Restrict kernel to be  randomized in mirror regions Baoquan He <bhe@redhat.com> - 2017-07-25 02:30 +0200
        Re: [PATCH v6 RESEND] x86/boot/KASLR: Restrict kernel to be  randomized in mirror regions Baoquan He <bhe@redhat.com> - 2017-07-28 10:10 +0200
        Re: [PATCH v6 RESEND] x86/boot/KASLR: Restrict kernel to be  randomized in mirror regions Ingo Molnar <mingo@kernel.org> - 2017-07-28 12:00 +0200
          Re: [PATCH v6 RESEND] x86/boot/KASLR: Restrict kernel to be  randomized in mirror regions Baoquan He <bhe@redhat.com> - 2017-07-28 12:20 +0200
            Re: [PATCH v6 RESEND] x86/boot/KASLR: Restrict kernel to be  randomized in mirror regions Baoquan He <bhe@redhat.com> - 2017-07-28 12:40 +0200
          Re: [PATCH v6 RESEND] x86/boot/KASLR: Restrict kernel to be  randomized in mirror regions Baoquan He <bhe@redhat.com> - 2017-07-28 13:30 +0200
  Re: [PATCH v6 RESEND] x86/boot/KASLR: Restrict kernel to be  randomized in mirror regions Ingo Molnar <mingo@kernel.org> - 2017-07-21 12:40 +0200
    Re: [PATCH v6 RESEND] x86/boot/KASLR: Restrict kernel to be  randomized in mirror regions Baoquan He <bhe@redhat.com> - 2017-07-21 14:40 +0200

csiph-web