[lucid/fsl-imx51, maverick/ti-omap4 CVE 1/1] Bluetooth: bnep: fix buffer overflow

Andy Whitcroft apw at canonical.com
Tue Jul 26 18:51:13 UTC 2011

From: Vasiliy Kulikov <segoon at openwall.com>

Struct ca is copied from userspace.  It is not checked whether the "device"
field is NULL terminated.  This potentially leads to BUG() inside of
alloc_netdev_mqs() and/or information leak by creating a device with a name
made of contents of kernel stack.

Signed-off-by: Vasiliy Kulikov <segoon at openwall.com>
Signed-off-by: Gustavo F. Padovan <padovan at profusion.mobi>

(cherry picked from commit 43629f8f5ea32a998d06d1bb41eefa0e821ff573)
BugLink: http://bugs.launchpad.net/bugs/816544
Signed-off-by: Andy Whitcroft <apw at canonical.com>
 net/bluetooth/bnep/sock.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/net/bluetooth/bnep/sock.c b/net/bluetooth/bnep/sock.c
index e857628..efc85dc 100644
--- a/net/bluetooth/bnep/sock.c
+++ b/net/bluetooth/bnep/sock.c
@@ -88,6 +88,7 @@ static int bnep_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long
 			return -EBADFD;
+		ca.device[sizeof(ca.device)-1] = 0;
 		err = bnep_add_connection(&ca, nsock);
 		if (!err) {

More information about the kernel-team mailing list