summaryrefslogtreecommitdiffstats
path: root/README
diff options
context:
space:
mode:
authorNam Cao <namcaov@gmail.com>2023-08-29 10:36:15 +0200
committerPalmer Dabbelt <palmer@rivosinc.com>2023-11-05 14:12:28 -0800
commitb701f9e726f0a30a94ea6af596b74c1f07b95b6b (patch)
tree731d9ce1dc2aff4a2da59761e46d950cc7d62caf /README
parent3ce99bd6357d4789c138898d9a07916d0f3b7f29 (diff)
downloadlinux-stable-b701f9e726f0a30a94ea6af596b74c1f07b95b6b.tar.gz
linux-stable-b701f9e726f0a30a94ea6af596b74c1f07b95b6b.tar.bz2
linux-stable-b701f9e726f0a30a94ea6af596b74c1f07b95b6b.zip
riscv: provide riscv-specific is_trap_insn()
uprobes expects is_trap_insn() to return true for any trap instructions, not just the one used for installing uprobe. The current default implementation only returns true for 16-bit c.ebreak if C extension is enabled. This can confuse uprobes if a 32-bit ebreak generates a trap exception from userspace: uprobes asks is_trap_insn() who says there is no trap, so uprobes assume a probe was there before but has been removed, and return to the trap instruction. This causes an infinite loop of entering and exiting trap handler. Instead of using the default implementation, implement this function speficially for riscv with checks for both ebreak and c.ebreak. Fixes: 74784081aac8 ("riscv: Add uprobes supported") Signed-off-by: Nam Cao <namcaov@gmail.com> Tested-by: Björn Töpel <bjorn@rivosinc.com> Reviewed-by: Guo Ren <guoren@kernel.org> Link: https://lore.kernel.org/r/20230829083614.117748-1-namcaov@gmail.com Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Diffstat (limited to 'README')
0 files changed, 0 insertions, 0 deletions