WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH 3 of 7] xen: allows more hypercalls from stubdoms

To: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH 3 of 7] xen: allows more hypercalls from stubdoms
From: Samuel Thibault <samuel.thibault@xxxxxxxxxxxx>
Date: Tue, 13 Oct 2009 16:36:37 +0200
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, Keir Fraser <Keir.Fraser@xxxxxxxxxxxxx>
Delivery-date: Tue, 13 Oct 2009 07:37:01 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <alpine.DEB.2.00.0910131523091.22447@kaball-desktop>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Mail-followup-to: Samuel Thibault <samuel.thibault@xxxxxxxxxxxx>, Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>, Keir Fraser <Keir.Fraser@xxxxxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
References: <C6FA31F0.1749D%keir.fraser@xxxxxxxxxxxxx> <alpine.DEB.2.00.0910131523091.22447@kaball-desktop>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.12-2006-07-14
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>