Commit 23be5ba8 authored by Roland Dreier's avatar Roland Dreier Committed by David S. Miller

[SPARC64]: Check copy_to_user() return value in sys_{sparc,sunos}32.c

Signed-off-by: default avatarRoland Dreier <roland@topspin.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5dc9df6c
...@@ -1598,7 +1598,8 @@ asmlinkage long sys32_sysctl(struct __sysctl_args32 __user *args) ...@@ -1598,7 +1598,8 @@ asmlinkage long sys32_sysctl(struct __sysctl_args32 __user *args)
put_user(oldlen, (u32 __user *)(unsigned long) tmp.oldlenp)) put_user(oldlen, (u32 __user *)(unsigned long) tmp.oldlenp))
error = -EFAULT; error = -EFAULT;
} }
copy_to_user(args->__unused, tmp.__unused, sizeof(tmp.__unused)); if (copy_to_user(args->__unused, tmp.__unused, sizeof(tmp.__unused)))
error = -EFAULT;
} }
return error; return error;
#endif #endif
......
...@@ -291,7 +291,8 @@ static int sunos_filldir(void * __buf, const char * name, int namlen, ...@@ -291,7 +291,8 @@ static int sunos_filldir(void * __buf, const char * name, int namlen,
put_user(ino, &dirent->d_ino); put_user(ino, &dirent->d_ino);
put_user(namlen, &dirent->d_namlen); put_user(namlen, &dirent->d_namlen);
put_user(reclen, &dirent->d_reclen); put_user(reclen, &dirent->d_reclen);
copy_to_user(dirent->d_name, name, namlen); if (copy_to_user(dirent->d_name, name, namlen))
return -EFAULT;
put_user(0, dirent->d_name + namlen); put_user(0, dirent->d_name + namlen);
dirent = (void __user *) dirent + reclen; dirent = (void __user *) dirent + reclen;
buf->curr = dirent; buf->curr = dirent;
...@@ -371,7 +372,8 @@ static int sunos_filldirentry(void * __buf, const char * name, int namlen, ...@@ -371,7 +372,8 @@ static int sunos_filldirentry(void * __buf, const char * name, int namlen,
put_user(ino, &dirent->d_ino); put_user(ino, &dirent->d_ino);
put_user(namlen, &dirent->d_namlen); put_user(namlen, &dirent->d_namlen);
put_user(reclen, &dirent->d_reclen); put_user(reclen, &dirent->d_reclen);
copy_to_user(dirent->d_name, name, namlen); if (copy_to_user(dirent->d_name, name, namlen))
return -EFAULT;
put_user(0, dirent->d_name + namlen); put_user(0, dirent->d_name + namlen);
dirent = (void __user *) dirent + reclen; dirent = (void __user *) dirent + reclen;
buf->curr = dirent; buf->curr = dirent;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment