[PATCH] riscv: kprobe: Fixup kernel panic when probing an illegal position

Björn Töpel bjorn at kernel.org
Thu Feb 2 00:32:13 PST 2023


Guo Ren <guoren at kernel.org> writes:

>> > -               tmp += GET_INSN_LENGTH(*(kprobe_opcode_t *)tmp);
>> > +               memcpy(&opcode, (void *)tmp, sizeof(kprobe_opcode_t));
>> > +               tmp += GET_INSN_LENGTH(opcode);
>>
>> I'd prefer sizeof(opcode).
> prefer sizeof(opcode) = 4
>
> GET_INSN_LENGTH(opcode) returns 2 or 4;

Sorry for being unclear. I was referring to the sizeof in the memcpy.



More information about the linux-riscv mailing list