From: Machon Gregory Date: Mon, 4 Apr 2011 14:54:45 +0000 (+0100) Subject: xsm: Error code consistency X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=2bbb3d0fe9149b302b42c98cffe3fbf1aa286548;p=xen.git xsm: Error code consistency Signed-off-by: Machon Gregory --- diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h index a91b35dd12..c132ea6ef8 100644 --- a/xen/include/xsm/xsm.h +++ b/xen/include/xsm/xsm.h @@ -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 diff --git a/xen/xsm/flask/flask_op.c b/xen/xsm/flask/flask_op.c index 3c66d03e6a..265a3cf3ac 100644 --- a/xen/xsm/flask/flask_op.c +++ b/xen/xsm/flask/flask_op.c @@ -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;