Re: [PATCH] arm: Use kernel mm when updating section permissions

2015-11-06 Thread Laura Abbott
On 11/06/2015 03:49 PM, Kees Cook wrote: On Fri, Nov 6, 2015 at 3:41 PM, Laura Abbott wrote: On 11/06/2015 12:46 PM, Russell King - ARM Linux wrote: On Fri, Nov 06, 2015 at 10:44:32AM -0800, Laura Abbott wrote: with my test patch. I think setting both current->active_mm and &init_mm is suff

Re: [PATCH] arm: Use kernel mm when updating section permissions

2015-11-06 Thread Kees Cook
On Fri, Nov 6, 2015 at 3:41 PM, Laura Abbott wrote: > On 11/06/2015 12:46 PM, Russell King - ARM Linux wrote: >> >> On Fri, Nov 06, 2015 at 10:44:32AM -0800, Laura Abbott wrote: >>> >>> with my test patch. I think setting both current->active_mm and &init_mm >>> is sufficient. Maybe explicitly set

Re: [PATCH] arm: Use kernel mm when updating section permissions

2015-11-06 Thread Kees Cook
On Fri, Nov 6, 2015 at 2:37 PM, Kevin Hilman wrote: > Kees Cook writes: > >> On Fri, Nov 6, 2015 at 1:06 PM, Kevin Hilman wrote: > > [...] > >> Well, all the stuff I wrote tests for in lkdtm expect the kernel to >> entirely Oops, and examining the Oops from outside is needed to verify >> it was

Re: [PATCH] arm: Use kernel mm when updating section permissions

2015-11-06 Thread Laura Abbott
On 11/06/2015 12:46 PM, Russell King - ARM Linux wrote: On Fri, Nov 06, 2015 at 10:44:32AM -0800, Laura Abbott wrote: with my test patch. I think setting both current->active_mm and &init_mm is sufficient. Maybe explicitly setting swapper_pg_dir would be cleaner? Please, stop thinking like thi

Re: [PATCH] arm: Use kernel mm when updating section permissions

2015-11-06 Thread Kevin Hilman
On Fri, Nov 6, 2015 at 2:37 PM, Kevin Hilman wrote: > Kees Cook writes: > >> On Fri, Nov 6, 2015 at 1:06 PM, Kevin Hilman wrote: > > [...] > >> Well, all the stuff I wrote tests for in lkdtm expect the kernel to >> entirely Oops, and examining the Oops from outside is needed to verify >> it was

Re: [PATCH] arm: Use kernel mm when updating section permissions

2015-11-06 Thread Kevin Hilman
Kees Cook writes: > On Fri, Nov 6, 2015 at 1:06 PM, Kevin Hilman wrote: [...] > Well, all the stuff I wrote tests for in lkdtm expect the kernel to > entirely Oops, and examining the Oops from outside is needed to verify > it was the correct type of Oops. I don't think testing via lkdtm can >

Re: [PATCH] arm: Use kernel mm when updating section permissions

2015-11-06 Thread Kees Cook
On Fri, Nov 6, 2015 at 1:06 PM, Kevin Hilman wrote: > Kees Cook writes: > >> On Fri, Nov 6, 2015 at 12:11 PM, Kevin Hilman wrote: >>> On Fri, Nov 6, 2015 at 11:12 AM, Kees Cook wrote: >>> >>> [...] >>> Hi Kevin and Kernel CI folks, Could lkdtm get added to the kernel-CI workflows

Re: [PATCH] arm: Use kernel mm when updating section permissions

2015-11-06 Thread Kevin Hilman
Kees Cook writes: > On Fri, Nov 6, 2015 at 12:11 PM, Kevin Hilman wrote: >> On Fri, Nov 6, 2015 at 11:12 AM, Kees Cook wrote: >> >> [...] >> >>> Hi Kevin and Kernel CI folks, >>> >>> Could lkdtm get added to the kernel-CI workflows? Extracting and >>> validating Oops details when poking lkdtm w

Re: [PATCH] arm: Use kernel mm when updating section permissions

2015-11-06 Thread Russell King - ARM Linux
On Fri, Nov 06, 2015 at 10:44:32AM -0800, Laura Abbott wrote: > with my test patch. I think setting both current->active_mm and &init_mm > is sufficient. Maybe explicitly setting swapper_pg_dir would be cleaner? Please, stop thinking like this. If you're trying to change the kernel section mappin

Re: [PATCH] arm: Use kernel mm when updating section permissions

2015-11-06 Thread Kees Cook
On Fri, Nov 6, 2015 at 12:11 PM, Kevin Hilman wrote: > On Fri, Nov 6, 2015 at 11:12 AM, Kees Cook wrote: > > [...] > >> Hi Kevin and Kernel CI folks, >> >> Could lkdtm get added to the kernel-CI workflows? Extracting and >> validating Oops details when poking lkdtm would be extremely valuable >>

Re: [PATCH] arm: Use kernel mm when updating section permissions

2015-11-06 Thread Kevin Hilman
On Fri, Nov 6, 2015 at 11:12 AM, Kees Cook wrote: [...] > Hi Kevin and Kernel CI folks, > > Could lkdtm get added to the kernel-CI workflows? Extracting and > validating Oops details when poking lkdtm would be extremely valuable > for these cases. :) Yeah, we can add that. What arches should w

