From: Mathias Krause Date: Sun, 7 Apr 2013 01:52:02 +0000 (+0000) Subject: VSOCK: Fix missing msg_namelen update in vsock_stream_recvmsg() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d5e0d0f607a7a029c6563a0470d88255c89a8d11;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git 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 Cc: Dmitry Torokhov Cc: George Zhang Signed-off-by: Mathias Krause Signed-off-by: David S. Miller --- 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) {