aboutsummaryrefslogtreecommitdiff
path: root/system/xen/xsa/xsa242-4.9.patch
diff options
context:
space:
mode:
authorMario Preksavec <mario@slackware.hr>2017-10-20 20:56:55 +0200
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2017-10-21 07:08:14 +0700
commit139c45ee8aed136d55ae25517e67cd103978c9c3 (patch)
tree0c1f8b0bb7353039941d468a024722add35b2d17 /system/xen/xsa/xsa242-4.9.patch
parentd7ebd09fcd7f59ba2cb12f45eecff627aec49860 (diff)
system/xen: XSA 237-245 update.
Signed-off-by: Mario Preksavec <mario@slackware.hr>
Diffstat (limited to 'system/xen/xsa/xsa242-4.9.patch')
-rw-r--r--system/xen/xsa/xsa242-4.9.patch43
1 files changed, 43 insertions, 0 deletions
diff --git a/system/xen/xsa/xsa242-4.9.patch b/system/xen/xsa/xsa242-4.9.patch
new file mode 100644
index 0000000000000..8adfa61fd71ec
--- /dev/null
+++ b/system/xen/xsa/xsa242-4.9.patch
@@ -0,0 +1,43 @@
+From: Jan Beulich <jbeulich@suse.com>
+Subject: x86: don't allow page_unlock() to drop the last type reference
+
+Only _put_page_type() does the necessary cleanup, and hence not all
+domain pages can be released during guest cleanup (leaving around
+zombie domains) if we get this wrong.
+
+This is XSA-242.
+
+Signed-off-by: Jan Beulich <jbeulich@suse.com>
+
+--- a/xen/arch/x86/mm.c
++++ b/xen/arch/x86/mm.c
+@@ -1923,7 +1923,11 @@ void page_unlock(struct page_info *page)
+
+ do {
+ x = y;
++ ASSERT((x & PGT_count_mask) && (x & PGT_locked));
++
+ nx = x - (1 | PGT_locked);
++ /* We must not drop the last reference here. */
++ ASSERT(nx & PGT_count_mask);
+ } while ( (y = cmpxchg(&page->u.inuse.type_info, x, nx)) != x );
+ }
+
+@@ -2611,6 +2615,17 @@ static int _put_page_type(struct page_in
+ (page->count_info & PGC_page_table)) )
+ page_set_tlbflush_timestamp(page);
+ }
++ else if ( unlikely((nx & (PGT_locked | PGT_count_mask)) ==
++ (PGT_locked | 1)) )
++ {
++ /*
++ * We must not drop the second to last reference when the page is
++ * locked, as page_unlock() doesn't do any cleanup of the type.
++ */
++ cpu_relax();
++ y = page->u.inuse.type_info;
++ continue;
++ }
+
+ if ( likely((y = cmpxchg(&page->u.inuse.type_info, x, nx)) == x) )
+ break;