From: Andrew Cooper Date: Fri, 1 Feb 2019 10:28:45 +0000 (+0100) Subject: x86/mem-sharing: Don't leave the altp2m lock held when nominating a page X-Git-Tag: RELEASE-4.11.2~104 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=7d1bd985ebd4c1473c4dfd50b6d3a33c8e1b1a93;p=people%2Fdwmw2%2Fxen.git x86/mem-sharing: Don't leave the altp2m lock held when nominating a page get_gfn_type_access() internally takes the p2m lock, and nothing ever unlocks it. Switch to using the unlocked accessor instead. This wasn't included in XSA-277 because neither mem-sharing nor altp2m are supported. Signed-off-by: Andrew Cooper Acked-by: Tamas K Lengyel Reviewed-by: Jan Beulich master commit: d6e02850d3b45c9658457214a749cc48097bdef4 master date: 2018-11-22 17:58:46 +0000 --- diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c index fad8a9df13..536262d9b7 100644 --- a/xen/arch/x86/mm/mem_sharing.c +++ b/xen/arch/x86/mm/mem_sharing.c @@ -819,7 +819,8 @@ static int nominate_page(struct domain *d, gfn_t gfn, if ( !ap2m ) continue; - amfn = get_gfn_type_access(ap2m, gfn_x(gfn), &ap2mt, &ap2ma, 0, NULL); + amfn = __get_gfn_type_access(ap2m, gfn_x(gfn), &ap2mt, &ap2ma, + 0, NULL, false); if ( mfn_valid(amfn) && (!mfn_eq(amfn, mfn) || ap2ma != p2ma) ) { altp2m_list_unlock(d);