$NetBSD: patch-CVE-2015-8339,v 1.1 2016/01/07 17:55:55 bouyer Exp $ Patch for CVE-2015-8339 and CVE-2015-8340 aka XSA-159, based on http://xenbits.xenproject.org/xsa/xsa159.patch --- xen/common/memory.c.orig 2013-09-10 08:42:18.000000000 +0200 +++ xen/common/memory.c 2016-01-07 14:39:42.000000000 +0100 @@ -487,7 +487,11 @@ /* Reassign any input pages we managed to steal. */ while ( (page = page_list_remove_head(&in_chunk_list)) ) if ( assign_pages(d, page, 0, MEMF_no_refcount) ) - BUG(); + { + BUG_ON(!d->is_dying); + if ( test_and_clear_bit(_PGC_allocated, &page->count_info) ) + put_page(page); + } dying: rcu_unlock_domain(d); /* Free any output pages we managed to allocate. */