diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2014-03-04 11:18:23 -0500 |
---|---|---|
committer | Heiko Carstens <heiko.carstens@de.ibm.com> | 2014-03-06 10:30:47 -0500 |
commit | 2f2728f6de9837abe4b354443a45be578fbbf942 (patch) | |
tree | 6305f0c201998040ee05d21fc178849c65e430e7 | |
parent | ca2c405ab90591dcb1bc3765467cbdf2b99a0f6a (diff) |
mm/compat: convert to COMPAT_SYSCALL_DEFINE with changing parameter types
In order to allow the COMPAT_SYSCALL_DEFINE macro generate code that
performs proper zero and sign extension convert all 64 bit parameters
to their corresponding 32 bit compat counterparts.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
-rw-r--r-- | include/linux/compat.h | 10 | ||||
-rw-r--r-- | kernel/compat.c | 10 | ||||
-rw-r--r-- | mm/process_vm_access.c | 26 |
3 files changed, 22 insertions, 24 deletions
diff --git a/include/linux/compat.h b/include/linux/compat.h index ef4834c5bcab..7c765624b7ef 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h | |||
@@ -469,7 +469,7 @@ asmlinkage long compat_sys_timerfd_settime(int ufd, int flags, | |||
469 | asmlinkage long compat_sys_timerfd_gettime(int ufd, | 469 | asmlinkage long compat_sys_timerfd_gettime(int ufd, |
470 | struct compat_itimerspec __user *otmr); | 470 | struct compat_itimerspec __user *otmr); |
471 | 471 | ||
472 | asmlinkage long compat_sys_move_pages(pid_t pid, unsigned long nr_page, | 472 | asmlinkage long compat_sys_move_pages(pid_t pid, compat_ulong_t nr_pages, |
473 | __u32 __user *pages, | 473 | __u32 __user *pages, |
474 | const int __user *nodes, | 474 | const int __user *nodes, |
475 | int __user *status, | 475 | int __user *status, |
@@ -674,12 +674,12 @@ extern void __user *compat_alloc_user_space(unsigned long len); | |||
674 | 674 | ||
675 | asmlinkage ssize_t compat_sys_process_vm_readv(compat_pid_t pid, | 675 | asmlinkage ssize_t compat_sys_process_vm_readv(compat_pid_t pid, |
676 | const struct compat_iovec __user *lvec, | 676 | const struct compat_iovec __user *lvec, |
677 | unsigned long liovcnt, const struct compat_iovec __user *rvec, | 677 | compat_ulong_t liovcnt, const struct compat_iovec __user *rvec, |
678 | unsigned long riovcnt, unsigned long flags); | 678 | compat_ulong_t riovcnt, compat_ulong_t flags); |
679 | asmlinkage ssize_t compat_sys_process_vm_writev(compat_pid_t pid, | 679 | asmlinkage ssize_t compat_sys_process_vm_writev(compat_pid_t pid, |
680 | const struct compat_iovec __user *lvec, | 680 | const struct compat_iovec __user *lvec, |
681 | unsigned long liovcnt, const struct compat_iovec __user *rvec, | 681 | compat_ulong_t liovcnt, const struct compat_iovec __user *rvec, |
682 | unsigned long riovcnt, unsigned long flags); | 682 | compat_ulong_t riovcnt, compat_ulong_t flags); |
683 | 683 | ||
684 | asmlinkage long compat_sys_sendfile(int out_fd, int in_fd, | 684 | asmlinkage long compat_sys_sendfile(int out_fd, int in_fd, |
685 | compat_off_t __user *offset, compat_size_t count); | 685 | compat_off_t __user *offset, compat_size_t count); |
diff --git a/kernel/compat.c b/kernel/compat.c index 2622011a44c9..488ff8c4cf48 100644 --- a/kernel/compat.c +++ b/kernel/compat.c | |||
@@ -1065,11 +1065,11 @@ COMPAT_SYSCALL_DEFINE1(adjtimex, struct compat_timex __user *, utp) | |||
1065 | } | 1065 | } |
1066 | 1066 | ||
1067 | #ifdef CONFIG_NUMA | 1067 | #ifdef CONFIG_NUMA |
1068 | asmlinkage long compat_sys_move_pages(pid_t pid, unsigned long nr_pages, | 1068 | COMPAT_SYSCALL_DEFINE6(move_pages, pid_t, pid, compat_ulong_t, nr_pages, |
1069 | compat_uptr_t __user *pages32, | 1069 | compat_uptr_t __user *, pages32, |
1070 | const int __user *nodes, | 1070 | const int __user *, nodes, |
1071 | int __user *status, | 1071 | int __user *, status, |
1072 | int flags) | 1072 | int, flags) |
1073 | { | 1073 | { |
1074 | const void __user * __user *pages; | 1074 | const void __user * __user *pages; |
1075 | int i; | 1075 | int i; |
diff --git a/mm/process_vm_access.c b/mm/process_vm_access.c index fd26d0433509..3c5cf68566ec 100644 --- a/mm/process_vm_access.c +++ b/mm/process_vm_access.c | |||
@@ -456,25 +456,23 @@ free_iovecs: | |||
456 | return rc; | 456 | return rc; |
457 | } | 457 | } |
458 | 458 | ||
459 | asmlinkage ssize_t | 459 | COMPAT_SYSCALL_DEFINE6(process_vm_readv, compat_pid_t, pid, |
460 | compat_sys_process_vm_readv(compat_pid_t pid, | 460 | const struct compat_iovec __user *, lvec, |
461 | const struct compat_iovec __user *lvec, | 461 | compat_ulong_t, liovcnt, |
462 | unsigned long liovcnt, | 462 | const struct compat_iovec __user *, rvec, |
463 | const struct compat_iovec __user *rvec, | 463 | compat_ulong_t, riovcnt, |
464 | unsigned long riovcnt, | 464 | compat_ulong_t, flags) |
465 | unsigned long flags) | ||
466 | { | 465 | { |
467 | return compat_process_vm_rw(pid, lvec, liovcnt, rvec, | 466 | return compat_process_vm_rw(pid, lvec, liovcnt, rvec, |
468 | riovcnt, flags, 0); | 467 | riovcnt, flags, 0); |
469 | } | 468 | } |
470 | 469 | ||
471 | asmlinkage ssize_t | 470 | COMPAT_SYSCALL_DEFINE6(process_vm_writev, compat_pid_t, pid, |
472 | compat_sys_process_vm_writev(compat_pid_t pid, | 471 | const struct compat_iovec __user *, lvec, |
473 | const struct compat_iovec __user *lvec, | 472 | compat_ulong_t, liovcnt, |
474 | unsigned long liovcnt, | 473 | const struct compat_iovec __user *, rvec, |
475 | const struct compat_iovec __user *rvec, | 474 | compat_ulong_t, riovcnt, |
476 | unsigned long riovcnt, | 475 | compat_ulong_t, flags) |
477 | unsigned long flags) | ||
478 | { | 476 | { |
479 | return compat_process_vm_rw(pid, lvec, liovcnt, rvec, | 477 | return compat_process_vm_rw(pid, lvec, liovcnt, rvec, |
480 | riovcnt, flags, 1); | 478 | riovcnt, flags, 1); |