aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68k/kernel
diff options
context:
space:
mode:
authorAl Viro <viro@ftp.linux.org.uk>2006-01-12 04:06:27 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-12 12:09:03 -0500
commit350c20a6fd24b2a3265f7ca440aa17570e89e2cd (patch)
tree3e10994ff5c6c8f31db2a71b71099c409235bc18 /arch/m68k/kernel
parent1b7bb54a417ca73eefc52df3702ff5167b46dc89 (diff)
[PATCH] m68k: syscalls __user annotation
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Cc: Roman Zippel <zippel@linux-m68k.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/m68k/kernel')
-rw-r--r--arch/m68k/kernel/sys_m68k.c39
1 files changed, 16 insertions, 23 deletions
diff --git a/arch/m68k/kernel/sys_m68k.c b/arch/m68k/kernel/sys_m68k.c
index 640895b2c51a..143c552d38f3 100644
--- a/arch/m68k/kernel/sys_m68k.c
+++ b/arch/m68k/kernel/sys_m68k.c
@@ -32,7 +32,7 @@
32 * sys_pipe() is the normal C calling standard for creating 32 * sys_pipe() is the normal C calling standard for creating
33 * a pipe. It's not the way unix traditionally does this, though. 33 * a pipe. It's not the way unix traditionally does this, though.
34 */ 34 */
35asmlinkage int sys_pipe(unsigned long * fildes) 35asmlinkage int sys_pipe(unsigned long __user * fildes)
36{ 36{
37 int fd[2]; 37 int fd[2];
38 int error; 38 int error;
@@ -94,7 +94,7 @@ struct mmap_arg_struct {
94 unsigned long offset; 94 unsigned long offset;
95}; 95};
96 96
97asmlinkage int old_mmap(struct mmap_arg_struct *arg) 97asmlinkage int old_mmap(struct mmap_arg_struct __user *arg)
98{ 98{
99 struct mmap_arg_struct a; 99 struct mmap_arg_struct a;
100 int error = -EFAULT; 100 int error = -EFAULT;
@@ -160,11 +160,11 @@ out:
160 160
161struct sel_arg_struct { 161struct sel_arg_struct {
162 unsigned long n; 162 unsigned long n;
163 fd_set *inp, *outp, *exp; 163 fd_set __user *inp, *outp, *exp;
164 struct timeval *tvp; 164 struct timeval __user *tvp;
165}; 165};
166 166
167asmlinkage int old_select(struct sel_arg_struct *arg) 167asmlinkage int old_select(struct sel_arg_struct __user *arg)
168{ 168{
169 struct sel_arg_struct a; 169 struct sel_arg_struct a;
170 170
@@ -180,7 +180,7 @@ asmlinkage int old_select(struct sel_arg_struct *arg)
180 * This is really horribly ugly. 180 * This is really horribly ugly.
181 */ 181 */
182asmlinkage int sys_ipc (uint call, int first, int second, 182asmlinkage int sys_ipc (uint call, int first, int second,
183 int third, void *ptr, long fifth) 183 int third, void __user *ptr, long fifth)
184{ 184{
185 int version, ret; 185 int version, ret;
186 186
@@ -190,14 +190,14 @@ asmlinkage int sys_ipc (uint call, int first, int second,
190 if (call <= SEMCTL) 190 if (call <= SEMCTL)
191 switch (call) { 191 switch (call) {
192 case SEMOP: 192 case SEMOP:
193 return sys_semop (first, (struct sembuf *)ptr, second); 193 return sys_semop (first, ptr, second);
194 case SEMGET: 194 case SEMGET:
195 return sys_semget (first, second, third); 195 return sys_semget (first, second, third);
196 case SEMCTL: { 196 case SEMCTL: {
197 union semun fourth; 197 union semun fourth;
198 if (!ptr) 198 if (!ptr)
199 return -EINVAL; 199 return -EINVAL;
200 if (get_user(fourth.__pad, (void **) ptr)) 200 if (get_user(fourth.__pad, (void __user *__user *) ptr))
201 return -EFAULT; 201 return -EFAULT;
202 return sys_semctl (first, second, third, fourth); 202 return sys_semctl (first, second, third, fourth);
203 } 203 }
@@ -207,31 +207,26 @@ asmlinkage int sys_ipc (uint call, int first, int second,
207 if (call <= MSGCTL) 207 if (call <= MSGCTL)
208 switch (call) { 208 switch (call) {
209 case MSGSND: 209 case MSGSND:
210 return sys_msgsnd (first, (struct msgbuf *) ptr, 210 return sys_msgsnd (first, ptr, second, third);
211 second, third);
212 case MSGRCV: 211 case MSGRCV:
213 switch (version) { 212 switch (version) {
214 case 0: { 213 case 0: {
215 struct ipc_kludge tmp; 214 struct ipc_kludge tmp;
216 if (!ptr) 215 if (!ptr)
217 return -EINVAL; 216 return -EINVAL;
218 if (copy_from_user (&tmp, 217 if (copy_from_user (&tmp, ptr, sizeof (tmp)))
219 (struct ipc_kludge *)ptr,
220 sizeof (tmp)))
221 return -EFAULT; 218 return -EFAULT;
222 return sys_msgrcv (first, tmp.msgp, second, 219 return sys_msgrcv (first, tmp.msgp, second,
223 tmp.msgtyp, third); 220 tmp.msgtyp, third);
224 } 221 }
225 default: 222 default:
226 return sys_msgrcv (first, 223 return sys_msgrcv (first, ptr,
227 (struct msgbuf *) ptr,
228 second, fifth, third); 224 second, fifth, third);
229 } 225 }
230 case MSGGET: 226 case MSGGET:
231 return sys_msgget ((key_t) first, second); 227 return sys_msgget ((key_t) first, second);
232 case MSGCTL: 228 case MSGCTL:
233 return sys_msgctl (first, second, 229 return sys_msgctl (first, second, ptr);
234 (struct msqid_ds *) ptr);
235 default: 230 default:
236 return -ENOSYS; 231 return -ENOSYS;
237 } 232 }
@@ -241,20 +236,18 @@ asmlinkage int sys_ipc (uint call, int first, int second,
241 switch (version) { 236 switch (version) {
242 default: { 237 default: {
243 ulong raddr; 238 ulong raddr;
244 ret = do_shmat (first, (char *) ptr, 239 ret = do_shmat (first, ptr, second, &raddr);
245 second, &raddr);
246 if (ret) 240 if (ret)
247 return ret; 241 return ret;
248 return put_user (raddr, (ulong *) third); 242 return put_user (raddr, (ulong __user *) third);
249 } 243 }
250 } 244 }
251 case SHMDT: 245 case SHMDT:
252 return sys_shmdt ((char *)ptr); 246 return sys_shmdt (ptr);
253 case SHMGET: 247 case SHMGET:
254 return sys_shmget (first, second, third); 248 return sys_shmget (first, second, third);
255 case SHMCTL: 249 case SHMCTL:
256 return sys_shmctl (first, second, 250 return sys_shmctl (first, second, ptr);
257 (struct shmid_ds *) ptr);
258 default: 251 default:
259 return -ENOSYS; 252 return -ENOSYS;
260 } 253 }