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

Re: [Xen-devel] [PATCH 2/8] sched/arinc653: check for guest data transfer failures


  • To: Matthew Daley <mattjd@xxxxxxxxx>, <xen-devel@xxxxxxxxxxxxx>
  • From: Keir Fraser <keir.xen@xxxxxxxxx>
  • Date: Tue, 10 Sep 2013 08:03:01 -0700
  • Cc: George Dunlap <george.dunlap@xxxxxxxxxxxxx>
  • Delivery-date: Tue, 10 Sep 2013 15:03:16 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>
  • Thread-index: Ac6uNtepzO9v5yVfYUCdsfUCvmIe/w==
  • Thread-topic: [Xen-devel] [PATCH 2/8] sched/arinc653: check for guest data transfer failures

On 10/09/2013 07:34, "Matthew Daley" <mattjd@xxxxxxxxx> wrote:

> Coverity-ID: 1055121
> Coverity-ID: 1055122
> Coverity-ID: 1055123
> Coverity-ID: 1055124
> Signed-off-by: Matthew Daley <mattjd@xxxxxxxxx>

Acked-by: Keir Fraser <keir@xxxxxxx>

> ---
>  xen/common/sched_arinc653.c |   13 +++++++++++--
>  1 file changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/xen/common/sched_arinc653.c b/xen/common/sched_arinc653.c
> index 63ddb82..2502192 100644
> --- a/xen/common/sched_arinc653.c
> +++ b/xen/common/sched_arinc653.c
> @@ -635,12 +635,21 @@ a653sched_adjust_global(const struct scheduler *ops,
>      switch ( sc->cmd )
>      {
>      case XEN_SYSCTL_SCHEDOP_putinfo:
> -        copy_from_guest(&local_sched, sc->u.sched_arinc653.schedule, 1);
> +        if ( copy_from_guest(&local_sched, sc->u.sched_arinc653.schedule, 1)
> )
> +        {
> +            rc = -EFAULT;
> +            break;
> +        }
> +
>          rc = arinc653_sched_set(ops, &local_sched);
>          break;
>      case XEN_SYSCTL_SCHEDOP_getinfo:
>          rc = arinc653_sched_get(ops, &local_sched);
> -        copy_to_guest(sc->u.sched_arinc653.schedule, &local_sched, 1);
> +        if ( rc )
> +            break;
> +
> +        if ( copy_to_guest(sc->u.sched_arinc653.schedule, &local_sched, 1) )
> +            rc = -EFAULT;
>          break;
>      }
>  



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


 


Rackspace

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