|
From: Mark W. <ma...@so...> - 2020-08-17 19:07:15
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=0c23373b702752289e390b3a16e0a6265284a55e commit 0c23373b702752289e390b3a16e0a6265284a55e Author: Mark Wielaard <ma...@kl...> Date: Sun Jul 26 21:17:23 2020 +0200 Handle REX prefixed JMP instruction. The NET Core runtime might generate a JMP with a REX prefix. For Jv (32bit offset) and Jb (8bit offset) this is valid. Prefixes that change operand size are ignored for such JMPs. So remove the check for sz == 4 and force sz = 4 for Jv. https://bugs.kde.org/show_bug.cgi?id=422174 Diff: --- NEWS | 1 + VEX/priv/guest_amd64_toIR.c | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index 976344cdc0..cc492fc9a9 100644 --- a/NEWS +++ b/NEWS @@ -43,6 +43,7 @@ where XXXXXX is the bug number as listed below. 369029 handle linux syscalls sched_getattr and sched_setattr n-i-bz helgrind: If hg_cli__realloc fails, return NULL. +422174 unhandled instruction bytes: 0x48 0xE9 (REX prefixed JMP instruction) 422623 epoll_ctl warns for uninitialized padding on non-amd64 64bit arches 423021 PPC: Add missing ISA 3.0 documentation link and HWCAPS test. diff --git a/VEX/priv/guest_amd64_toIR.c b/VEX/priv/guest_amd64_toIR.c index fadf47d41d..7888132ebd 100644 --- a/VEX/priv/guest_amd64_toIR.c +++ b/VEX/priv/guest_amd64_toIR.c @@ -21392,8 +21392,8 @@ Long dis_ESC_NONE ( case 0xE9: /* Jv (jump, 16/32 offset) */ if (haveF3(pfx)) goto decode_failure; - if (sz != 4) - goto decode_failure; /* JRS added 2004 July 11 */ + sz = 4; /* Prefixes that change operand size are ignored for this + instruction. Operand size is forced to 32bit. */ if (haveF2(pfx)) DIP("bnd ; "); /* MPX bnd prefix. */ d64 = (guest_RIP_bbstart+delta+sz) + getSDisp(sz,delta); delta += sz; @@ -21404,8 +21404,7 @@ Long dis_ESC_NONE ( case 0xEB: /* Jb (jump, byte offset) */ if (haveF3(pfx)) goto decode_failure; - if (sz != 4) - goto decode_failure; /* JRS added 2004 July 11 */ + /* Prefixes that change operand size are ignored for this instruction. */ if (haveF2(pfx)) DIP("bnd ; "); /* MPX bnd prefix. */ d64 = (guest_RIP_bbstart+delta+1) + getSDisp8(delta); delta++; |