From: Vasiliy Kulikov <segoon@openwall.com>
Date: Mon, 14 Feb 2011 10:54:26 +0000 (+0300)
Subject: Bluetooth: sco: fix information leak to userspace
X-Git-Tag: firefly_0821_release~10186^2~239
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=1fdae7255ced792c46a1b697aa7f27b2f3b4e322;p=firefly-linux-kernel-4.4.55.git

Bluetooth: sco: fix information leak to userspace

commit c4c896e1471aec3b004a693c689f60be3b17ac86 upstream.

struct sco_conninfo has one padding byte in the end.  Local variable
cinfo of type sco_conninfo is copied to userspace with this uninizialized
one byte, leading to old stack contents leak.

Signed-off-by: Vasiliy Kulikov <segoon@openwall.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---

diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c
index 5c0685eba947..e52443ce4f9c 100644
--- a/net/bluetooth/sco.c
+++ b/net/bluetooth/sco.c
@@ -700,6 +700,7 @@ static int sco_sock_getsockopt_old(struct socket *sock, int optname, char __user
 			break;
 		}
 
+		memset(&cinfo, 0, sizeof(cinfo));
 		cinfo.hci_handle = sco_pi(sk)->conn->hcon->handle;
 		memcpy(cinfo.dev_class, sco_pi(sk)->conn->hcon->dev_class, 3);