kprobes/x86: Make insn buffer always ROX and use text_poke()
authorMasami Hiramatsu <mhiramat@kernel.org>
Fri, 18 Aug 2017 08:24:00 +0000 (17:24 +0900)
committerIngo Molnar <mingo@kernel.org>
Thu, 28 Sep 2017 07:23:03 +0000 (09:23 +0200)
commit63fef14fc98a8b4fad777fd3bef4d068802b3f14
tree538f39c60c9eaafc7a88fc5c717f53f86cd02ec1
parent4f56186ec051033848a669f1b145162d1c53e854
kprobes/x86: Make insn buffer always ROX and use text_poke()

Make insn buffer always ROX and use text_poke() to write
the copied instructions instead of set_memory_*().
This makes instruction buffer stronger against other
kernel subsystems because there is no window time
to modify the buffer.

Suggested-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
Cc: David S . Miller <davem@davemloft.net>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/150304463032.17009.14195368040691676813.stgit@devbox
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/kernel/kprobes/common.h
arch/x86/kernel/kprobes/core.c
arch/x86/kernel/kprobes/opt.c
kernel/kprobes.c