Messages in this thread | | | From | Björn Töpel <> | Subject | Re: [PATCH] riscv: kprobe: Fixup kernel panic when probing an illegal position | Date | Thu, 02 Feb 2023 09:32:13 +0100 |
| |
Guo Ren <guoren@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.
| |