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 <jbeulich@suse.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Julien Grall <jgrall@amazon.com>
master commit: 48980cf24d
master date: 2022-10-28 11:38:32 +0200
This commit is contained in:
Jan Beulich committed 2022-10-31 13:26:33 +01:00
1 parent aac1085090
commit 426a8346c0
1 file changed
+1 -1
+1 -1
View File
@@ -1471,7 +1471,7 @@ int map_vcpu_info(struct vcpu *v, unsigned long gfn, unsigned 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;
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.