Re: [PATCH 0/6] randomize kernel physical address and virtual address separately

2015-02-03 Thread Baoquan He
On 02/02/15 at 08:42am, H. Peter Anvin wrote: > On 01/20/2015 07:37 PM, Baoquan He wrote: > > > >Leftover problem: > > hpa want to see the physical randomization can cover the whole physical > > memory. I > >checked code and found it's hard to do. Because in > >arch/x86/boot/compressed/head_6

Re: [PATCH 0/6] randomize kernel physical address and virtual address separately

2015-02-02 Thread H. Peter Anvin
On 01/20/2015 07:37 PM, Baoquan He wrote: Leftover problem: hpa want to see the physical randomization can cover the whole physical memory. I checked code and found it's hard to do. Because in arch/x86/boot/compressed/head_64.S an identity mapping of 4G is built and then kaslr and decompr

Re: [PATCH 0/6] randomize kernel physical address and virtual address separately

2015-02-02 Thread Baoquan He
On 02/01/15 at 05:13am, Andy Lutomirski wrote: > I applied this to Linus' tree today, and I get: > > early console in decompress_kernel > KASLR disabled by default... > > Decompressing Linux... > > XZ-compressed data is corrupt > > -- System halted > > If I comment out the output = 0x14

Re: [PATCH 0/6] randomize kernel physical address and virtual address separately

2015-02-02 Thread Baoquan He
On 02/01/15 at 05:13am, Andy Lutomirski wrote: > On Sun, Feb 1, 2015 at 12:10 AM, Baoquan He wrote: > > On 01/20/15 at 08:19pm, Andy Lutomirski wrote: > >> On 01/20/2015 07:37 PM, Baoquan He wrote: > >> > >> I have no idea what the #PF thing you're referring to is, but I have > >> code to implemen

Re: [PATCH 0/6] randomize kernel physical address and virtual address separately

2015-02-01 Thread Andy Lutomirski
On Sun, Feb 1, 2015 at 12:10 AM, Baoquan He wrote: > On 01/20/15 at 08:19pm, Andy Lutomirski wrote: >> On 01/20/2015 07:37 PM, Baoquan He wrote: >> >> I have no idea what the #PF thing you're referring to is, but I have >> code to implement a #PF handler in boot/compressed if it would be >> helpfu

Re: [PATCH 0/6] randomize kernel physical address and virtual address separately

2015-02-01 Thread Baoquan He
On 01/20/15 at 08:19pm, Andy Lutomirski wrote: > On 01/20/2015 07:37 PM, Baoquan He wrote: > > I have no idea what the #PF thing you're referring to is, but I have > code to implement a #PF handler in boot/compressed if it would be > helpful. It's two patches: > > https://git.kernel.org/cgit/lin

Re: [PATCH 0/6] randomize kernel physical address and virtual address separately

2015-01-20 Thread Kees Cook
On Tue, Jan 20, 2015 at 7:37 PM, Baoquan He wrote: > Currently kaslr only randomize physical address of kernel loading, then add > the delta > to virtual address of kernel text mapping. Because kernel virtual address can > only be > from __START_KERNEL_map to > LOAD_PHYSICAL_ADDR+CONFIG_RANDOMI

Re: [PATCH 0/6] randomize kernel physical address and virtual address separately

2015-01-20 Thread Baoquan He
On 01/20/15 at 08:19pm, Andy Lutomirski wrote: > On 01/20/2015 07:37 PM, Baoquan He wrote: > > Currently kaslr only randomize physical address of kernel loading, then add > > the delta > > to virtual address of kernel text mapping. Because kernel virtual address > > can only be > > from __START_K

Re: [PATCH 0/6] randomize kernel physical address and virtual address separately

2015-01-20 Thread Andy Lutomirski
On 01/20/2015 07:37 PM, Baoquan He wrote: > Currently kaslr only randomize physical address of kernel loading, then add > the delta > to virtual address of kernel text mapping. Because kernel virtual address can > only be > from __START_KERNEL_map to > LOAD_PHYSICAL_ADDR+CONFIG_RANDOMIZE_BASE_MA

[PATCH 0/6] randomize kernel physical address and virtual address separately

2015-01-20 Thread Baoquan He
Currently kaslr only randomize physical address of kernel loading, then add the delta to virtual address of kernel text mapping. Because kernel virtual address can only be from __START_KERNEL_map to LOAD_PHYSICAL_ADDR+CONFIG_RANDOMIZE_BASE_MAX_OFFSET, namely [0x8000, 0xc0