WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] [XEN] Change microcode_update function in

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [XEN] Change microcode_update function interface inside Xen.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 06 Oct 2006 12:30:22 +0000
Delivery-date: Fri, 06 Oct 2006 05:31:51 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Node ID 609b10b17bf005cc70ae331a46385bf7ad25845c
# Parent  eee52c100996efd39fb3f9bc7b43c75808927f2a
[XEN] Change microcode_update function interface inside Xen.

Confine the knowledge that the buffer gets accessed without use of
proper guest handle accessors to a single file.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
---
 xen/arch/x86/microcode.c          |   11 ++++++++---
 xen/arch/x86/platform_hypercall.c |    4 ++--
 2 files changed, 10 insertions(+), 5 deletions(-)

diff -r eee52c100996 -r 609b10b17bf0 xen/arch/x86/microcode.c
--- a/xen/arch/x86/microcode.c  Thu Oct 05 16:36:39 2006 +0100
+++ b/xen/arch/x86/microcode.c  Thu Oct 05 16:38:30 2006 +0100
@@ -455,7 +455,7 @@ out:
        return error;
 }
 
-int microcode_update(void *buf, unsigned long len)
+int microcode_update(XEN_GUEST_HANDLE(void) buf, unsigned long len)
 {
        int ret;
 
@@ -464,10 +464,15 @@ int microcode_update(void *buf, unsigned
                return -EINVAL;
        }
 
+       if (len != (typeof(user_buffer_size))len) {
+               printk(KERN_ERR "microcode: too much data\n");
+               return -E2BIG;
+       }
+
        mutex_lock(&microcode_mutex);
 
-       user_buffer = (void __user *) buf;
-       user_buffer_size = (int) len;
+       user_buffer = buf.p;
+       user_buffer_size = len;
 
        ret = do_microcode_update();
 
diff -r eee52c100996 -r 609b10b17bf0 xen/arch/x86/platform_hypercall.c
--- a/xen/arch/x86/platform_hypercall.c Thu Oct 05 16:36:39 2006 +0100
+++ b/xen/arch/x86/platform_hypercall.c Thu Oct 05 16:38:30 2006 +0100
@@ -104,8 +104,8 @@ long do_platform_op(XEN_GUEST_HANDLE(xen
 
     case XENPF_microcode_update:
     {
-        extern int microcode_update(void *buf, unsigned long len);
-        ret = microcode_update(op->u.microcode.data.p,
+        extern int microcode_update(XEN_GUEST_HANDLE(void), unsigned long len);
+        ret = microcode_update(op->u.microcode.data,
                                op->u.microcode.length);
     }
     break;

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] [XEN] Change microcode_update function interface inside Xen., Xen patchbot-unstable <=