diff options
author | Christoph Lameter <clameter@sgi.com> | 2006-06-23 05:03:57 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-23 10:42:53 -0400 |
commit | 9216dfad4fc97ab639ef0885efc713f3d7a20d5b (patch) | |
tree | 546e301f3181f56133509327f9c5ed035dd4b50d /kernel/compat.c | |
parent | 1b2db9fb7adc4d67d9ce7d16ce79c41ee84730fe (diff) |
[PATCH] move_pages: fix 32 -> 64 bit compat function
The definition of the third parameter is a pointer to an array of virtual
addresses which give us some trouble. The existing code calculated the
wrong address in the array since I used void to avoid having to specify a
type.
I now use the correct type "compat_uptr_t __user *" in the definition of
the function in kernel/compat.c.
However, I used __u32 in syscalls.h. Would have to include compat.h there
in order to provide the same definition which would generate an ugly
include situation.
On both ia64 and x86_64 compat_uptr_t is u32. So this works although
parameter declarations differ.
Signed-off-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/compat.c')
-rw-r--r-- | kernel/compat.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/compat.c b/kernel/compat.c index ccea93e28954..2f672332430f 100644 --- a/kernel/compat.c +++ b/kernel/compat.c | |||
@@ -938,7 +938,7 @@ asmlinkage long compat_sys_adjtimex(struct compat_timex __user *utp) | |||
938 | 938 | ||
939 | #ifdef CONFIG_NUMA | 939 | #ifdef CONFIG_NUMA |
940 | asmlinkage long compat_sys_move_pages(pid_t pid, unsigned long nr_pages, | 940 | asmlinkage long compat_sys_move_pages(pid_t pid, unsigned long nr_pages, |
941 | void __user *pages32, | 941 | compat_uptr_t __user *pages32, |
942 | const int __user *nodes, | 942 | const int __user *nodes, |
943 | int __user *status, | 943 | int __user *status, |
944 | int flags) | 944 | int flags) |
@@ -950,7 +950,7 @@ asmlinkage long compat_sys_move_pages(pid_t pid, unsigned long nr_pages, | |||
950 | for (i = 0; i < nr_pages; i++) { | 950 | for (i = 0; i < nr_pages; i++) { |
951 | compat_uptr_t p; | 951 | compat_uptr_t p; |
952 | 952 | ||
953 | if (get_user(p, (compat_uptr_t *)(pages32 + i)) || | 953 | if (get_user(p, pages32 + i) || |
954 | put_user(compat_ptr(p), pages + i)) | 954 | put_user(compat_ptr(p), pages + i)) |
955 | return -EFAULT; | 955 | return -EFAULT; |
956 | } | 956 | } |