|
|
|
|
|
|
|
|
|
|
xen-devel
Re: [Xen-devel] [PATCH 3 of 7] xen: allows more hypercalls from stubdoms
Stefano Stabellini, le Tue 13 Oct 2009 15:24:31 +0100, a écrit :
>
> - if ( !IS_PRIV(current->domain) )
> - return -EPERM;
> -
> if ( copy_from_guest(op, u_domctl, 1) )
> return -EFAULT;
>
> if ( op->interface_version != XEN_DOMCTL_INTERFACE_VERSION )
> return -EACCES;
> +
> + switch ( op->cmd )
> + {
> + case XEN_DOMCTL_ioport_mapping:
> + case XEN_DOMCTL_memory_mapping:
> + case XEN_DOMCTL_bind_pt_irq:
> + case XEN_DOMCTL_unbind_pt_irq:
> + case XEN_DOMCTL_assign_device:
> + case XEN_DOMCTL_deassign_device:
> +#ifdef PRIVILEGED_STUBDOMS
> + {
> + struct domain *d = get_domain_by_id(op->domain);
> + if ( !IS_PRIV_FOR(current->domain, d) )
> + {
> + put_domain(d);
> + return -EPERM;
> + }
> + put_domain(d);
> + }
> + break;
> +#endif
> + default:
> + if ( !IS_PRIV(current->domain) )
> + return -EPERM;
> + break;
> + }
> +
>
> if ( !domctl_lock_acquire() )
The cases should be inside the #ifdef, or there should be a #else.
Samuel
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
<Prev in Thread] |
Current Thread |
[Next in Thread>
|
- Re: [Xen-devel] [PATCH 3 of 7] xen: allows more hypercalls from stubdoms, (continued)
- Re: [Xen-devel] [PATCH 3 of 7] xen: allows more hypercalls from stubdoms, Keir Fraser
- Re: [Xen-devel] [PATCH 3 of 7] xen: allows more hypercalls from stubdoms, Samuel Thibault
- Re: [Xen-devel] [PATCH 3 of 7] xen: allows more hypercalls from stubdoms, Stefano Stabellini
- Re: [Xen-devel] [PATCH 3 of 7] xen: allows more hypercalls from stubdoms,
Samuel Thibault <=
- Re: [Xen-devel] [PATCH 3 of 7] xen: allows more hypercalls from stubdoms, Stefano Stabellini
- Re: [Xen-devel] [PATCH 3 of 7] xen: allows more hypercalls from stubdoms, Samuel Thibault
- Re: [Xen-devel] [PATCH 3 of 7] xen: allows more hypercalls from stubdoms, Samuel Thibault
- Re: [Xen-devel] [PATCH 3 of 7] xen: allows more hypercalls from stubdoms, Keir Fraser
- Re: [Xen-devel] [PATCH 3 of 7] xen: allows more hypercalls from stubdoms, Keir Fraser
|
|
|
|
|