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