]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
Bluetooth: fix possible info leak in bt_sock_recvmsg()
authorMathias Krause <minipli@googlemail.com>
Sun, 7 Apr 2013 01:51:49 +0000 (01:51 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 1 May 2013 15:56:38 +0000 (08:56 -0700)
commit0a740ea0de6c84544fe8e68d235da75341f30edd
tree37189ca2b3d966fc7375a8f5a3e9478cff07a17b
parent9a627f671963d81b5fdf910ddcba905328215b1f
Bluetooth: fix possible info leak in bt_sock_recvmsg()

[ 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 <minipli@googlemail.com>
Cc: Marcel Holtmann <marcel@holtmann.org>
Cc: Gustavo Padovan <gustavo@padovan.org>
Cc: Johan Hedberg <johan.hedberg@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/bluetooth/af_bluetooth.c