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

[Xen-devel] pin ctxt in xc_domain_getfullinfo


  • To: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
  • From: Kip Macy <kip.macy@xxxxxxxxx>
  • Date: Fri, 22 Apr 2005 13:49:07 -0700
  • Delivery-date: Fri, 22 Apr 2005 20:48:54 +0000
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=NqgkQtvFeePa4xyPJfJvuJNX20Pd/6z/WVI2NDJGpsEXTPis1D5mbCBdHb6NNU4DwMVBbuP0Ifbhkrac1BmSfJaU/IweFR95f/XjoxnEH4an3I3iABTAT7d0sEOtsTlbNtLubooQYq3gdylYB41Fq/Hf6ihtfexEK+dZVtVi818=
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2005/04/22 13:45:41-07:00 kmacy@xxxxxxxxxxxxxxxxxxxx 
#   mlock ctxt in xc_domain_getfullinfo
#   this is the most general solution to the recent problem seen in xc_ptrace
#   Signed-off-by: Kip Macy <kmacy@xxxxxxxxxxx>
# 
# tools/libxc/xc_domain.c
#   2005/04/22 13:45:38-07:00 kmacy@xxxxxxxxxxxxxxxxxxxx +7 -0
#   mlock ctxt in xc_domain_getfullinfo
# 
diff -Nru a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
--- a/tools/libxc/xc_domain.c   2005-04-21 13:52:32 -07:00
+++ b/tools/libxc/xc_domain.c   2005-04-21 13:52:32 -07:00
@@ -134,7 +134,14 @@
     op.u.getdomaininfo.exec_domain = (u16)vcpu;
     op.u.getdomaininfo.ctxt = ctxt;
 
+    if ( ctxt ) 
+       if ( mlock(ctxt, sizeof(*ctxt)) != 0 )
+           return -1;
+
     rc = do_dom0_op(xc_handle, &op);
+    
+    if ( ctxt )
+       munlock(ctxt, sizeof(*ctxt));
 
     if ( info )
         memcpy(info, &op.u.getdomaininfo, sizeof(*info));

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


 


Rackspace

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