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] Fix __get_user() and friends to work correctly for

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Fix __get_user() and friends to work correctly for
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 18 Aug 2005 13:04:11 -0400
Delivery-date: Thu, 18 Aug 2005 17:04:42 +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 082a537ff4dec66574788126b3b047ef76e59803
# Parent  684d8193344209f3bbce4b07977f9d51ec48f63e
Fix __get_user() and friends to work correctly for
64-bit quantities on x86/32. Should fix writable
pagetables on PAE.

Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>

diff -r 684d81933442 -r 082a537ff4de xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c Thu Aug 18 16:04:00 2005
+++ b/xen/arch/x86/mm.c Thu Aug 18 17:04:48 2005
@@ -3299,8 +3299,8 @@
     
     /* Finally, make the p.t. page writable by the guest OS. */
     l1e_add_flags(pte, _PAGE_RW);
-    if ( unlikely(__copy_to_user(&linear_pg_table[l1_linear_offset(addr)],
-                                 &pte, sizeof(pte))) )
+    if ( unlikely(__put_user(pte.l1,
+                             &linear_pg_table[l1_linear_offset(addr)].l1)) )
     {
         MEM_LOG("ptwr: Could not update pte at %p", (unsigned long *)
                 &linear_pg_table[l1_linear_offset(addr)]);
diff -r 684d81933442 -r 082a537ff4de xen/include/asm-x86/uaccess.h
--- a/xen/include/asm-x86/uaccess.h     Thu Aug 18 16:04:00 2005
+++ b/xen/include/asm-x86/uaccess.h     Thu Aug 18 17:04:48 2005
@@ -125,22 +125,20 @@
        __pu_err;                                                       \
 })                                                     
 
-#define __get_user_nocheck(x,ptr,size)                         \
-({                                                             \
-       long __gu_err, __gu_val;                                \
-       __get_user_size(__gu_val,(ptr),(size),__gu_err,-EFAULT);\
-       (x) = (__typeof__(*(ptr)))__gu_val;                     \
-       __gu_err;                                               \
+#define __get_user_nocheck(x,ptr,size)                          \
+({                                                              \
+       long __gu_err;                                          \
+       __get_user_size((x),(ptr),(size),__gu_err,-EFAULT);     \
+       __gu_err;                                               \
 })
 
-#define __get_user_check(x,ptr,size)                                   \
-({                                                                     \
-       long __gu_err, __gu_val;                                        \
-       __typeof__(*(ptr)) __user *__gu_addr = (ptr);                   \
-       __get_user_size(__gu_val,__gu_addr,(size),__gu_err,-EFAULT);    \
-       (x) = (__typeof__(*(ptr)))__gu_val;                             \
-       if (!__addr_ok(__gu_addr)) __gu_err = -EFAULT;                  \
-       __gu_err;                                                       \
+#define __get_user_check(x,ptr,size)                            \
+({                                                              \
+       long __gu_err;                                          \
+       __typeof__(*(ptr)) __user *__gu_addr = (ptr);           \
+       __get_user_size((x),__gu_addr,(size),__gu_err,-EFAULT); \
+       if (!__addr_ok(__gu_addr)) __gu_err = -EFAULT;          \
+       __gu_err;                                               \
 })                                                     
 
 struct __large_struct { unsigned long buf[100]; };

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Fix __get_user() and friends to work correctly for, Xen patchbot -unstable <=