mirror of
https://github.com/torvalds/linux.git
synced 2024-11-07 04:32:03 +00:00
[MIPS] Sparse: Add __user tags to syscall.c
Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Signed-off-by: Ralf Baechle <ralf@linux-mips.org> ---
This commit is contained in:
parent
72bf891421
commit
be6e518b62
@ -212,12 +212,12 @@ asmlinkage int sys_execve(nabi_no_regargs struct pt_regs regs)
|
||||
int error;
|
||||
char * filename;
|
||||
|
||||
filename = getname((char *) (long)regs.regs[4]);
|
||||
filename = getname((char __user *) (long)regs.regs[4]);
|
||||
error = PTR_ERR(filename);
|
||||
if (IS_ERR(filename))
|
||||
goto out;
|
||||
error = do_execve(filename, (char **) (long)regs.regs[5],
|
||||
(char **) (long)regs.regs[6], ®s);
|
||||
error = do_execve(filename, (char __user *__user *) (long)regs.regs[5],
|
||||
(char __user *__user *) (long)regs.regs[6], ®s);
|
||||
putname(filename);
|
||||
|
||||
out:
|
||||
@ -227,7 +227,7 @@ out:
|
||||
/*
|
||||
* Compacrapability ...
|
||||
*/
|
||||
asmlinkage int sys_uname(struct old_utsname * name)
|
||||
asmlinkage int sys_uname(struct old_utsname __user * name)
|
||||
{
|
||||
if (name && !copy_to_user(name, &system_utsname, sizeof (*name)))
|
||||
return 0;
|
||||
@ -237,7 +237,7 @@ asmlinkage int sys_uname(struct old_utsname * name)
|
||||
/*
|
||||
* Compacrapability ...
|
||||
*/
|
||||
asmlinkage int sys_olduname(struct oldold_utsname * name)
|
||||
asmlinkage int sys_olduname(struct oldold_utsname __user * name)
|
||||
{
|
||||
int error;
|
||||
|
||||
@ -274,7 +274,7 @@ void sys_set_thread_area(unsigned long addr)
|
||||
asmlinkage int _sys_sysmips(int cmd, long arg1, int arg2, int arg3)
|
||||
{
|
||||
int tmp, len;
|
||||
char *name;
|
||||
char __user *name;
|
||||
|
||||
switch(cmd) {
|
||||
case SETNAME: {
|
||||
@ -283,7 +283,7 @@ asmlinkage int _sys_sysmips(int cmd, long arg1, int arg2, int arg3)
|
||||
if (!capable(CAP_SYS_ADMIN))
|
||||
return -EPERM;
|
||||
|
||||
name = (char *) arg1;
|
||||
name = (char __user *) arg1;
|
||||
|
||||
len = strncpy_from_user(nodename, name, __NEW_UTS_LEN);
|
||||
if (len < 0)
|
||||
@ -324,7 +324,7 @@ asmlinkage int _sys_sysmips(int cmd, long arg1, int arg2, int arg3)
|
||||
* This is really horribly ugly.
|
||||
*/
|
||||
asmlinkage int sys_ipc (uint call, int first, int second,
|
||||
unsigned long third, void *ptr, long fifth)
|
||||
unsigned long third, void __user *ptr, long fifth)
|
||||
{
|
||||
int version, ret;
|
||||
|
||||
@ -333,24 +333,25 @@ asmlinkage int sys_ipc (uint call, int first, int second,
|
||||
|
||||
switch (call) {
|
||||
case SEMOP:
|
||||
return sys_semtimedop (first, (struct sembuf *)ptr, second,
|
||||
NULL);
|
||||
return sys_semtimedop (first, (struct sembuf __user *)ptr,
|
||||
second, NULL);
|
||||
case SEMTIMEDOP:
|
||||
return sys_semtimedop (first, (struct sembuf *)ptr, second,
|
||||
(const struct timespec __user *)fifth);
|
||||
return sys_semtimedop (first, (struct sembuf __user *)ptr,
|
||||
second,
|
||||
(const struct timespec __user *)fifth);
|
||||
case SEMGET:
|
||||
return sys_semget (first, second, third);
|
||||
case SEMCTL: {
|
||||
union semun fourth;
|
||||
if (!ptr)
|
||||
return -EINVAL;
|
||||
if (get_user(fourth.__pad, (void **) ptr))
|
||||
if (get_user(fourth.__pad, (void *__user *) ptr))
|
||||
return -EFAULT;
|
||||
return sys_semctl (first, second, third, fourth);
|
||||
}
|
||||
|
||||
case MSGSND:
|
||||
return sys_msgsnd (first, (struct msgbuf *) ptr,
|
||||
return sys_msgsnd (first, (struct msgbuf __user *) ptr,
|
||||
second, third);
|
||||
case MSGRCV:
|
||||
switch (version) {
|
||||
@ -360,7 +361,7 @@ asmlinkage int sys_ipc (uint call, int first, int second,
|
||||
return -EINVAL;
|
||||
|
||||
if (copy_from_user(&tmp,
|
||||
(struct ipc_kludge *) ptr,
|
||||
(struct ipc_kludge __user *) ptr,
|
||||
sizeof (tmp)))
|
||||
return -EFAULT;
|
||||
return sys_msgrcv (first, tmp.msgp, second,
|
||||
@ -368,35 +369,38 @@ asmlinkage int sys_ipc (uint call, int first, int second,
|
||||
}
|
||||
default:
|
||||
return sys_msgrcv (first,
|
||||
(struct msgbuf *) ptr,
|
||||
(struct msgbuf __user *) ptr,
|
||||
second, fifth, third);
|
||||
}
|
||||
case MSGGET:
|
||||
return sys_msgget ((key_t) first, second);
|
||||
case MSGCTL:
|
||||
return sys_msgctl (first, second, (struct msqid_ds *) ptr);
|
||||
return sys_msgctl (first, second,
|
||||
(struct msqid_ds __user *) ptr);
|
||||
|
||||
case SHMAT:
|
||||
switch (version) {
|
||||
default: {
|
||||
ulong raddr;
|
||||
ret = do_shmat (first, (char *) ptr, second, &raddr);
|
||||
ret = do_shmat (first, (char __user *) ptr, second,
|
||||
&raddr);
|
||||
if (ret)
|
||||
return ret;
|
||||
return put_user (raddr, (ulong *) third);
|
||||
return put_user (raddr, (ulong __user *) third);
|
||||
}
|
||||
case 1: /* iBCS2 emulator entry point */
|
||||
if (!segment_eq(get_fs(), get_ds()))
|
||||
return -EINVAL;
|
||||
return do_shmat (first, (char *) ptr, second, (ulong *) third);
|
||||
return do_shmat (first, (char __user *) ptr, second,
|
||||
(ulong *) third);
|
||||
}
|
||||
case SHMDT:
|
||||
return sys_shmdt ((char *)ptr);
|
||||
return sys_shmdt ((char __user *)ptr);
|
||||
case SHMGET:
|
||||
return sys_shmget (first, second, third);
|
||||
case SHMCTL:
|
||||
return sys_shmctl (first, second,
|
||||
(struct shmid_ds *) ptr);
|
||||
(struct shmid_ds __user *) ptr);
|
||||
default:
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user