From mboxrd@z Thu Jan 1 00:00:00 1970 From: Machon Gregory Subject: [PATCH] xsm: Error code consistency Date: Mon, 04 Apr 2011 10:26:01 -0400 Message-ID: <4D99D4F9.8060703@tycho.ncsc.mil> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------060107010005090502000704" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --------------060107010005090502000704 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Changes to support consistency of error codes within XSM and Flask XSM functions. include/xsm/xsm.h | 6 +++++- xsm/flask/flask_op.c | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) Signed-off-by:mbgrego@tycho.ncsc.mil -- Machon Gregory National Information Assurance Research Lab (NIARL) --------------060107010005090502000704 Content-Type: text/plain; name="xsm_error_code_consistency.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="xsm_error_code_consistency.patch" diff -r 9dd91e9691a2 xen/include/xsm/xsm.h --- a/xen/include/xsm/xsm.h Sat Apr 02 15:58:54 2011 +0100 +++ b/xen/include/xsm/xsm.h Mon Apr 04 09:19:26 2011 -0400 @@ -427,7 +427,11 @@ 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 -r 9dd91e9691a2 xen/xsm/flask/flask_op.c --- a/xen/xsm/flask/flask_op.c Sat Apr 02 15:58:54 2011 +0100 +++ b/xen/xsm/flask/flask_op.c Mon Apr 04 09:19:26 2011 -0400 @@ -485,6 +485,9 @@ if ( length < 0 ) goto out; + if (len > count) + return -ERANGE; + memset(buf, 0, count); memcpy(buf, context, len); length = len; --------------060107010005090502000704 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --------------060107010005090502000704--