Re: [PATCH 3/3] arm64: dump: Add checking for writable and exectuable pages

2016-09-30 Thread Kees Cook
On Fri, Sep 30, 2016 at 9:41 AM, Mark Rutland wrote: > On Fri, Sep 30, 2016 at 09:25:45AM -0700, Kees Cook wrote: >> On Fri, Sep 30, 2016 at 8:58 AM, Mark Rutland wrote: > >> > Would it be worth verifying that all kernel mappings are UXN, too? >> > >> > ARMv8 allows execute-only mappings, and a !

Re: [PATCH 3/3] arm64: dump: Add checking for writable and exectuable pages

2016-09-30 Thread Mark Rutland
On Fri, Sep 30, 2016 at 09:25:45AM -0700, Kees Cook wrote: > On Fri, Sep 30, 2016 at 8:58 AM, Mark Rutland wrote: > > Would it be worth verifying that all kernel mappings are UXN, too? > > > > ARMv8 allows execute-only mappings, and a !UXN mapping could result in an > > info > > leak (e.g. point

Re: [PATCH 3/3] arm64: dump: Add checking for writable and exectuable pages

2016-09-30 Thread Kees Cook
On Fri, Sep 30, 2016 at 8:58 AM, Mark Rutland wrote: > On Thu, Sep 29, 2016 at 02:32:57PM -0700, Laura Abbott wrote: >> @@ -219,6 +223,15 @@ static void note_page(struct pg_state *st, unsigned >> long addr, unsigned level, >> unsigned long delta; >> >> if (st->current_

Re: [PATCH 3/3] arm64: dump: Add checking for writable and exectuable pages

2016-09-30 Thread Mark Rutland
On Thu, Sep 29, 2016 at 02:32:57PM -0700, Laura Abbott wrote: > @@ -219,6 +223,15 @@ static void note_page(struct pg_state *st, unsigned long > addr, unsigned level, > unsigned long delta; > > if (st->current_prot) { > + if (st->check_wx && > +

Re: [PATCH 3/3] arm64: dump: Add checking for writable and exectuable pages

2016-09-29 Thread Mark Rutland
Hi, On Thu, Sep 29, 2016 at 02:32:57PM -0700, Laura Abbott wrote: > Page mappings with full RWX permissions are a security risk. x86 > has an option to walk the page tables and dump any bad pages. > (See e1a58320a38d ("x86/mm: Warn on W^X mappings")). Add a similar > implementation for arm64. > >

[PATCH 3/3] arm64: dump: Add checking for writable and exectuable pages

2016-09-29 Thread Laura Abbott
Page mappings with full RWX permissions are a security risk. x86 has an option to walk the page tables and dump any bad pages. (See e1a58320a38d ("x86/mm: Warn on W^X mappings")). Add a similar implementation for arm64. Signed-off-by: Laura Abbott --- arch/arm64/Kconfig.debug| 28 +++