]> xenbits.xensource.com Git - xen.git/commitdiff
evtchn-fifo: prevent use after free
authorJan Beulich <jbeulich@suse.com>
Thu, 8 Sep 2016 12:32:51 +0000 (14:32 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 8 Sep 2016 12:32:51 +0000 (14:32 +0200)
evtchn_fifo_init_control() calls evtchn_fifo_destroy() on an error
path, leading to cleanup_event_array() which frees d->evtchn_fifo
without also clearing the pointer. Otoh the bulk of
evtchn_fifo_init_control() is dependent on d->evtchn_fifo being NULL.

This is XSA-188 / CVE-2016-7154.

Reported-by: Mikhail V Gorobets <mikhail.v.gorobets@intel.com>
Suggested-by: Mikhail V Gorobets <mikhail.v.gorobets@intel.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/common/event_fifo.c

index a443c980184448bd421b86d9425875b7354b47b3..93752d4439dcf9f67b012d0842cb517960aa5733 100644 (file)
@@ -482,6 +482,7 @@ static void cleanup_event_array(struct domain *d)
     for ( i = 0; i < EVTCHN_FIFO_MAX_EVENT_ARRAY_PAGES; i++ )
         unmap_guest_page(d->evtchn_fifo->event_array[i]);
     xfree(d->evtchn_fifo);
+    d->evtchn_fifo = NULL;
 }
 
 static void setup_ports(struct domain *d)