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] Ensure that 64-bit get_user/put_user only transfer to

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Ensure that 64-bit get_user/put_user only transfer to
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 22 Aug 2005 09:50:13 +0000
Delivery-date: Mon, 22 Aug 2005 09:50:44 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Ensure that 64-bit get_user/put_user only transfer to, Xen patchbot -unstable <=