Index: src/trusted/validator_x86/testdata/64/indirect_jmp_masked.tf |
diff --git a/src/trusted/validator_x86/testdata/64/indirect_jmp_masked.tf b/src/trusted/validator_x86/testdata/64/indirect_jmp_masked.tf |
new file mode 100644 |
index 0000000000000000000000000000000000000000..89d0a531b8efa46e529f207db78ea698cfcf9106 |
--- /dev/null |
+++ b/src/trusted/validator_x86/testdata/64/indirect_jmp_masked.tf |
@@ -0,0 +1,32 @@ |
+BITS: 64 |
+OUTCOME: invalid |
+ |
+# Model a case where an indirect jump is properly masked. |
+# and %edx, 0xe0 |
+asm: and $0xffffffffffffffe0,%edx |
+hex: 83 e2 e0 |
+ |
+# add %rdx, %r15 |
+asm: add %r15,%rdx |
+hex: 4c 01 fa |
+ |
+# jmp %rdx |
+asm: jmpq *%rdx |
+hex: ff e2 |
+ |
+# |
+# Model a case where an indirect jump is no longer properly masked. |
+# and %edx, 0xe0 |
+asm: and $0xffffffffffffffe0,%edx |
+hex: 83 e2 e0 |
+ |
+# lea %r9, [%r15+%rdx*1] |
+asm: lea (%r15,%rdx,1),%r9 |
+hex: 4D 8D 0C 17 |
+ |
+# jmp %r9 |
+asm: jmpq *%r9 |
+hex: 41 FF E1 |
+nc_out: ERROR: Invalid indirect jump |
+ |
+ |