From patchwork Tue Jul 26 18:51:13 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [lucid/fsl-imx51, maverick/ti-omap4, CVE, 1/1] Bluetooth: bnep: fix buffer overflow From: Andy Whitcroft X-Patchwork-Id: 106908 Message-Id: <1311706273-14191-3-git-send-email-apw@canonical.com> To: kernel-team@lists.ubuntu.com Date: Tue, 26 Jul 2011 19:51:13 +0100 From: Vasiliy Kulikov 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 Signed-off-by: Gustavo F. Padovan (cherry picked from commit 43629f8f5ea32a998d06d1bb41eefa0e821ff573) CVE-2011-1079 BugLink: http://bugs.launchpad.net/bugs/816544 Signed-off-by: Andy Whitcroft --- 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 sockfd_put(nsock); return -EBADFD; } + ca.device[sizeof(ca.device)-1] = 0; err = bnep_add_connection(&ca, nsock); if (!err) {