aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorMathias Krause2013-04-06 20:51:53 -0500
committerGreg Kroah-Hartman2013-05-01 11:46:01 -0500
commitc4c63badde92f235a837589aa475e27014791c9e (patch)
tree9e55f8e4432b49b2dcc44f2227a2f83c083f37e2 /net
parent60f566f77e928099fe9fea99716f0beea931661e (diff)
downloadkernel-video-c4c63badde92f235a837589aa475e27014791c9e.tar.gz
kernel-video-c4c63badde92f235a837589aa475e27014791c9e.tar.xz
kernel-video-c4c63badde92f235a837589aa475e27014791c9e.zip
irda: Fix missing msg_namelen update in irda_recvmsg_dgram()
[ Upstream commit 5ae94c0d2f0bed41d6718be743985d61b7f5c47d ] The current code does not fill the msg_name member in case it is set. It also does not set 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. Fix that by simply setting msg_namelen to 0 as obviously nobody cared about irda_recvmsg_dgram() not filling the msg_name in case it was set. Signed-off-by: Mathias Krause <minipli@googlemail.com> Cc: Samuel Ortiz <samuel@sortiz.org> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net')
-rw-r--r--net/irda/af_irda.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/irda/af_irda.c b/net/irda/af_irda.c
index 4d04105a3f0..3c9bd5949d7 100644
--- a/net/irda/af_irda.c
+++ b/net/irda/af_irda.c
@@ -1386,6 +1386,8 @@ static int irda_recvmsg_dgram(struct kiocb *iocb, struct socket *sock,
1386 1386
1387 IRDA_DEBUG(4, "%s()\n", __func__); 1387 IRDA_DEBUG(4, "%s()\n", __func__);
1388 1388
1389 msg->msg_namelen = 0;
1390
1389 skb = skb_recv_datagram(sk, flags & ~MSG_DONTWAIT, 1391 skb = skb_recv_datagram(sk, flags & ~MSG_DONTWAIT,
1390 flags & MSG_DONTWAIT, &err); 1392 flags & MSG_DONTWAIT, &err);
1391 if (!skb) 1393 if (!skb)