From: Jan Beulich Date: Fri, 28 Oct 2022 09:38:32 +0000 (+0200) Subject: common: map_vcpu_info() wants to unshare the underlying page X-Git-Tag: archive/raspbian/4.17.0-1+rpi1^2~33^2~93 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=48980cf24d5cf41fd644600f99c753419505e735;p=xen.git common: map_vcpu_info() wants to unshare the underlying page Not passing P2M_UNSHARE to get_page_from_gfn() means there won't even be an attempt to unshare the referenced page, without any indication to the caller (e.g. -EAGAIN). Note that guests have no direct control over which of their pages are shared (or paged out), and hence they have no way to make sure all on their own that the subsequent obtaining of a writable type reference can actually succeed. Signed-off-by: Jan Beulich Reviewed-by: Roger Pau Monné Acked-by: Julien Grall Release-acked-by: Henry Wang --- diff --git a/xen/common/domain.c b/xen/common/domain.c index 8dd6cd5a8f..53f7e734fe 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -1484,7 +1484,7 @@ int map_vcpu_info(struct vcpu *v, unsigned long gfn, unsigned int offset) if ( (v != current) && !(v->pause_flags & VPF_down) ) return -EINVAL; - page = get_page_from_gfn(d, gfn, NULL, P2M_ALLOC); + page = get_page_from_gfn(d, gfn, NULL, P2M_UNSHARE); if ( !page ) return -EINVAL;