x86/paging: return -EINVAL for paging domctls for dying domains

The current logic returns 0 and leaves the domctl parameter uninitialized for
any parameter fetching operations (like the GET_ALLOCATION operation), which
is not helpful from a toolstack point of view, because there's no indication
that the data hasn't been fetched.

For at least the Ocaml stubs, this ends up passing back stack rubble as if it
were a correct result.

Inform the caller properly that it hasn't got any data.

Reported-by: Edwin Török <edvin.torok@citrix.com>
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
This commit is contained in:
Roger Pau Monné authored and Andrew Cooper committed 2023-02-09 12:04:11 +00:00
1 parent 26f99e055d
commit 4e0b4ccfc5
1 file changed
+2 -3
+2 -3
View File
@@ -695,9 +695,8 @@ int paging_domctl(struct domain *d, struct xen_domctl_shadow_op *sc,
if ( unlikely(d->is_dying) )
{
gdprintk(XENLOG_INFO, "Ignoring paging op on dying domain %u\n",
d->domain_id);
return 0;
gdprintk(XENLOG_INFO, "Tried to do a paging op on dying %pd\n", d);
return -EINVAL;
}
if ( unlikely(d->vcpu == NULL) || unlikely(d->vcpu[0] == NULL) )
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.