]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Bluetooth: l2cap and rfcomm: fix 1 byte infoleak to userspace.
authorFilip Palian <s3810@pjwstk.edu.pl>
Thu, 12 May 2011 17:32:46 +0000 (19:32 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 7 Nov 2011 20:32:48 +0000 (12:32 -0800)
commit 8d03e971cf403305217b8e62db3a2e5ad2d6263f upstream.

Structures "l2cap_conninfo" and "rfcomm_conninfo" have one padding
byte each. This byte in "cinfo" is copied to userspace uninitialized.

Signed-off-by: Filip Palian <filip.palian@pjwstk.edu.pl>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
net/bluetooth/l2cap.c
net/bluetooth/rfcomm/sock.c

index 8d1c4a93eee9a0b225361e6555a09e40abd2c524..514aa8fbbee20989db0d0c4af0cd5ad46c3c917e 100644 (file)
@@ -1886,6 +1886,7 @@ static int l2cap_sock_getsockopt_old(struct socket *sock, int optname, char __us
                        break;
                }
 
+               memset(&cinfo, 0, sizeof(cinfo));
                cinfo.hci_handle = l2cap_pi(sk)->conn->hcon->handle;
                memcpy(cinfo.dev_class, l2cap_pi(sk)->conn->hcon->dev_class, 3);
 
index 30a36499ee7741afc4f6116c633273ee87032fae..1ae3f80fe472c2fba522f199a3f7b79de5e0a432 100644 (file)
@@ -878,6 +878,7 @@ static int rfcomm_sock_getsockopt_old(struct socket *sock, int optname, char __u
 
                l2cap_sk = rfcomm_pi(sk)->dlc->session->sock->sk;
 
+               memset(&cinfo, 0, sizeof(cinfo));
                cinfo.hci_handle = l2cap_pi(l2cap_sk)->conn->hcon->handle;
                memcpy(cinfo.dev_class, l2cap_pi(l2cap_sk)->conn->hcon->dev_class, 3);