[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.