powerpc/kprobes: Disable preemption before invoking probe handler for optprobes
authorNaveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Mon, 23 Oct 2017 16:37:38 +0000 (22:07 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 10 Dec 2017 12:40:43 +0000 (13:40 +0100)
commit1ffabfc1d58ba586fa11cc3cde21d54afec03387
treee18960f2dd1016105d220e4bdd7cc2f2d4b42098
parentf8d07852819a0c2da239fca155342b4f80f4aedf
powerpc/kprobes: Disable preemption before invoking probe handler for optprobes

commit 8a2d71a3f2737e2448aa68de2b6052cb570d3d2a upstream.

Per Documentation/kprobes.txt, probe handlers need to be invoked with
preemption disabled. Update optimized_callback() to do so. Also move
get_kprobe_ctlblk() invocation post preemption disable, since it
accesses pre-cpu data.

This was not an issue so far since optprobes wasn't selected if
CONFIG_PREEMPT was enabled. Commit a30b85df7d599f ("kprobes: Use
synchronize_rcu_tasks() for optprobe with CONFIG_PREEMPT=y") changes
this.

Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/powerpc/kernel/optprobes.c