mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
sched/arinc653: check for guest data transfer failures
Coverity-ID: 1055121
Coverity-ID: 1055122
Coverity-ID: 1055123
Coverity-ID: 1055124
Signed-off-by: Matthew Daley <mattjd@gmail.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
master commit: 546ba2f170
master date: 2013-09-10 17:16:02 +0200
This commit is contained in:
1 parent
e36c0917dd
commit
8a10907615
1 file changed
+11
-2
@@ -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;
|
||||
}
|
||||
|
||||
|
||||