This is a note to let you know that I've just added the patch titled

    llc: Fix missing msg_namelen update in llc_ui_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:
     llc-fix-missing-msg_namelen-update-in-llc_ui_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 178af9988a430d77d88416e0452ead9b0b2cea3d Mon Sep 17 00:00:00 2001
From: Mathias Krause <[email protected]>
Date: Sun, 7 Apr 2013 01:51:56 +0000
Subject: llc: Fix missing msg_namelen update in llc_ui_recvmsg()


From: Mathias Krause <[email protected]>

[ Upstream commit c77a4b9cffb6215a15196ec499490d116dfad181 ]

For stream sockets 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. The msg_namelen update is also missing for datagram sockets
in case the socket is shutting down during receive.

Fix both issues by setting msg_namelen to 0 early. It will be
updated later if we're going to fill the msg_name member.

Signed-off-by: Mathias Krause <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
 net/llc/af_llc.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/net/llc/af_llc.c
+++ b/net/llc/af_llc.c
@@ -720,6 +720,8 @@ static int llc_ui_recvmsg(struct kiocb *
        int target;     /* Read at least this many bytes */
        long timeo;
 
+       msg->msg_namelen = 0;
+
        lock_sock(sk);
        copied = -ENOTCONN;
        if (unlikely(sk->sk_type == SOCK_STREAM && sk->sk_state == TCP_LISTEN))


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

Reply via email to