summaryrefslogtreecommitdiffstats
path: root/net/vmw_vsock
diff options
context:
space:
mode:
authorMathias Krause <minipli@googlemail.com>2013-04-07 03:52:02 +0200
committerDavid S. Miller <davem@davemloft.net>2013-04-07 22:28:02 +0200
commitd5e0d0f607a7a029c6563a0470d88255c89a8d11 (patch)
tree01aaa7cb29147cba0fcc1202a03bbf1af598be62 /net/vmw_vsock
parentVSOCK: vmci - fix possible info leak in vmci_transport_dgram_dequeue() (diff)
downloadlinux-d5e0d0f607a7a029c6563a0470d88255c89a8d11.tar.xz
linux-d5e0d0f607a7a029c6563a0470d88255c89a8d11.zip
VSOCK: Fix missing msg_namelen update in vsock_stream_recvmsg()
The code misses to update 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. Cc: Andy King <acking@vmware.com> Cc: Dmitry Torokhov <dtor@vmware.com> Cc: George Zhang <georgezhang@vmware.com> Signed-off-by: Mathias Krause <minipli@googlemail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/vmw_vsock')
-rw-r--r--net/vmw_vsock/af_vsock.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c
index d8079daf1bde..7f93e2a42d7a 100644
--- a/net/vmw_vsock/af_vsock.c
+++ b/net/vmw_vsock/af_vsock.c
@@ -1670,6 +1670,8 @@ vsock_stream_recvmsg(struct kiocb *kiocb,
vsk = vsock_sk(sk);
err = 0;
+ msg->msg_namelen = 0;
+
lock_sock(sk);
if (sk->sk_state != SS_CONNECTED) {