diff options
author | Machon Gregory <mbgrego@tycho.ncsc.mil> | 2011-04-07 15:20:32 +0100 |
---|---|---|
committer | Machon Gregory <mbgrego@tycho.ncsc.mil> | 2011-04-07 15:20:32 +0100 |
commit | 70fec5e93980d07618b8de66f29e5e03a97ac514 (patch) | |
tree | 9ede9dfbdc53fbbc79491d8a1a88dfe74572de3c | |
parent | 6de19d13bdc66f068d7b03896fe4850fcc693b83 (diff) | |
download | xen-70fec5e93980d07618b8de66f29e5e03a97ac514.tar.gz xen-70fec5e93980d07618b8de66f29e5e03a97ac514.tar.bz2 xen-70fec5e93980d07618b8de66f29e5e03a97ac514.zip |
xsm: Error code consistency
Signed-off-by: Machon Gregory <mbgrego@tycho.ncsc.mil>
xen-unstable changeset: 23140:967e1925775c
xen-unstable date: Mon Apr 04 15:54:45 2011 +0100
-rw-r--r-- | xen/include/xsm/xsm.h | 6 | ||||
-rw-r--r-- | xen/xsm/flask/flask_op.c | 3 |
2 files changed, 8 insertions, 1 deletions
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; |