From patchwork Tue Jul 26 18:51:12 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [hardy,CVE,1/1] Bluetooth: bnep: fix buffer overflow Date: Tue, 26 Jul 2011 08:51:12 -0000 From: Andy Whitcroft X-Patchwork-Id: 106907 Message-Id: <1311706273-14191-2-git-send-email-apw@canonical.com> To: kernel-team@lists.ubuntu.com 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 9ebd3c6..7d31198 100644 --- a/net/bluetooth/bnep/sock.c +++ b/net/bluetooth/bnep/sock.c @@ -97,6 +97,7 @@ static int bnep_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long fput(nsock->file); return -EBADFD; } + ca.device[sizeof(ca.device)-1] = 0; err = bnep_add_connection(&ca, nsock); if (!err) {