[Lucid CVE-2012-6545 1/2] Bluetooth: RFCOMM - Fix info leak via getsockname()
Luis Henriques
luis.henriques at canonical.com
Tue Mar 26 17:17:01 UTC 2013
From: Mathias Krause <minipli at googlemail.com>
CVE-2012-6545
BugLink: http://bugs.launchpad.net/bugs/1156757
The RFCOMM code fails to initialize the trailing padding byte of struct
sockaddr_rc added for alignment. It that for leaks one byte kernel stack
via the getsockname() syscall. Add an explicit memset(0) before filling
the structure to avoid the info leak.
Signed-off-by: Mathias Krause <minipli at googlemail.com>
Cc: Marcel Holtmann <marcel at holtmann.org>
Cc: Gustavo Padovan <gustavo at padovan.org>
Cc: Johan Hedberg <johan.hedberg at gmail.com>
Signed-off-by: David S. Miller <davem at davemloft.net>
(cherry picked from commit 9344a972961d1a6d2c04d9008b13617bcb6ec2ef)
Signed-off-by: Luis Henriques <luis.henriques at canonical.com>
---
net/bluetooth/rfcomm/sock.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/bluetooth/rfcomm/sock.c b/net/bluetooth/rfcomm/sock.c
index 1ae3f80..c47b7c4 100644
--- a/net/bluetooth/rfcomm/sock.c
+++ b/net/bluetooth/rfcomm/sock.c
@@ -543,6 +543,7 @@ static int rfcomm_sock_getname(struct socket *sock, struct sockaddr *addr, int *
BT_DBG("sock %p, sk %p", sock, sk);
+ memset(sa, 0, sizeof(*sa));
sa->rc_family = AF_BLUETOOTH;
sa->rc_channel = rfcomm_pi(sk)->channel;
if (peer)
--
1.8.1.2
More information about the kernel-team
mailing list