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

2017-07-28 Thread Baoquan He
Hi Ingo, On 07/28/17 at 08:46am, Ingo Molnar wrote: > > > + pmap = e->efi_memmap; > > +#else > > + pmap = (e->efi_memmap | ((__u64)e->efi_memmap_hi << 32)); > > +#endif > > + > > + nr_desc = e->efi_memmap_size / e->efi_memdesc_size; > > + for (i = 0; i < nr_desc; i++) { > > +

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

2017-07-28 Thread Baoquan He
Hi Ingo, On 07/28/17 at 08:46am, Ingo Molnar wrote: > > > + pmap = e->efi_memmap; > > +#else > > + pmap = (e->efi_memmap | ((__u64)e->efi_memmap_hi << 32)); > > +#endif > > + > > + nr_desc = e->efi_memmap_size / e->efi_memdesc_size; > > + for (i = 0; i < nr_desc; i++) { > > +

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

2017-07-28 Thread Ingo Molnar
* Baoquan He wrote: > Currently KASLR will parse all e820 entries of RAM type and add all > candidate position into slots array. Then we will choose one slot > randomly as the new position which kernel will be decompressed into > and run at. > > On system with EFI enabled,

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

2017-07-28 Thread Ingo Molnar
* Baoquan He wrote: > Currently KASLR will parse all e820 entries of RAM type and add all > candidate position into slots array. Then we will choose one slot > randomly as the new position which kernel will be decompressed into > and run at. > > On system with EFI enabled, e820 memory regions

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

2017-07-25 Thread Baoquan He
Currently KASLR will parse all e820 entries of RAM type and add all candidate position into slots array. Then we will choose one slot randomly as the new position which kernel will be decompressed into and run at. On system with EFI enabled, e820 memory regions are coming from EFI memory regions

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

2017-07-25 Thread Baoquan He
Currently KASLR will parse all e820 entries of RAM type and add all candidate position into slots array. Then we will choose one slot randomly as the new position which kernel will be decompressed into and run at. On system with EFI enabled, e820 memory regions are coming from EFI memory regions