]> git.hungrycats.org Git - linux/commit
riscv: kprobes: allow writing to x0
authorNam Cao <namcaov@gmail.com>
Tue, 29 Aug 2023 18:25:00 +0000 (20:25 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 28 Nov 2023 17:15:15 +0000 (17:15 +0000)
commit5fb6a480a0fa1857c2325f8b747d0397a1777bf0
tree869af355f8c1b30d34b2224b2a51f44e798fc72c
parentc93d4b75f58e7e18283cfe195dbe9ec9c58d9133
riscv: kprobes: allow writing to x0

commit 8cb22bec142624d21bc85ff96b7bad10b6220e6a upstream.

Instructions can write to x0, so we should simulate these instructions
normally.

Currently, the kernel hangs if an instruction who writes to x0 is
simulated.

Fixes: c22b0bcb1dd0 ("riscv: Add kprobes supported")
Cc: stable@vger.kernel.org
Signed-off-by: Nam Cao <namcaov@gmail.com>
Reviewed-by: Charlie Jenkins <charlie@rivosinc.com>
Acked-by: Guo Ren <guoren@kernel.org>
Link: https://lore.kernel.org/r/20230829182500.61875-1-namcaov@gmail.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/riscv/kernel/probes/simulate-insn.c