]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
powerpc/kprobes: Remove preempt disable around call to get_kprobe() in arch_prepare_k...
authorNaveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Thu, 20 Oct 2022 17:28:57 +0000 (22:58 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 24 Nov 2022 12:31:49 +0000 (23:31 +1100)
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
arch/powerpc/kernel/kprobes.c

index bd7b1a035459488d12c3d5c615e2569524a3a7b3..88f42de681e1f842a7ec08defd43f081feba6132 100644 (file)
@@ -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