Re: [PATCH 2/2] ARM: mm: make text and rodata read-only

2014-04-14 Thread Rabin Vincent
On Tue, Apr 08, 2014 at 01:19:01PM -0700, Kees Cook wrote: > > To prevent any stale entries being used indefinitely, perhaps the all > > CPU TLB flush can be inserted into > > ftrace_arch_code_modify_post_process(), which is called after the > > stop_machine() and which is where x86 for example mak

Re: [PATCH 2/2] ARM: mm: make text and rodata read-only

2014-04-09 Thread Jon Medhurst (Tixy)
On Tue, 2014-04-08 at 21:48 +0200, Rabin Vincent wrote: [...] > For any other CPU to pull in the writable entry it would have to get a > TLB miss inside the loop in multi_cpu_stop(), after the state transition > to MULTI_STOP_RUN and before the state transition to MULTI_STOP_EXIT. > This is unlikel

Re: [PATCH 2/2] ARM: mm: make text and rodata read-only

2014-04-08 Thread Kees Cook
On Tue, Apr 8, 2014 at 12:48 PM, Rabin Vincent wrote: > On Tue, Apr 08, 2014 at 09:59:07AM -0700, Kees Cook wrote: >> On Tue, Apr 8, 2014 at 9:12 AM, Jon Medhurst (Tixy) wrote: >> > And is the page table being modified unique to the current CPU? I >> > thought a common set of page tables was shar

Re: [PATCH 2/2] ARM: mm: make text and rodata read-only

2014-04-08 Thread Rabin Vincent
On Tue, Apr 08, 2014 at 09:59:07AM -0700, Kees Cook wrote: > On Tue, Apr 8, 2014 at 9:12 AM, Jon Medhurst (Tixy) wrote: > > And is the page table being modified unique to the current CPU? I > > thought a common set of page tables was shared across all of them. If > > that is the case then one CPU

Re: [PATCH 2/2] ARM: mm: make text and rodata read-only

2014-04-08 Thread Kees Cook
On Tue, Apr 8, 2014 at 9:12 AM, Jon Medhurst (Tixy) wrote: > On Tue, 2014-04-08 at 09:01 -0700, Kees Cook wrote: >> On Tue, Apr 8, 2014 at 5:41 AM, Jon Medhurst (Tixy) wrote: >> > On Fri, 2014-04-04 at 17:07 -0700, Kees Cook wrote: >> >> On Fri, Apr 4, 2014 at 12:58 PM, Rabin Vincent wrote: >> >

Re: [PATCH 2/2] ARM: mm: make text and rodata read-only

2014-04-08 Thread Jon Medhurst (Tixy)
On Tue, 2014-04-08 at 09:01 -0700, Kees Cook wrote: > On Tue, Apr 8, 2014 at 5:41 AM, Jon Medhurst (Tixy) wrote: > > On Fri, 2014-04-04 at 17:07 -0700, Kees Cook wrote: > >> On Fri, Apr 4, 2014 at 12:58 PM, Rabin Vincent wrote: > > [...] > >> > You need a TLB flush. I had a flush_tlb_all() in my

Re: [PATCH 2/2] ARM: mm: make text and rodata read-only

2014-04-08 Thread Kees Cook
On Tue, Apr 8, 2014 at 5:41 AM, Jon Medhurst (Tixy) wrote: > On Fri, 2014-04-04 at 17:07 -0700, Kees Cook wrote: >> On Fri, Apr 4, 2014 at 12:58 PM, Rabin Vincent wrote: > [...] >> > You need a TLB flush. I had a flush_tlb_all() in my example patch, >> > http://lists.infradead.org/pipermail/linu

Re: [PATCH 2/2] ARM: mm: make text and rodata read-only

2014-04-08 Thread Jon Medhurst (Tixy)
On Fri, 2014-04-04 at 17:07 -0700, Kees Cook wrote: > On Fri, Apr 4, 2014 at 12:58 PM, Rabin Vincent wrote: [...] > > You need a TLB flush. I had a flush_tlb_all() in my example patch, > > http://lists.infradead.org/pipermail/linux-arm-kernel/2014-April/244335.html, > > but the following is proba

Re: [PATCH 2/2] ARM: mm: make text and rodata read-only

2014-04-04 Thread Kees Cook
On Fri, Apr 4, 2014 at 12:58 PM, Rabin Vincent wrote: > On Thu, Apr 03, 2014 at 07:15:19PM -0700, Kees Cook wrote: >> diff --git a/arch/arm/kernel/ftrace.c b/arch/arm/kernel/ftrace.c >> index 34e56647dcee..4ae343c1e2a3 100644 >> --- a/arch/arm/kernel/ftrace.c >> +++ b/arch/arm/kernel/ftrace.c >> @

Re: [PATCH 2/2] ARM: mm: make text and rodata read-only

2014-04-04 Thread Rabin Vincent
On Thu, Apr 03, 2014 at 07:15:19PM -0700, Kees Cook wrote: > diff --git a/arch/arm/kernel/ftrace.c b/arch/arm/kernel/ftrace.c > index 34e56647dcee..4ae343c1e2a3 100644 > --- a/arch/arm/kernel/ftrace.c > +++ b/arch/arm/kernel/ftrace.c > @@ -14,6 +14,7 @@ > > #include > #include > +#include >