]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/xen.git/commitdiff
xsm: Error code consistency
authorMachon Gregory <mbgrego@tycho.ncsc.mil>
Mon, 4 Apr 2011 14:54:45 +0000 (15:54 +0100)
committerMachon Gregory <mbgrego@tycho.ncsc.mil>
Mon, 4 Apr 2011 14:54:45 +0000 (15:54 +0100)
Signed-off-by: Machon Gregory <mbgrego@tycho.ncsc.mil>
xen/include/xsm/xsm.h
xen/xsm/flask/flask_op.c

index a91b35dd12fbd4b8337fdc6ba0f9eb9fc09642f5..c132ea6ef8ab897015a1abbcecb057030a4c3a3b 100644 (file)
@@ -427,7 +427,11 @@ static inline int xsm_remove_range (struct domain *d, char *name, unsigned long
 
 static inline long __do_xsm_op (XEN_GUEST_HANDLE(xsm_op_t) op)
 {
-    return xsm_call(__do_xsm_op(op));
+#ifdef XSM_ENABLE
+    return xsm_ops->__do_xsm_op(op);
+#else
+    return -ENOSYS;
+#endif
 }
 
 #ifdef XSM_ENABLE
index 3c66d03e6aadc11d05728be49615c0f60620984c..265a3cf3ac4be099d3fee6b545c1c744c9fe3d58 100644 (file)
@@ -485,6 +485,9 @@ static int flask_security_sid(char *buf, uint32_t count)
     if ( length < 0 )
         goto out;
 
+    if ( len > count )
+        return -ERANGE; 
+
     memset(buf, 0, count);
     memcpy(buf, context, len);
     length = len;