From fec1c620d9903766b01f802e871cc1eecb039b5f Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 5 Sep 2012 12:29:05 +0100 Subject: xen: Don't BUG_ON() PoD operations on a non-translated guest. This is XSA-14 / CVE-2012-3496 Signed-off-by: Tim Deegan Reviewed-by: Ian Campbell Tested-by: Ian Campbell --- xen/arch/x86/mm/p2m.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c index 787b4be6a3..54940338d2 100644 --- a/xen/arch/x86/mm/p2m.c +++ b/xen/arch/x86/mm/p2m.c @@ -2058,7 +2058,8 @@ guest_physmap_mark_populate_on_demand(struct domain *d, unsigned long gfn, int pod_count = 0; int rc = 0; - BUG_ON(!paging_mode_translate(d)); + if ( !paging_mode_translate(d) ) + return -EINVAL; rc = gfn_check_limit(d, gfn, order); if ( rc != 0 ) -- cgit v1.2.3