]> xenbits.xensource.com Git - people/royger/xen-test-framework.git/commitdiff
Fix XSA-168 PoC on Gen1 AMD hardware
authorAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 22 Apr 2016 18:36:15 +0000 (19:36 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 22 Apr 2016 18:36:15 +0000 (19:36 +0100)
We care simply that the vulnerability is fixed, rather than the architectural
correctness of the emulation of `invlpg`.  Correctness should be implemented
by a functional test.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
tests/xsa-168/main.c

index 29389bd7dfa05c00a7466b5f811f824431d37349..d473b4f60fec4b47a85770230d07f9366c733a08 100644 (file)
@@ -35,7 +35,17 @@ void test_main(void)
 {
     printk("XSA-168 PoC\n");
 
-    asm volatile ("invlpg (%0)" :: "q" (0x8000000000000000UL));
+    /**
+     * At the time of writing, Xen doesn't correctly handle `invlpg` while
+     * running in shadow mode on AMD Gen1 hardware lacking decode assistance.
+     * For this test, we simply care that Xen doesn't crash.
+     *
+     * @todo Write a different test which cares about the architecturally
+     * correct handling of `invlpg`.
+     */
+    asm volatile ("1: invlpg (%0); 2:"
+                  _ASM_EXTABLE(1b, 2b)
+                  :: "q" (0x8000000000000000UL));
 
     xtf_success(NULL);
 }