vex: r3383 - /trunk/priv/guest_amd64_toIR.c

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

vex: r3383 - /trunk/priv/guest_amd64_toIR.c

svn-2
Author: sewardj
Date: Wed May 24 15:28:25 2017
New Revision: 3383

Log:
Handle x86 CET prefixes (64 bit only).  Fixes #379525.
Patch from [hidden email].

Modified:
    trunk/priv/guest_amd64_toIR.c

Modified: trunk/priv/guest_amd64_toIR.c
==============================================================================
--- trunk/priv/guest_amd64_toIR.c (original)
+++ trunk/priv/guest_amd64_toIR.c Wed May 24 15:28:25 2017
@@ -21830,13 +21830,22 @@
       }
       return delta;
 
+   case 0x19:
+   case 0x1C:
+   case 0x1D:
+   case 0x1E:
    case 0x1F:
-      if (haveF2orF3(pfx)) goto decode_failure;
+      // Intel CET instructions can have any prefixes before NOPs
+      // and can use any ModRM, SIB and disp
       modrm = getUChar(delta);
-      if (epartIsReg(modrm)) goto decode_failure;
-      addr = disAMode ( &alen, vbi, pfx, delta, dis_buf, 0 );
-      delta += alen;
-      DIP("nop%c %s\n", nameISize(sz), dis_buf);
+      if (epartIsReg(modrm)) {
+         delta += 1;
+         DIP("nop%c\n", nameISize(sz));
+      } else {
+         addr = disAMode ( &alen, vbi, pfx, delta, dis_buf, 0 );
+         delta += alen;
+         DIP("nop%c %s\n", nameISize(sz), dis_buf);
+      }
       return delta;
 
    case 0x31: { /* RDTSC */


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Valgrind-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/valgrind-developers