]> git.baikalelectronics.ru Git - kernel.git/commit
VSOCK: vmci - fix possible info leak in vmci_transport_dgram_dequeue()
authorMathias Krause <minipli@googlemail.com>
Sun, 7 Apr 2013 01:52:01 +0000 (01:52 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sun, 7 Apr 2013 20:28:02 +0000 (16:28 -0400)
commitd1778018ea541aeff2ee93d9f3d28a1641abff61
treebd075aa2f2b87d1b6f019baaee2cbb89cb4ba388
parentc7e7a5fc7ca0f12e02308906f090de302d6a65ec
VSOCK: vmci - fix possible info leak in vmci_transport_dgram_dequeue()

In case we received no data on the call to skb_recv_datagram(), i.e.
skb->data is NULL, vmci_transport_dgram_dequeue() will return with 0
without updating msg_namelen leading to net/socket.c leaking the local,
uninitialized sockaddr_storage variable to userland -- 128 bytes of
kernel stack memory.

Fix this by moving the already existing msg_namelen assignment a few
lines above.

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>
net/vmw_vsock/vmci_transport.c