blob: 980cf075b01733ea1a84dcaea738c5bd4ffb33c8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
From 8894a0c20d920aada305aade0591c1e77167b1db Mon Sep 17 00:00:00 2001
From: Jan Beulich <jbeulich@suse.com>
Date: Fri, 2 Jun 2017 15:21:27 +0100
Subject: [PATCH 2/4] gnttab: never create host mapping unless asked to
We shouldn't create a host mapping unless asked to even in the case of
mapping a granted MMIO page. In particular the mapping wouldn't be torn
down when processing the matching unmap request.
This is part of XSA-224.
Reported-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
xen/common/grant_table.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 69cbdb6..452538e 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -911,10 +911,13 @@ __gnttab_map_grant_ref(
goto undo_out;
}
- rc = create_grant_host_mapping(
- op->host_addr, frame, op->flags, cache_flags);
- if ( rc != GNTST_okay )
- goto undo_out;
+ if ( op->flags & GNTMAP_host_map )
+ {
+ rc = create_grant_host_mapping(op->host_addr, frame, op->flags,
+ cache_flags);
+ if ( rc != GNTST_okay )
+ goto undo_out;
+ }
}
else if ( owner == rd || owner == dom_cow )
{
--
2.1.4
|