xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Daley <mattjd@gmail.com>
To: xen-devel@lists.xen.org
Cc: George Dunlap <george.dunlap@eu.citrix.com>,
	Matthew Daley <mattjd@gmail.com>
Subject: [PATCH 2/8] sched/arinc653: check for guest data transfer failures
Date: Wed, 11 Sep 2013 02:34:16 +1200	[thread overview]
Message-ID: <1378823662-20803-3-git-send-email-mattjd@gmail.com> (raw)
In-Reply-To: <1378823662-20803-1-git-send-email-mattjd@gmail.com>

Coverity-ID: 1055121
Coverity-ID: 1055122
Coverity-ID: 1055123
Coverity-ID: 1055124
Signed-off-by: Matthew Daley <mattjd@gmail.com>
---
 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;
     }
 
-- 
1.7.10.4

  parent reply	other threads:[~2013-09-10 14:34 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-10 14:34 [PATCH 0/8] Fixes for various minor Coverity issues Matthew Daley
2013-09-10 14:34 ` [PATCH 1/8] x86: add missing va_end to hypercall_xlat_continuation Matthew Daley
2013-09-10 14:41   ` Andrew Cooper
2013-09-10 15:02   ` Keir Fraser
2013-09-10 14:34 ` Matthew Daley [this message]
2013-09-10 14:43   ` [PATCH 2/8] sched/arinc653: check for guest data transfer failures Andrew Cooper
2013-09-10 14:50   ` George Dunlap
2013-09-10 17:35     ` Kathy Hadley
2013-09-10 19:45       ` Ian Campbell
2013-09-10 15:03   ` Keir Fraser
2013-09-10 14:34 ` [PATCH 3/8] libxl: fix use-after-free in discard_events iteration Matthew Daley
2013-09-10 14:45   ` Ian Jackson
2013-09-10 14:34 ` [PATCH 4/8] libxl: correctly handle readlink() errors Matthew Daley
2013-09-10 14:47   ` Ian Jackson
2013-09-10 14:34 ` [PATCH 5/8] mini-os: fix use-after-free in xs_daemon_close event iteration Matthew Daley
2013-09-10 14:37   ` Samuel Thibault
2013-09-10 14:34 ` [PATCH 6/8] mini-os: handle possibly overlong _nodename in init_consfront Matthew Daley
2013-09-10 14:38   ` Samuel Thibault
2013-09-10 14:34 ` [PATCH 7/8] kdd: fix free of array-typed value Matthew Daley
2013-09-10 14:41   ` Tim Deegan
2013-09-10 14:46   ` Andrew Cooper
2013-09-10 14:34 ` [PATCH 8/8] xenstored: fix possible, but unlikely, stack overflow Matthew Daley
2013-09-10 14:48   ` Andrew Cooper
2013-09-10 14:48   ` Ian Jackson
2013-09-13 12:31 ` [PATCH 0/8] Fixes for various minor Coverity issues Ian Campbell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1378823662-20803-3-git-send-email-mattjd@gmail.com \
    --to=mattjd@gmail.com \
    --cc=george.dunlap@eu.citrix.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).