diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-05-01 10:21:43 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-05-01 10:21:43 -0400 |
commit | 08d76760832993050ad8c25e63b56773ef2ca303 (patch) | |
tree | abdcf148dfe43cd49f30f204f1dac6978107a508 /kernel | |
parent | 5f56886521d6ddd3648777fae44d82382dd8c87f (diff) | |
parent | 99e621f796d7f0341a51e8cdf32b81663b10b448 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal
Pull compat cleanup from Al Viro:
"Mostly about syscall wrappers this time; there will be another pile
with patches in the same general area from various people, but I'd
rather push those after both that and vfs.git pile are in."
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal:
syscalls.h: slightly reduce the jungles of macros
get rid of union semop in sys_semctl(2) arguments
make do_mremap() static
sparc: no need to sign-extend in sync_file_range() wrapper
ppc compat wrappers for add_key(2) and request_key(2) are pointless
x86: trim sys_ia32.h
x86: sys32_kill and sys32_mprotect are pointless
get rid of compat_sys_semctl() and friends in case of ARCH_WANT_OLD_COMPAT_IPC
merge compat sys_ipc instances
consolidate compat lookup_dcookie()
convert vmsplice to COMPAT_SYSCALL_DEFINE
switch getrusage() to COMPAT_SYSCALL_DEFINE
switch epoll_pwait to COMPAT_SYSCALL_DEFINE
convert sendfile{,64} to COMPAT_SYSCALL_DEFINE
switch signalfd{,4}() to COMPAT_SYSCALL_DEFINE
make SYSCALL_DEFINE<n>-generated wrappers do asmlinkage_protect
make HAVE_SYSCALL_WRAPPERS unconditional
consolidate cond_syscall and SYSCALL_ALIAS declarations
teach SYSCALL_DEFINE<n> how to deal with long long/unsigned long long
get rid of duplicate logics in __SC_....[1-6] definitions
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/compat.c | 19 | ||||
-rw-r--r-- | kernel/exit.c | 5 | ||||
-rw-r--r-- | kernel/fork.c | 5 | ||||
-rw-r--r-- | kernel/sys.c | 14 | ||||
-rw-r--r-- | kernel/sys_ni.c | 3 | ||||
-rw-r--r-- | kernel/uid16.c | 55 |
6 files changed, 28 insertions, 73 deletions
diff --git a/kernel/compat.c b/kernel/compat.c index 1e8f1455117a..0a09e481b70b 100644 --- a/kernel/compat.c +++ b/kernel/compat.c | |||
@@ -516,25 +516,6 @@ int put_compat_rusage(const struct rusage *r, struct compat_rusage __user *ru) | |||
516 | return 0; | 516 | return 0; |
517 | } | 517 | } |
518 | 518 | ||
519 | asmlinkage long compat_sys_getrusage(int who, struct compat_rusage __user *ru) | ||
520 | { | ||
521 | struct rusage r; | ||
522 | int ret; | ||
523 | mm_segment_t old_fs = get_fs(); | ||
524 | |||
525 | set_fs(KERNEL_DS); | ||
526 | ret = sys_getrusage(who, (struct rusage __user *) &r); | ||
527 | set_fs(old_fs); | ||
528 | |||
529 | if (ret) | ||
530 | return ret; | ||
531 | |||
532 | if (put_compat_rusage(&r, ru)) | ||
533 | return -EFAULT; | ||
534 | |||
535 | return 0; | ||
536 | } | ||
537 | |||
538 | COMPAT_SYSCALL_DEFINE4(wait4, | 519 | COMPAT_SYSCALL_DEFINE4(wait4, |
539 | compat_pid_t, pid, | 520 | compat_pid_t, pid, |
540 | compat_uint_t __user *, stat_addr, | 521 | compat_uint_t __user *, stat_addr, |
diff --git a/kernel/exit.c b/kernel/exit.c index 60bc027c61c3..6e3151ec900f 100644 --- a/kernel/exit.c +++ b/kernel/exit.c | |||
@@ -1629,9 +1629,6 @@ SYSCALL_DEFINE5(waitid, int, which, pid_t, upid, struct siginfo __user *, | |||
1629 | } | 1629 | } |
1630 | 1630 | ||
1631 | put_pid(pid); | 1631 | put_pid(pid); |
1632 | |||
1633 | /* avoid REGPARM breakage on x86: */ | ||
1634 | asmlinkage_protect(5, ret, which, upid, infop, options, ru); | ||
1635 | return ret; | 1632 | return ret; |
1636 | } | 1633 | } |
1637 | 1634 | ||
@@ -1669,8 +1666,6 @@ SYSCALL_DEFINE4(wait4, pid_t, upid, int __user *, stat_addr, | |||
1669 | ret = do_wait(&wo); | 1666 | ret = do_wait(&wo); |
1670 | put_pid(pid); | 1667 | put_pid(pid); |
1671 | 1668 | ||
1672 | /* avoid REGPARM breakage on x86: */ | ||
1673 | asmlinkage_protect(4, ret, upid, stat_addr, options, ru); | ||
1674 | return ret; | 1669 | return ret; |
1675 | } | 1670 | } |
1676 | 1671 | ||
diff --git a/kernel/fork.c b/kernel/fork.c index 339f60dfd62b..7d40687b1434 100644 --- a/kernel/fork.c +++ b/kernel/fork.c | |||
@@ -1677,10 +1677,7 @@ SYSCALL_DEFINE5(clone, unsigned long, clone_flags, unsigned long, newsp, | |||
1677 | int, tls_val) | 1677 | int, tls_val) |
1678 | #endif | 1678 | #endif |
1679 | { | 1679 | { |
1680 | long ret = do_fork(clone_flags, newsp, 0, parent_tidptr, child_tidptr); | 1680 | return do_fork(clone_flags, newsp, 0, parent_tidptr, child_tidptr); |
1681 | asmlinkage_protect(5, ret, clone_flags, newsp, | ||
1682 | parent_tidptr, child_tidptr, tls_val); | ||
1683 | return ret; | ||
1684 | } | 1681 | } |
1685 | #endif | 1682 | #endif |
1686 | 1683 | ||
diff --git a/kernel/sys.c b/kernel/sys.c index afd0f7e125c9..b95d3c72ba21 100644 --- a/kernel/sys.c +++ b/kernel/sys.c | |||
@@ -1851,6 +1851,20 @@ SYSCALL_DEFINE2(getrusage, int, who, struct rusage __user *, ru) | |||
1851 | return getrusage(current, who, ru); | 1851 | return getrusage(current, who, ru); |
1852 | } | 1852 | } |
1853 | 1853 | ||
1854 | #ifdef CONFIG_COMPAT | ||
1855 | COMPAT_SYSCALL_DEFINE2(getrusage, int, who, struct compat_rusage __user *, ru) | ||
1856 | { | ||
1857 | struct rusage r; | ||
1858 | |||
1859 | if (who != RUSAGE_SELF && who != RUSAGE_CHILDREN && | ||
1860 | who != RUSAGE_THREAD) | ||
1861 | return -EINVAL; | ||
1862 | |||
1863 | k_getrusage(current, who, &r); | ||
1864 | return put_compat_rusage(&r, ru); | ||
1865 | } | ||
1866 | #endif | ||
1867 | |||
1854 | SYSCALL_DEFINE1(umask, int, mask) | 1868 | SYSCALL_DEFINE1(umask, int, mask) |
1855 | { | 1869 | { |
1856 | mask = xchg(¤t->fs->umask, mask & S_IRWXUGO); | 1870 | mask = xchg(¤t->fs->umask, mask & S_IRWXUGO); |
diff --git a/kernel/sys_ni.c b/kernel/sys_ni.c index 395084d4ce16..bfd6787b355a 100644 --- a/kernel/sys_ni.c +++ b/kernel/sys_ni.c | |||
@@ -20,6 +20,7 @@ cond_syscall(sys_quotactl); | |||
20 | cond_syscall(sys32_quotactl); | 20 | cond_syscall(sys32_quotactl); |
21 | cond_syscall(sys_acct); | 21 | cond_syscall(sys_acct); |
22 | cond_syscall(sys_lookup_dcookie); | 22 | cond_syscall(sys_lookup_dcookie); |
23 | cond_syscall(compat_sys_lookup_dcookie); | ||
23 | cond_syscall(sys_swapon); | 24 | cond_syscall(sys_swapon); |
24 | cond_syscall(sys_swapoff); | 25 | cond_syscall(sys_swapoff); |
25 | cond_syscall(sys_kexec_load); | 26 | cond_syscall(sys_kexec_load); |
@@ -155,7 +156,7 @@ cond_syscall(compat_sys_process_vm_writev); | |||
155 | cond_syscall(sys_pciconfig_read); | 156 | cond_syscall(sys_pciconfig_read); |
156 | cond_syscall(sys_pciconfig_write); | 157 | cond_syscall(sys_pciconfig_write); |
157 | cond_syscall(sys_pciconfig_iobase); | 158 | cond_syscall(sys_pciconfig_iobase); |
158 | cond_syscall(sys32_ipc); | 159 | cond_syscall(compat_sys_s390_ipc); |
159 | cond_syscall(ppc_rtas); | 160 | cond_syscall(ppc_rtas); |
160 | cond_syscall(sys_spu_run); | 161 | cond_syscall(sys_spu_run); |
161 | cond_syscall(sys_spu_create); | 162 | cond_syscall(sys_spu_create); |
diff --git a/kernel/uid16.c b/kernel/uid16.c index d7948eb10225..f6c83d7ef000 100644 --- a/kernel/uid16.c +++ b/kernel/uid16.c | |||
@@ -18,67 +18,43 @@ | |||
18 | 18 | ||
19 | SYSCALL_DEFINE3(chown16, const char __user *, filename, old_uid_t, user, old_gid_t, group) | 19 | SYSCALL_DEFINE3(chown16, const char __user *, filename, old_uid_t, user, old_gid_t, group) |
20 | { | 20 | { |
21 | long ret = sys_chown(filename, low2highuid(user), low2highgid(group)); | 21 | return sys_chown(filename, low2highuid(user), low2highgid(group)); |
22 | /* avoid REGPARM breakage on x86: */ | ||
23 | asmlinkage_protect(3, ret, filename, user, group); | ||
24 | return ret; | ||
25 | } | 22 | } |
26 | 23 | ||
27 | SYSCALL_DEFINE3(lchown16, const char __user *, filename, old_uid_t, user, old_gid_t, group) | 24 | SYSCALL_DEFINE3(lchown16, const char __user *, filename, old_uid_t, user, old_gid_t, group) |
28 | { | 25 | { |
29 | long ret = sys_lchown(filename, low2highuid(user), low2highgid(group)); | 26 | return sys_lchown(filename, low2highuid(user), low2highgid(group)); |
30 | /* avoid REGPARM breakage on x86: */ | ||
31 | asmlinkage_protect(3, ret, filename, user, group); | ||
32 | return ret; | ||
33 | } | 27 | } |
34 | 28 | ||
35 | SYSCALL_DEFINE3(fchown16, unsigned int, fd, old_uid_t, user, old_gid_t, group) | 29 | SYSCALL_DEFINE3(fchown16, unsigned int, fd, old_uid_t, user, old_gid_t, group) |
36 | { | 30 | { |
37 | long ret = sys_fchown(fd, low2highuid(user), low2highgid(group)); | 31 | return sys_fchown(fd, low2highuid(user), low2highgid(group)); |
38 | /* avoid REGPARM breakage on x86: */ | ||
39 | asmlinkage_protect(3, ret, fd, user, group); | ||
40 | return ret; | ||
41 | } | 32 | } |
42 | 33 | ||
43 | SYSCALL_DEFINE2(setregid16, old_gid_t, rgid, old_gid_t, egid) | 34 | SYSCALL_DEFINE2(setregid16, old_gid_t, rgid, old_gid_t, egid) |
44 | { | 35 | { |
45 | long ret = sys_setregid(low2highgid(rgid), low2highgid(egid)); | 36 | return sys_setregid(low2highgid(rgid), low2highgid(egid)); |
46 | /* avoid REGPARM breakage on x86: */ | ||
47 | asmlinkage_protect(2, ret, rgid, egid); | ||
48 | return ret; | ||
49 | } | 37 | } |
50 | 38 | ||
51 | SYSCALL_DEFINE1(setgid16, old_gid_t, gid) | 39 | SYSCALL_DEFINE1(setgid16, old_gid_t, gid) |
52 | { | 40 | { |
53 | long ret = sys_setgid(low2highgid(gid)); | 41 | return sys_setgid(low2highgid(gid)); |
54 | /* avoid REGPARM breakage on x86: */ | ||
55 | asmlinkage_protect(1, ret, gid); | ||
56 | return ret; | ||
57 | } | 42 | } |
58 | 43 | ||
59 | SYSCALL_DEFINE2(setreuid16, old_uid_t, ruid, old_uid_t, euid) | 44 | SYSCALL_DEFINE2(setreuid16, old_uid_t, ruid, old_uid_t, euid) |
60 | { | 45 | { |
61 | long ret = sys_setreuid(low2highuid(ruid), low2highuid(euid)); | 46 | return sys_setreuid(low2highuid(ruid), low2highuid(euid)); |
62 | /* avoid REGPARM breakage on x86: */ | ||
63 | asmlinkage_protect(2, ret, ruid, euid); | ||
64 | return ret; | ||
65 | } | 47 | } |
66 | 48 | ||
67 | SYSCALL_DEFINE1(setuid16, old_uid_t, uid) | 49 | SYSCALL_DEFINE1(setuid16, old_uid_t, uid) |
68 | { | 50 | { |
69 | long ret = sys_setuid(low2highuid(uid)); | 51 | return sys_setuid(low2highuid(uid)); |
70 | /* avoid REGPARM breakage on x86: */ | ||
71 | asmlinkage_protect(1, ret, uid); | ||
72 | return ret; | ||
73 | } | 52 | } |
74 | 53 | ||
75 | SYSCALL_DEFINE3(setresuid16, old_uid_t, ruid, old_uid_t, euid, old_uid_t, suid) | 54 | SYSCALL_DEFINE3(setresuid16, old_uid_t, ruid, old_uid_t, euid, old_uid_t, suid) |
76 | { | 55 | { |
77 | long ret = sys_setresuid(low2highuid(ruid), low2highuid(euid), | 56 | return sys_setresuid(low2highuid(ruid), low2highuid(euid), |
78 | low2highuid(suid)); | 57 | low2highuid(suid)); |
79 | /* avoid REGPARM breakage on x86: */ | ||
80 | asmlinkage_protect(3, ret, ruid, euid, suid); | ||
81 | return ret; | ||
82 | } | 58 | } |
83 | 59 | ||
84 | SYSCALL_DEFINE3(getresuid16, old_uid_t __user *, ruidp, old_uid_t __user *, euidp, old_uid_t __user *, suidp) | 60 | SYSCALL_DEFINE3(getresuid16, old_uid_t __user *, ruidp, old_uid_t __user *, euidp, old_uid_t __user *, suidp) |
@@ -100,11 +76,8 @@ SYSCALL_DEFINE3(getresuid16, old_uid_t __user *, ruidp, old_uid_t __user *, euid | |||
100 | 76 | ||
101 | SYSCALL_DEFINE3(setresgid16, old_gid_t, rgid, old_gid_t, egid, old_gid_t, sgid) | 77 | SYSCALL_DEFINE3(setresgid16, old_gid_t, rgid, old_gid_t, egid, old_gid_t, sgid) |
102 | { | 78 | { |
103 | long ret = sys_setresgid(low2highgid(rgid), low2highgid(egid), | 79 | return sys_setresgid(low2highgid(rgid), low2highgid(egid), |
104 | low2highgid(sgid)); | 80 | low2highgid(sgid)); |
105 | /* avoid REGPARM breakage on x86: */ | ||
106 | asmlinkage_protect(3, ret, rgid, egid, sgid); | ||
107 | return ret; | ||
108 | } | 81 | } |
109 | 82 | ||
110 | 83 | ||
@@ -127,18 +100,12 @@ SYSCALL_DEFINE3(getresgid16, old_gid_t __user *, rgidp, old_gid_t __user *, egid | |||
127 | 100 | ||
128 | SYSCALL_DEFINE1(setfsuid16, old_uid_t, uid) | 101 | SYSCALL_DEFINE1(setfsuid16, old_uid_t, uid) |
129 | { | 102 | { |
130 | long ret = sys_setfsuid(low2highuid(uid)); | 103 | return sys_setfsuid(low2highuid(uid)); |
131 | /* avoid REGPARM breakage on x86: */ | ||
132 | asmlinkage_protect(1, ret, uid); | ||
133 | return ret; | ||
134 | } | 104 | } |
135 | 105 | ||
136 | SYSCALL_DEFINE1(setfsgid16, old_gid_t, gid) | 106 | SYSCALL_DEFINE1(setfsgid16, old_gid_t, gid) |
137 | { | 107 | { |
138 | long ret = sys_setfsgid(low2highgid(gid)); | 108 | return sys_setfsgid(low2highgid(gid)); |
139 | /* avoid REGPARM breakage on x86: */ | ||
140 | asmlinkage_protect(1, ret, gid); | ||
141 | return ret; | ||
142 | } | 109 | } |
143 | 110 | ||
144 | static int groups16_to_user(old_gid_t __user *grouplist, | 111 | static int groups16_to_user(old_gid_t __user *grouplist, |