Re: [PATCH] x86/kprobes: Fix 1 byte conditional jump target

From: Nadav Amit
Date: Wed Feb 08 2023 - 01:34:41 EST




> On Feb 7, 2023, at 5:33 PM, Dave Hansen <dave.hansen@xxxxxxxxx> wrote:
>
> !! External Email
>
> On 2/7/23 07:21, Masami Hiramatsu (Google) wrote:
>>> Nadav, can you update your patch to assign immediate.value directly?
>> BTW, there are many similar casts around there. I'll fix those too.
>> If we need to be more conservative,
>
> Let's focus on fixing the known bug first, please. Cleanups can come later.

Thank you Dave. That was my take too following your email.

I certainly did not pay attention to the fact that sign extension has already
been done in insn_get_immediate() before Masami pointed it out. So, the comment
in insn_get_immediate() should also be updated to note that the immediate
is sign-*extended* in *all* cases (instead of sign-expanded in most cases. :) )

As you said, I guess the change you and Masami proposed can be done on top of
this patch, which is (and was) only intended to fix the bug, and should
therefore go into 6.2.