mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
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:
1 parent
26f99e055d
commit
4e0b4ccfc5
1 file changed
+2
-3
@@ -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) )
|
||||
|
||||