Skip to content
Commit ae052e3a authored by Nadav Amit's avatar Nadav Amit Committed by Dave Hansen
Browse files

x86/kprobes: Fix 1 byte conditional jump target



Commit 3bc753c0 ("kbuild: treat char as always unsigned") broke
kprobes.  Setting a probe-point on 1 byte conditional jump can cause the
kernel to crash when the (signed) relative jump offset gets treated as
unsigned.

Fix by replacing the unsigned 'immediate.bytes' (plus a cast) with the
signed 'immediate.value' when assigning to the relative jump offset.

[ dhansen: clarified changelog ]

Fixes: 3bc753c0 ("kbuild: treat char as always unsigned")
Suggested-by: default avatarMasami Hiramatsu (Google) <mhiramat@kernel.org>
Suggested-by: default avatarDave Hansen <dave.hansen@intel.com>
Signed-off-by: default avatarNadav Amit <namit@vmware.com>
Signed-off-by: default avatarDave Hansen <dave.hansen@linux.intel.com>
Acked-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/all/20230208071708.4048-1-namit%40vmware.com
parent 9d2c7203
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment