lkml.org 
[lkml]   [2017]   [Jul]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v6 RESEND] x86/boot/KASLR: Restrict kernel to be randomized in mirror regions
On 07/28/17 at 06:18pm, Baoquan He wrote:
> 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).
>
> Seems for_each_efi_memory_desc_in_map() can be used to hide the
> calculation and type cast each time for better memmap loop.

Oh, plesse ignore this noise, it need involve struct efi_memory_map which
need be built till efi_init() called.

\
 
 \ /
  Last update: 2017-07-28 12:39    [W:0.089 / U:9.804 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site