diff options
author | Filip Palian <s3810@pjwstk.edu.pl> | 2011-05-12 19:32:46 +0200 |
---|---|---|
committer | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-06-09 15:30:01 -0300 |
commit | 8d03e971cf403305217b8e62db3a2e5ad2d6263f (patch) | |
tree | 849bb2e439234c63480c6485a3b663a3377cfd21 | |
parent | 51892dbbd511911c0f965a36b431fc3e8f1e4f8a (diff) | |
download | linux-3.10-8d03e971cf403305217b8e62db3a2e5ad2d6263f.tar.gz linux-3.10-8d03e971cf403305217b8e62db3a2e5ad2d6263f.tar.bz2 linux-3.10-8d03e971cf403305217b8e62db3a2e5ad2d6263f.zip |
Bluetooth: l2cap and rfcomm: fix 1 byte infoleak to userspace.
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>
-rw-r--r-- | net/bluetooth/l2cap_sock.c | 1 | ||||
-rw-r--r-- | net/bluetooth/rfcomm/sock.c | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c index 18dc9888d8c..8248303f44e 100644 --- a/net/bluetooth/l2cap_sock.c +++ b/net/bluetooth/l2cap_sock.c @@ -413,6 +413,7 @@ static int l2cap_sock_getsockopt_old(struct socket *sock, int optname, char __us break; } + memset(&cinfo, 0, sizeof(cinfo)); cinfo.hci_handle = chan->conn->hcon->handle; memcpy(cinfo.dev_class, chan->conn->hcon->dev_class, 3); diff --git a/net/bluetooth/rfcomm/sock.c b/net/bluetooth/rfcomm/sock.c index 386cfaffd4b..1b10727ce52 100644 --- a/net/bluetooth/rfcomm/sock.c +++ b/net/bluetooth/rfcomm/sock.c @@ -788,6 +788,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 = conn->hcon->handle; memcpy(cinfo.dev_class, conn->hcon->dev_class, 3); |