diff options
author | Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com> | 2022-10-20 22:58:57 +0530 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2022-11-24 23:31:49 +1100 |
commit | 2fa9482334b0593b7edc371a13c0cca81daaa89e (patch) | |
tree | 49fb4e578da155b4b9671b5dfc25561a4a3af31a /arch/powerpc | |
parent | 16a3f41ff3322830683d3ccc14d77736829c61bf (diff) | |
download | linux-stable-2fa9482334b0593b7edc371a13c0cca81daaa89e.tar.gz linux-stable-2fa9482334b0593b7edc371a13c0cca81daaa89e.tar.bz2 linux-stable-2fa9482334b0593b7edc371a13c0cca81daaa89e.zip |
powerpc/kprobes: Remove preempt disable around call to get_kprobe() in arch_prepare_kprobe()
arch_prepare_kprobe() is called from register_kprobe() via
prepare_kprobe(), or through register_aggr_kprobe(), both with the
kprobe_mutex held. Per the comment for get_kprobe():
/*
* This routine is called either:
* - under the 'kprobe_mutex' - during kprobe_[un]register().
* OR
* - with preemption disabled - from architecture specific code.
*/
As such, there is no need to disable preemption around the call to
get_kprobe(). Drop the same.
Reported-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/1043d06a0affed83a4a46dd29466e72820ee215d.1666262278.git.naveen.n.rao@linux.vnet.ibm.com
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/kernel/kprobes.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/arch/powerpc/kernel/kprobes.c b/arch/powerpc/kernel/kprobes.c index bd7b1a035459..88f42de681e1 100644 --- a/arch/powerpc/kernel/kprobes.c +++ b/arch/powerpc/kernel/kprobes.c @@ -158,9 +158,7 @@ int arch_prepare_kprobe(struct kprobe *p) printk("Cannot register a kprobe on the second word of prefixed instruction\n"); ret = -EINVAL; } - preempt_disable(); prev = get_kprobe(p->addr - 1); - preempt_enable_no_resched(); /* * When prev is a ftrace-based kprobe, we don't have an insn, and it |