Re: [PATCH v8 2/7] powerpc/kprobes: Mark newly allocated probes as RO

2020-04-03 Thread Naveen N. Rao
Russell Currey wrote: On Fri, 2020-04-03 at 15:06 +0530, Naveen N. Rao wrote: Russell Currey wrote: > On Fri, 2020-04-03 at 00:18 +0530, Naveen N. Rao wrote: > > Naveen N. Rao wrote: > > > Russell Currey wrote: > > > > > > > > +void *alloc_insn_page(void) > > > > +{ > > > > + void *page =

Re: [PATCH v8 2/7] powerpc/kprobes: Mark newly allocated probes as RO

2020-04-03 Thread Russell Currey
On Fri, 2020-04-03 at 15:06 +0530, Naveen N. Rao wrote: > Russell Currey wrote: > > On Fri, 2020-04-03 at 00:18 +0530, Naveen N. Rao wrote: > > > Naveen N. Rao wrote: > > > > Russell Currey wrote: > > > > > With CONFIG_STRICT_KERNEL_RWX=y and CONFIG_KPROBES=y, there > > > > > will > > > > > be one

Re: [PATCH v8 2/7] powerpc/kprobes: Mark newly allocated probes as RO

2020-04-03 Thread Naveen N. Rao
Russell Currey wrote: On Fri, 2020-04-03 at 00:18 +0530, Naveen N. Rao wrote: Naveen N. Rao wrote: > Russell Currey wrote: > > With CONFIG_STRICT_KERNEL_RWX=y and CONFIG_KPROBES=y, there will > > be one > > W+X page at boot by default. This can be tested with > > CONFIG_PPC_PTDUMP=y and

Re: [PATCH v8 2/7] powerpc/kprobes: Mark newly allocated probes as RO

2020-04-03 Thread Russell Currey
On Fri, 2020-04-03 at 00:18 +0530, Naveen N. Rao wrote: > Naveen N. Rao wrote: > > Russell Currey wrote: > > > With CONFIG_STRICT_KERNEL_RWX=y and CONFIG_KPROBES=y, there will > > > be one > > > W+X page at boot by default. This can be tested with > > > CONFIG_PPC_PTDUMP=y and

Re: [PATCH v8 2/7] powerpc/kprobes: Mark newly allocated probes as RO

2020-04-02 Thread Russell Currey
On Fri, 2020-04-03 at 00:18 +0530, Naveen N. Rao wrote: > Naveen N. Rao wrote: > > Russell Currey wrote: > > > With CONFIG_STRICT_KERNEL_RWX=y and CONFIG_KPROBES=y, there will > > > be one > > > W+X page at boot by default. This can be tested with > > > CONFIG_PPC_PTDUMP=y and

Re: [PATCH v8 2/7] powerpc/kprobes: Mark newly allocated probes as RO

2020-04-02 Thread Naveen N. Rao
Naveen N. Rao wrote: Russell Currey wrote: With CONFIG_STRICT_KERNEL_RWX=y and CONFIG_KPROBES=y, there will be one W+X page at boot by default. This can be tested with CONFIG_PPC_PTDUMP=y and CONFIG_PPC_DEBUG_WX=y set, and checking the kernel log during boot. powerpc doesn't implement its own

Re: [PATCH v8 2/7] powerpc/kprobes: Mark newly allocated probes as RO

2020-04-02 Thread Naveen N. Rao
Russell Currey wrote: With CONFIG_STRICT_KERNEL_RWX=y and CONFIG_KPROBES=y, there will be one W+X page at boot by default. This can be tested with CONFIG_PPC_PTDUMP=y and CONFIG_PPC_DEBUG_WX=y set, and checking the kernel log during boot. powerpc doesn't implement its own alloc() for kprobes

[PATCH v8 2/7] powerpc/kprobes: Mark newly allocated probes as RO

2020-04-02 Thread Russell Currey
With CONFIG_STRICT_KERNEL_RWX=y and CONFIG_KPROBES=y, there will be one W+X page at boot by default. This can be tested with CONFIG_PPC_PTDUMP=y and CONFIG_PPC_DEBUG_WX=y set, and checking the kernel log during boot. powerpc doesn't implement its own alloc() for kprobes like other architectures