projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d7256d0
)
net: compat_sys_recvmmsg user timespec arg can be NULL
author
Jean-Mickael Guerin
<
[email protected]
>
Tue, 1 Dec 2009 07:52:16 +0000
(07:52 +0000)
committer
David S. Miller
<
[email protected]
>
Wed, 2 Dec 2009 09:23:23 +0000
(
01:23
-0800)
We must test if user timespec is non-NULL before copying from userpace,
same as sys_recvmmsg().
Commiter note: changed it so that we have just one branch.
Signed-off-by: Jean-Mickael Guerin <
[email protected]
>
Signed-off-by: Arnaldo Carvalho de Melo <
[email protected]
>
Signed-off-by: David S. Miller <
[email protected]
>
net/compat.c
patch
|
blob
|
history
diff --git
a/net/compat.c
b/net/compat.c
index 6a2f75fb3f45ac102b33e08907dd7059cf78a371..e1a56ade803b09b48e047e24192a3649ed0348d5 100644
(file)
--- a/
net/compat.c
+++ b/
net/compat.c
@@
-758,9
+758,13
@@
asmlinkage long compat_sys_recvmmsg(int fd, struct compat_mmsghdr __user *mmsg,
{
int datagrams;
struct timespec ktspec;
- struct compat_timespec __user *utspec =
- (struct compat_timespec __user *)timeout;
+ struct compat_timespec __user *utspec;
+ if (timeout == NULL)
+ return __sys_recvmmsg(fd, (struct mmsghdr __user *)mmsg, vlen,
+ flags | MSG_CMSG_COMPAT, NULL);
+
+ utspec = (struct compat_timespec __user *)timeout;
if (get_user(ktspec.tv_sec, &utspec->tv_sec) ||
get_user(ktspec.tv_nsec, &utspec->tv_nsec))
return -EFAULT;