>>> On 13.02.15 at 17:33, <tamas.leng...@zentific.com> wrote:
> -int mem_paging_memop(struct domain *d, xen_mem_paging_op_t *mpo)
> +int mem_paging_memop(unsigned long cmd,
> +                     XEN_GUEST_HANDLE_PARAM(xen_mem_paging_op_t) arg)
>  {
> -    int rc = -ENODEV;
> +    int rc;
> +    xen_mem_paging_op_t mpo;
> +    struct domain *d;
> +
> +    rc = -EFAULT;
> +    if ( copy_from_guest(&mpo, arg, 1) )
> +        return rc;

Please don't make things more complicated than they need to be:
You only use the -EFAULT once here, so no reason to assign it to
rc up front.

> +
> +    rc = rcu_lock_live_remote_domain_by_id(mpo.domain, &d);
> +    if ( rc )
> +        return rc;
> +
> +    rc = xsm_vm_event_op(XSM_DM_PRIV, d, XENMEM_paging_op);
> +    if ( rc )

There's an RCU lock you take right before this, which you now fail
to drop here and below.

> +        return rc;
> +
> +    rc = -ENODEV;
>      if ( unlikely(!d->vm_event->paging.ring_page) )
>          return rc;

Same comment as for the -EFAULT above.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

Reply via email to