Re: [PATCH] powerpc/mm/radix: Only add X for pages overlapping kernel text

2017-06-08 Thread Balbir Singh
On Tue, Jun 6, 2017 at 8:17 PM, Michael Ellerman wrote: > Balbir Singh writes: >> On Tue, Jun 6, 2017 at 3:48 PM, Michael Ellerman wrote: >>> Currently we map the whole linear mapping with PAGE_KERNEL_X. Instead we >>> should

Re: [PATCH] powerpc/mm/radix: Only add X for pages overlapping kernel text

2017-06-08 Thread Aneesh Kumar K.V
Michael Ellerman writes: > Currently we map the whole linear mapping with PAGE_KERNEL_X. Instead we > should check if the page overlaps the kernel text and only then add > PAGE_KERNEL_X. > > Note that we still use 1G pages if they're available, so this will > typically still

Re: [PATCH] powerpc/mm/radix: Only add X for pages overlapping kernel text

2017-06-06 Thread Michael Ellerman
Balbir Singh writes: > On Tue, Jun 6, 2017 at 3:48 PM, Michael Ellerman wrote: >> Currently we map the whole linear mapping with PAGE_KERNEL_X. Instead we >> should check if the page overlaps the kernel text and only then add >> PAGE_KERNEL_X. ... >>

Re: [PATCH] powerpc/mm/radix: Only add X for pages overlapping kernel text

2017-06-06 Thread Balbir Singh
On Tue, Jun 6, 2017 at 3:48 PM, Michael Ellerman wrote: > Currently we map the whole linear mapping with PAGE_KERNEL_X. Instead we > should check if the page overlaps the kernel text and only then add > PAGE_KERNEL_X. > > Note that we still use 1G pages if they're available,

[PATCH] powerpc/mm/radix: Only add X for pages overlapping kernel text

2017-06-05 Thread Michael Ellerman
Currently we map the whole linear mapping with PAGE_KERNEL_X. Instead we should check if the page overlaps the kernel text and only then add PAGE_KERNEL_X. Note that we still use 1G pages if they're available, so this will typically still result in a 1G executable page at KERNELBASE. So this fix