[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>

authored by Al Viro and committed by Linus Torvalds 350c20a6 1b7bb54a

+16 -23
+16 -23
arch/m68k/kernel/sys_m68k.c
··· 32 * sys_pipe() is the normal C calling standard for creating 33 * a pipe. It's not the way unix traditionally does this, though. 34 */ 35 - asmlinkage int sys_pipe(unsigned long * fildes) 36 { 37 int fd[2]; 38 int error; ··· 94 unsigned long offset; 95 }; 96 97 - asmlinkage int old_mmap(struct mmap_arg_struct *arg) 98 { 99 struct mmap_arg_struct a; 100 int error = -EFAULT; ··· 160 161 struct sel_arg_struct { 162 unsigned long n; 163 - fd_set *inp, *outp, *exp; 164 - struct timeval *tvp; 165 }; 166 167 - asmlinkage int old_select(struct sel_arg_struct *arg) 168 { 169 struct sel_arg_struct a; 170 ··· 180 * This is really horribly ugly. 181 */ 182 asmlinkage int sys_ipc (uint call, int first, int second, 183 - int third, void *ptr, long fifth) 184 { 185 int version, ret; 186 ··· 190 if (call <= SEMCTL) 191 switch (call) { 192 case SEMOP: 193 - return sys_semop (first, (struct sembuf *)ptr, second); 194 case SEMGET: 195 return sys_semget (first, second, third); 196 case SEMCTL: { 197 union semun fourth; 198 if (!ptr) 199 return -EINVAL; 200 - if (get_user(fourth.__pad, (void **) ptr)) 201 return -EFAULT; 202 return sys_semctl (first, second, third, fourth); 203 } ··· 207 if (call <= MSGCTL) 208 switch (call) { 209 case MSGSND: 210 - return sys_msgsnd (first, (struct msgbuf *) ptr, 211 - second, third); 212 case MSGRCV: 213 switch (version) { 214 case 0: { 215 struct ipc_kludge tmp; 216 if (!ptr) 217 return -EINVAL; 218 - if (copy_from_user (&tmp, 219 - (struct ipc_kludge *)ptr, 220 - sizeof (tmp))) 221 return -EFAULT; 222 return sys_msgrcv (first, tmp.msgp, second, 223 tmp.msgtyp, third); 224 } 225 default: 226 - return sys_msgrcv (first, 227 - (struct msgbuf *) ptr, 228 second, fifth, third); 229 } 230 case MSGGET: 231 return sys_msgget ((key_t) first, second); 232 case MSGCTL: 233 - return sys_msgctl (first, second, 234 - (struct msqid_ds *) ptr); 235 default: 236 return -ENOSYS; 237 } ··· 236 switch (version) { 237 default: { 238 ulong raddr; 239 - ret = do_shmat (first, (char *) ptr, 240 - second, &raddr); 241 if (ret) 242 return ret; 243 - return put_user (raddr, (ulong *) third); 244 } 245 } 246 case SHMDT: 247 - return sys_shmdt ((char *)ptr); 248 case SHMGET: 249 return sys_shmget (first, second, third); 250 case SHMCTL: 251 - return sys_shmctl (first, second, 252 - (struct shmid_ds *) ptr); 253 default: 254 return -ENOSYS; 255 }
··· 32 * sys_pipe() is the normal C calling standard for creating 33 * a pipe. It's not the way unix traditionally does this, though. 34 */ 35 + asmlinkage int sys_pipe(unsigned long __user * fildes) 36 { 37 int fd[2]; 38 int error; ··· 94 unsigned long offset; 95 }; 96 97 + asmlinkage int old_mmap(struct mmap_arg_struct __user *arg) 98 { 99 struct mmap_arg_struct a; 100 int error = -EFAULT; ··· 160 161 struct sel_arg_struct { 162 unsigned long n; 163 + fd_set __user *inp, *outp, *exp; 164 + struct timeval __user *tvp; 165 }; 166 167 + asmlinkage int old_select(struct sel_arg_struct __user *arg) 168 { 169 struct sel_arg_struct a; 170 ··· 180 * This is really horribly ugly. 181 */ 182 asmlinkage int sys_ipc (uint call, int first, int second, 183 + int third, void __user *ptr, long fifth) 184 { 185 int version, ret; 186 ··· 190 if (call <= SEMCTL) 191 switch (call) { 192 case SEMOP: 193 + return sys_semop (first, ptr, second); 194 case SEMGET: 195 return sys_semget (first, second, third); 196 case SEMCTL: { 197 union semun fourth; 198 if (!ptr) 199 return -EINVAL; 200 + if (get_user(fourth.__pad, (void __user *__user *) ptr)) 201 return -EFAULT; 202 return sys_semctl (first, second, third, fourth); 203 } ··· 207 if (call <= MSGCTL) 208 switch (call) { 209 case MSGSND: 210 + return sys_msgsnd (first, ptr, second, third); 211 case MSGRCV: 212 switch (version) { 213 case 0: { 214 struct ipc_kludge tmp; 215 if (!ptr) 216 return -EINVAL; 217 + if (copy_from_user (&tmp, ptr, sizeof (tmp))) 218 return -EFAULT; 219 return sys_msgrcv (first, tmp.msgp, second, 220 tmp.msgtyp, third); 221 } 222 default: 223 + return sys_msgrcv (first, ptr, 224 second, fifth, third); 225 } 226 case MSGGET: 227 return sys_msgget ((key_t) first, second); 228 case MSGCTL: 229 + return sys_msgctl (first, second, ptr); 230 default: 231 return -ENOSYS; 232 } ··· 241 switch (version) { 242 default: { 243 ulong raddr; 244 + ret = do_shmat (first, ptr, second, &raddr); 245 if (ret) 246 return ret; 247 + return put_user (raddr, (ulong __user *) third); 248 } 249 } 250 case SHMDT: 251 + return sys_shmdt (ptr); 252 case SHMGET: 253 return sys_shmget (first, second, third); 254 case SHMCTL: 255 + return sys_shmctl (first, second, ptr); 256 default: 257 return -ENOSYS; 258 }