Xen Test Framework
main.c
Go to the documentation of this file.
1
18#include <xtf.h>
19
20const char test_title[] = "XSA-232 PoC";
21
22void test_main(void)
23{
24 struct gnttab_cache_flush flush = {
27 };
28
29 for ( ; flush.a.dev_bus_addr < MB(1); flush.a.dev_bus_addr += PAGE_SIZE )
31
32 /* If Xen is alive at this point, it is probably not vulnerable. */
33
34 xtf_success("Success: Probably not vulnerable to XSA-232\n");
35}
36
37/*
38 * Local variables:
39 * mode: C
40 * c-file-style: "BSD"
41 * c-basic-offset: 4
42 * tab-width: 4
43 * indent-tabs-mode: nil
44 * End:
45 */
void test_main(void)
To be implemented by each test, as its entry point.
Definition: main.c:110
const char test_title[]
The title of the test.
Definition: main.c:24
static long hypercall_grant_table_op(unsigned int cmd, void *args, unsigned int count)
Definition: hypercall.h:131
#define MB(num)
Express num in Megabytes.
Definition: numbers.h:26
#define PAGE_SIZE
Definition: page.h:11
void xtf_success(const char *fmt,...)
Report test success.
Definition: report.c:38
union gnttab_cache_flush::@45 a
uint64_t dev_bus_addr
Definition: grant_table.h:333
#define GNTTAB_CACHE_CLEAN
Definition: grant_table.h:338
#define GNTTABOP_cache_flush
Definition: grant_table.h:330
#define GNTTAB_CACHE_INVAL
Definition: grant_table.h:339