diff options
author | Mathias Krause <minipli@googlemail.com> | 2013-04-07 01:51:47 +0000 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2013-05-13 15:02:38 +0100 |
commit | 2a8c07b253bac436358adb9eb96a37dd223ef120 (patch) | |
tree | 0dc4131385038e6cae8d6ecb79cf336d9d2c2ab6 /net | |
parent | 60986f51c3db46081a9cb9fd469ad65cd1ccb833 (diff) | |
download | kernel-common-2a8c07b253bac436358adb9eb96a37dd223ef120.tar.gz kernel-common-2a8c07b253bac436358adb9eb96a37dd223ef120.tar.bz2 kernel-common-2a8c07b253bac436358adb9eb96a37dd223ef120.zip |
atm: update msg_namelen in vcc_recvmsg()
[ Upstream commit 9b3e617f3df53822345a8573b6d358f6b9e5ed87 ]
The current code does not fill the msg_name member in case it is set.
It also does not set the msg_namelen member to 0 and therefore makes
net/socket.c leak the local, uninitialized sockaddr_storage variable
to userland -- 128 bytes of kernel stack memory.
Fix that by simply setting msg_namelen to 0 as obviously nobody cared
about vcc_recvmsg() not filling the msg_name in case it was set.
Signed-off-by: Mathias Krause <minipli@googlemail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'net')
-rw-r--r-- | net/atm/common.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/atm/common.c b/net/atm/common.c index 0ca06e851e7c..43b6bfed036c 100644 --- a/net/atm/common.c +++ b/net/atm/common.c @@ -500,6 +500,8 @@ int vcc_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, struct sk_buff *skb; int copied, error = -EINVAL; + msg->msg_namelen = 0; + if (sock->state != SS_CONNECTED) return -ENOTCONN; if (flags & ~MSG_DONTWAIT) /* only handle MSG_DONTWAIT */ |