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/uid16.c | |
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/uid16.c')
-rw-r--r-- | kernel/uid16.c | 55 |
1 files changed, 11 insertions, 44 deletions
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, |