[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] Ensure that 64-bit get_user/put_user only transfer to
# HG changeset patch # User kaf24@xxxxxxxxxxxxxxxxxxxx # Node ID 21d2b0144306720d5a2e33d435031672187656ab # Parent f6aa23148c193b5fe3f0886ac1b3fb026f73dac7 Ensure that 64-bit get_user/put_user only transfer to a 64-bit local variable. Some gcc versions have bugs if this restriction isn't observed. Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx> diff -r f6aa23148c19 -r 21d2b0144306 xen/include/asm-x86/x86_32/uaccess.h --- a/xen/include/asm-x86/x86_32/uaccess.h Mon Aug 22 09:43:58 2005 +++ b/xen/include/asm-x86/x86_32/uaccess.h Mon Aug 22 09:52:06 2005 @@ -22,7 +22,11 @@ #define array_access_ok(addr,count,size) \ (likely(count < (~0UL/size)) && access_ok(addr,count*size)) +/* Undefined function to catch size mismatches on 64-bit get_user/put_user. */ +extern void __uaccess_var_not_u64(void); + #define __put_user_u64(x, addr, retval, errret) \ + if (sizeof(x) != 8) __uaccess_var_not_u64(); \ __asm__ __volatile__( \ "1: movl %%eax,0(%2)\n" \ "2: movl %%edx,4(%2)\n" \ @@ -52,6 +56,7 @@ } while (0) #define __get_user_u64(x, addr, retval, errret) \ + if (sizeof(x) != 8) __uaccess_var_not_u64(); \ __asm__ __volatile__( \ "1: movl 0(%2),%%eax\n" \ "2: movl 4(%2),%%edx\n" \ _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |