lkml.org 
[lkml]   [2023]   [Feb]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] riscv: kprobe: Fixup kernel panic when probing an illegal position
Date
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.

\
 
 \ /
  Last update: 2023-03-27 00:07    [W:0.082 / U:1.496 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site