diff options
author | 2021-05-19 16:17:21 +0530 | |
---|---|---|
committer | 2021-06-25 14:47:18 +1000 | |
commit | 12b58492e60bf5a31d7f41e8a6f8ceb6f87e710e (patch) | |
tree | 03c357345a7d49d39af1cb173f5903f465e89285 | |
parent | powerpc/kprobes: Roll IS_RFI() macro into IS_RFID() (diff) | |
download | linux-dev-12b58492e60bf5a31d7f41e8a6f8ceb6f87e710e.tar.xz linux-dev-12b58492e60bf5a31d7f41e8a6f8ceb6f87e710e.zip |
powerpc/kprobes: Warn if instruction patching failed
When arming and disarming probes, we currently assume that instruction
patching can never fail, and don't have a mechanism to surface errors.
Add a warning in case instruction patching ever fails.
Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/18d7b1309f938c08ce07738100932b551bdd3a52.1621416666.git.naveen.n.rao@linux.vnet.ibm.com
-rw-r--r-- | arch/powerpc/kernel/kprobes.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/powerpc/kernel/kprobes.c b/arch/powerpc/kernel/kprobes.c index 2303511c7745..eeb6beade975 100644 --- a/arch/powerpc/kernel/kprobes.c +++ b/arch/powerpc/kernel/kprobes.c @@ -165,13 +165,13 @@ NOKPROBE_SYMBOL(arch_prepare_kprobe); void arch_arm_kprobe(struct kprobe *p) { - patch_instruction(p->addr, ppc_inst(BREAKPOINT_INSTRUCTION)); + WARN_ON_ONCE(patch_instruction(p->addr, ppc_inst(BREAKPOINT_INSTRUCTION))); } NOKPROBE_SYMBOL(arch_arm_kprobe); void arch_disarm_kprobe(struct kprobe *p) { - patch_instruction(p->addr, ppc_inst(p->opcode)); + WARN_ON_ONCE(patch_instruction(p->addr, ppc_inst(p->opcode))); } NOKPROBE_SYMBOL(arch_disarm_kprobe); |