[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1365335522-29931-16-git-send-email-minipli@googlemail.com>
Date: Sun, 7 Apr 2013 13:52:01 +0200
From: Mathias Krause <minipli@...glemail.com>
To: "David S. Miller" <davem@...emloft.net>
Cc: netdev@...r.kernel.org,
Allan Stephens <allan.stephens@...driver.com>,
Aloisio Almeida Jr <aloisio.almeida@...nbossa.org>,
Andy King <acking@...are.com>,
Arnaldo Carvalho de Melo <acme@...stprotocols.net>,
Dmitry Torokhov <dtor@...are.com>,
George Zhang <georgezhang@...are.com>,
Gustavo Padovan <gustavo@...ovan.org>,
Johan Hedberg <johan.hedberg@...il.com>,
Jon Maloy <jon.maloy@...csson.com>,
Lauro Ramos Venancio <lauro.venancio@...nbossa.org>,
Marcel Holtmann <marcel@...tmann.org>,
Ralf Baechle <ralf@...ux-mips.org>,
Samuel Ortiz <sameo@...ux.intel.com>,
Samuel Ortiz <samuel@...tiz.org>,
Sjur Braendeland <sjur.brandeland@...ricsson.com>,
Ursula Braun <ursula.braun@...ibm.com>,
Brad Spengler <spender@...ecurity.net>,
Mathias Krause <minipli@...glemail.com>
Subject: [PATCH 15/16] 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@...are.com>
Cc: Dmitry Torokhov <dtor@...are.com>
Cc: George Zhang <georgezhang@...are.com>
Signed-off-by: Mathias Krause <minipli@...glemail.com>
---
net/vmw_vsock/vmci_transport.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/vmw_vsock/vmci_transport.c b/net/vmw_vsock/vmci_transport.c
index a70ace8..a8e4e70 100644
--- a/net/vmw_vsock/vmci_transport.c
+++ b/net/vmw_vsock/vmci_transport.c
@@ -1727,6 +1727,8 @@ static int vmci_transport_dgram_dequeue(struct kiocb *kiocb,
if (flags & MSG_OOB || flags & MSG_ERRQUEUE)
return -EOPNOTSUPP;
+ msg->msg_namelen = 0;
+
/* Retrieve the head sk_buff from the socket's receive queue. */
err = 0;
skb = skb_recv_datagram(&vsk->sk, flags, noblock, &err);
@@ -1759,7 +1761,6 @@ static int vmci_transport_dgram_dequeue(struct kiocb *kiocb,
if (err)
goto out;
- msg->msg_namelen = 0;
if (msg->msg_name) {
struct sockaddr_vm *vm_addr;
--
1.7.10.4
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists