powerpc/kprobes: Dereference function pointers only if the address does not belong...
authorNaveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Mon, 30 Oct 2017 15:12:09 +0000 (20:42 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 Nov 2017 09:17:19 +0000 (10:17 +0100)
commita351eccfb5354b409d01c213910be85429e244c4
tree0b307c825bb9e2c43800e8b040f3fcfc73a39998
parentbcef2ac5fefcd273db50d4bad47f69266d3aba0b
powerpc/kprobes: Dereference function pointers only if the address does not belong to kernel text

commit e6c4dcb308160115287afd87afb63b5684d75a5b upstream.

This makes the changes introduced in commit 83e840c770f2c5
("powerpc64/elfv1: Only dereference function descriptor for non-text
symbols") to be specific to the kprobe subsystem.

We previously changed ppc_function_entry() to always check the provided
address to confirm if it needed to be dereferenced. This is actually
only an issue for kprobe blacklisted asm labels (through use of
_ASM_NOKPROBE_SYMBOL) and can cause other issues with ftrace. Also, the
additional checks are not really necessary for our other uses.

As such, move this check to the kprobes subsystem.

Fixes: 83e840c770f2 ("powerpc64/elfv1: Only dereference function descriptor for non-text symbols")
Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/powerpc/kernel/kprobes.c