]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
x86/kprobes: Fix 1 byte conditional jump target
authorNadav Amit <namit@vmware.com>
Wed, 8 Feb 2023 07:17:08 +0000 (07:17 +0000)
committerDave Hansen <dave.hansen@linux.intel.com>
Wed, 8 Feb 2023 20:03:27 +0000 (12:03 -0800)
commitae052e3ae09572194d7e574906db7272041577d3
treeadb6f9271a31518e91964af558284e9f0079fc57
parent9d2c7203ffdb846399b82b0660563c89e918c751
x86/kprobes: Fix 1 byte conditional jump target

Commit 3bc753c06dd0 ("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: 3bc753c06dd0 ("kbuild: treat char as always unsigned")
Suggested-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Suggested-by: Dave Hansen <dave.hansen@intel.com>
Signed-off-by: Nadav Amit <namit@vmware.com>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/all/20230208071708.4048-1-namit%40vmware.com
arch/x86/kernel/kprobes/core.c