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-changelog

[Xen-changelog] xc_domain.c:

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] xc_domain.c:
From: BitKeeper Bot <riel@xxxxxxxxxxx>
Date: Sat, 23 Apr 2005 11:04:40 +0000
Delivery-date: Sat, 23 Apr 2005 12:02:43 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: Xen Development List <xen-devel@xxxxxxxxxxxxxxxxxxx>
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
ChangeSet 1.1373, 2005/04/23 12:04:40+01:00, kaf24@xxxxxxxxxxxxxxxxxxxx

        xc_domain.c:
          Ensure ctxt is mlocked in xc_domain_getfullinfo.



 xc_domain.c |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)


diff -Nru a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
--- a/tools/libxc/xc_domain.c   2005-04-23 08:03:03 -04:00
+++ b/tools/libxc/xc_domain.c   2005-04-23 08:03:03 -04:00
@@ -146,7 +146,7 @@
                           xc_domaininfo_t *info,
                           full_execution_context_t *ctxt)
 {
-    int rc;
+    int rc, errno_saved;
     dom0_op_t op;
 
     op.cmd = DOM0_GETDOMAININFO;
@@ -154,12 +154,23 @@
     op.u.getdomaininfo.exec_domain = (u16)vcpu;
     op.u.getdomaininfo.ctxt = ctxt;
 
+    if ( (ctxt != NULL) &&
+         ((rc = mlock(ctxt, sizeof(*ctxt))) != 0) )
+        return rc;
+
     rc = do_dom0_op(xc_handle, &op);
 
-    if ( info )
+    if ( ctxt != NULL )
+    {
+        errno_saved = errno;
+        (void)munlock(ctxt, sizeof(*ctxt));
+        errno = errno_saved;
+    }
+
+    if ( info != NULL )
         memcpy(info, &op.u.getdomaininfo, sizeof(*info));
 
-    if ( ((u16)op.u.getdomaininfo.domain != domid) && rc > 0 )
+    if ( ((u16)op.u.getdomaininfo.domain != domid) && (rc > 0) )
         return -ESRCH;
     else
         return rc;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] xc_domain.c:, BitKeeper Bot <=