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

xen-devel

[Top] [All Lists]

[Xen-devel] [PATCH] linux: range-check hypercall index in privcmd

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] linux: range-check hypercall index in privcmd
From: "Jan Beulich" <jbeulich@xxxxxxxxxx>
Date: 2006年10月30日 14:14:14 +0100
Delivery-date: 2006年10月30日 05:12:52 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Otherwise, bugs in e.g. libxc may bring the kernel down.
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
Index: head-2006年10月16日/drivers/xen/privcmd/privcmd.c
===================================================================
--- head-2006年10月16日.orig/drivers/xen/privcmd/privcmd.c 2006年10月24日 
15:17:49.000000000 +0200
+++ head-2006年10月16日/drivers/xen/privcmd/privcmd.c 2006年10月24日 
15:19:40.000000000 +0200
@@ -53,6 +53,8 @@ static int privcmd_ioctl(struct inode *i
 return -EFAULT;
 
 #if defined(__i386__)
+ if (hypercall.op >= (PAGE_SIZE >> 5))
+ break;
 __asm__ __volatile__ (
 "pushl %%ebx; pushl %%ecx; pushl %%edx; "
 "pushl %%esi; pushl %%edi; "
@@ -69,21 +71,21 @@ static int privcmd_ioctl(struct inode *i
 "popl %%ecx; popl %%ebx"
 : "=a" (ret) : "0" (&hypercall) : "memory" );
 #elif defined (__x86_64__)
- {
+ if (hypercall.op < (PAGE_SIZE >> 5)) {
 long ign1, ign2, ign3;
 __asm__ __volatile__ (
 "movq %8,%%r10; movq %9,%%r8;"
- "shlq 5,ドル%%rax ;"
+ "shll 5,ドル%%eax ;"
 "addq $hypercall_page,%%rax ;"
 "call *%%rax"
 : "=a" (ret), "=D" (ign1),
 "=S" (ign2), "=d" (ign3)
- : "0" ((unsigned long)hypercall.op), 
- "1" ((unsigned long)hypercall.arg[0]), 
- "2" ((unsigned long)hypercall.arg[1]),
- "3" ((unsigned long)hypercall.arg[2]), 
- "g" ((unsigned long)hypercall.arg[3]),
- "g" ((unsigned long)hypercall.arg[4])
+ : "0" ((unsigned int)hypercall.op),
+ "1" (hypercall.arg[0]),
+ "2" (hypercall.arg[1]),
+ "3" (hypercall.arg[2]),
+ "g" (hypercall.arg[3]),
+ "g" (hypercall.arg[4])
 : "r8", "r10", "memory" );
 }
 #elif defined (__ia64__)
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] linux: range-check hypercall index in privcmd, Jan Beulich <=
Previous by Date: Re: [Xen-devel] [patch] Add support for barriers to blk{back,front} drivers. , Gerd Hoffmann
Next by Date: [Xen-devel] [PATCH] linux: use __initdata where possible , Jan Beulich
Previous by Thread: [Xen-devel] Is there a way to differentiate PV-on-HVM devices from qemu-dm devices? , He, Qing
Next by Thread: [Xen-devel] [PATCH] linux: use __initdata where possible , Jan Beulich
Indexes: [Date] [Thread] [Top] [All Lists]

Copyright ©, Citrix Systems Inc. All rights reserved. Legal and Privacy
Citrix This site is hosted by Citrix

AltStyle によって変換されたページ (->オリジナル) /