]> xenbits.xensource.com Git - xen.git/commitdiff
grant_table: fix GNTTABOP_cache_flush handling
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 12 Sep 2017 13:01:11 +0000 (15:01 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 12 Sep 2017 13:01:11 +0000 (15:01 +0200)
Don't fall over a NULL grant_table pointer when the owner of the domain
is a system domain (DOMID_{XEN,IO} etc).

This is CVE-2017-14318 / XSA-232.

Reported-by: Matthew Daley <mattd@bugfuzz.com>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
master commit: c3d830b244998b3686e2eb64db95996be5eb5e5c
master date: 2017-09-12 14:44:11 +0200

xen/common/grant_table.c

index 6d62fe16a3b6ec98a6a0b4b11ded1a2f11beeb1e..68c94b67bda858deefa61dc5de3a3970cf0ce8c1 100644 (file)
@@ -3030,7 +3030,7 @@ static int __gnttab_cache_flush(gnttab_cache_flush_t *cflush,
 
     page = mfn_to_page(mfn);
     owner = page_get_owner_and_reference(page);
-    if ( !owner )
+    if ( !owner || !owner->grant_table )
     {
         rcu_unlock_domain(d);
         return -EPERM;