[PATCH] riscv: kprobes: Fix incorrect address calculation
Nam Cao
namcao at linutronix.de
Fri Nov 29 04:19:29 PST 2024
Hi Alex,
On Thu, Nov 28, 2024 at 02:02:40PM +0100, Alexandre Ghiti wrote:
> On 19/11/2024 12:10, Nam Cao wrote:
> > p->ainsn.api.insn is a pointer to u32, therefore arithmetic operations are
> > multiplied by four. This is clearly undesirable for this case.
> >
> > Cast it to (void *) first before any calculation.
...
> This looks good to me, how did you find this issue?
I found it while working on RV monitors (Documentation/trace/rv) which
use kprobes. The monitors exploded on riscv.
Best regards,
Nam
More information about the linux-riscv
mailing list