This is a note to let you know that I've just added the patch titled
Bluetooth: fix possible info leak in bt_sock_recvmsg()
to the 3.0-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
bluetooth-fix-possible-info-leak-in-bt_sock_recvmsg.patch
and it can be found in the queue-3.0 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.
>From 340dd9ef03f55ea0696e35fd9b02e6f290b680b7 Mon Sep 17 00:00:00 2001
From: Mathias Krause <[email protected]>
Date: Sun, 7 Apr 2013 01:51:49 +0000
Subject: Bluetooth: fix possible info leak in bt_sock_recvmsg()
From: Mathias Krause <[email protected]>
[ Upstream commit 4683f42fde3977bdb4e8a09622788cc8b5313778 ]
In case the socket is already shutting down, bt_sock_recvmsg() returns
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 msg_namelen assignment in front of the shutdown
test.
Signed-off-by: Mathias Krause <[email protected]>
Cc: Marcel Holtmann <[email protected]>
Cc: Gustavo Padovan <[email protected]>
Cc: Johan Hedberg <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
net/bluetooth/af_bluetooth.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/net/bluetooth/af_bluetooth.c
+++ b/net/bluetooth/af_bluetooth.c
@@ -245,6 +245,8 @@ int bt_sock_recvmsg(struct kiocb *iocb,
if (flags & (MSG_OOB))
return -EOPNOTSUPP;
+ msg->msg_namelen = 0;
+
skb = skb_recv_datagram(sk, flags, noblock, &err);
if (!skb) {
if (sk->sk_shutdown & RCV_SHUTDOWN)
@@ -252,8 +254,6 @@ int bt_sock_recvmsg(struct kiocb *iocb,
return err;
}
- msg->msg_namelen = 0;
-
copied = skb->len;
if (len < copied) {
msg->msg_flags |= MSG_TRUNC;
Patches currently in stable-queue which might be from [email protected] are
queue-3.0/irda-fix-missing-msg_namelen-update-in-irda_recvmsg_dgram.patch
queue-3.0/bluetooth-rfcomm-fix-missing-msg_namelen-update-in-rfcomm_sock_recvmsg.patch
queue-3.0/llc-fix-missing-msg_namelen-update-in-llc_ui_recvmsg.patch
queue-3.0/atm-update-msg_namelen-in-vcc_recvmsg.patch
queue-3.0/iucv-fix-missing-msg_namelen-update-in-iucv_sock_recvmsg.patch
queue-3.0/ax25-fix-info-leak-via-msg_name-in-ax25_recvmsg.patch
queue-3.0/tipc-fix-info-leaks-via-msg_name-in-recv_msg-recv_stream.patch
queue-3.0/netrom-fix-info-leak-via-msg_name-in-nr_recvmsg.patch
queue-3.0/caif-fix-missing-msg_namelen-update-in-caif_seqpkt_recvmsg.patch
queue-3.0/bluetooth-fix-possible-info-leak-in-bt_sock_recvmsg.patch
queue-3.0/rose-fix-info-leak-via-msg_name-in-rose_recvmsg.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html