Re: [PATCH] arm: Use kernel mm when updating section permissions

2015-11-06 Thread Kees Cook
On Fri, Nov 6, 2015 at 11:08 AM, Kees Cook wrote: > On Fri, Nov 6, 2015 at 10:44 AM, Laura Abbott wrote: >> On 11/05/2015 05:15 PM, Kees Cook wrote: >>> >>> On Thu, Nov 5, 2015 at 5:05 PM, Laura Abbott wrote: On 11/05/2015 08:27 AM, Russell King - ARM Linux wrote: > > > On

Re: [PATCH] arm: Use kernel mm when updating section permissions

2015-11-06 Thread Kees Cook
On Fri, Nov 6, 2015 at 10:44 AM, Laura Abbott wrote: > On 11/05/2015 05:15 PM, Kees Cook wrote: >> >> On Thu, Nov 5, 2015 at 5:05 PM, Laura Abbott wrote: >>> >>> On 11/05/2015 08:27 AM, Russell King - ARM Linux wrote: On Thu, Nov 05, 2015 at 08:20:42AM -0800, Laura Abbott wrote: >>

Re: [PATCH] arm: Use kernel mm when updating section permissions

2015-11-06 Thread Laura Abbott
On 11/05/2015 05:15 PM, Kees Cook wrote: On Thu, Nov 5, 2015 at 5:05 PM, Laura Abbott wrote: On 11/05/2015 08:27 AM, Russell King - ARM Linux wrote: On Thu, Nov 05, 2015 at 08:20:42AM -0800, Laura Abbott wrote: On 11/05/2015 01:46 AM, Russell King - ARM Linux wrote: On Wed, Nov 04, 2015 a

Re: [PATCH] arm: Use kernel mm when updating section permissions

2015-11-05 Thread Kees Cook
On Thu, Nov 5, 2015 at 5:05 PM, Laura Abbott wrote: > On 11/05/2015 08:27 AM, Russell King - ARM Linux wrote: >> >> On Thu, Nov 05, 2015 at 08:20:42AM -0800, Laura Abbott wrote: >>> >>> On 11/05/2015 01:46 AM, Russell King - ARM Linux wrote: On Wed, Nov 04, 2015 at 05:00:39PM -0800, Laur

Re: [PATCH] arm: Use kernel mm when updating section permissions

2015-11-05 Thread Laura Abbott
On 11/05/2015 08:27 AM, Russell King - ARM Linux wrote: On Thu, Nov 05, 2015 at 08:20:42AM -0800, Laura Abbott wrote: On 11/05/2015 01:46 AM, Russell King - ARM Linux wrote: On Wed, Nov 04, 2015 at 05:00:39PM -0800, Laura Abbott wrote: Currently, read only permissions are not being applied eve

Re: [PATCH] arm: Use kernel mm when updating section permissions

2015-11-05 Thread Russell King - ARM Linux
On Thu, Nov 05, 2015 at 08:20:42AM -0800, Laura Abbott wrote: > On 11/05/2015 01:46 AM, Russell King - ARM Linux wrote: > >On Wed, Nov 04, 2015 at 05:00:39PM -0800, Laura Abbott wrote: > >>Currently, read only permissions are not being applied even > >>when CONFIG_DEBUG_RODATA is set. This is becau

Re: [PATCH] arm: Use kernel mm when updating section permissions

2015-11-05 Thread Laura Abbott
On 11/05/2015 01:46 AM, Russell King - ARM Linux wrote: On Wed, Nov 04, 2015 at 05:00:39PM -0800, Laura Abbott wrote: Currently, read only permissions are not being applied even when CONFIG_DEBUG_RODATA is set. This is because section_update uses current->mm for adjusting the page tables. curren

Re: [PATCH] arm: Use kernel mm when updating section permissions

2015-11-05 Thread Russell King - ARM Linux
On Wed, Nov 04, 2015 at 05:00:39PM -0800, Laura Abbott wrote: > Currently, read only permissions are not being applied even > when CONFIG_DEBUG_RODATA is set. This is because section_update > uses current->mm for adjusting the page tables. current->mm > need not be equivalent to the kernel version.

Re: [PATCH] arm: Use kernel mm when updating section permissions

2015-11-04 Thread Kees Cook
On Wed, Nov 4, 2015 at 5:06 PM, Kees Cook wrote: > On Wed, Nov 4, 2015 at 5:00 PM, Laura Abbott > wrote: >> Currently, read only permissions are not being applied even >> when CONFIG_DEBUG_RODATA is set. This is because section_update >> uses current->mm for adjusting the page tables. current->m

Re: [PATCH] arm: Use kernel mm when updating section permissions

2015-11-04 Thread Kees Cook
On Wed, Nov 4, 2015 at 5:00 PM, Laura Abbott wrote: > Currently, read only permissions are not being applied even > when CONFIG_DEBUG_RODATA is set. This is because section_update > uses current->mm for adjusting the page tables. current->mm > need not be equivalent to the kernel version. Use pgd_

[PATCH] arm: Use kernel mm when updating section permissions

2015-11-04 Thread Laura Abbott
Currently, read only permissions are not being applied even when CONFIG_DEBUG_RODATA is set. This is because section_update uses current->mm for adjusting the page tables. current->mm need not be equivalent to the kernel version. Use pgd_offset_k to get the proper page directory for updating. Sign