]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
Bluetooth: hidp: fix buffer overflow
authorYoung Xiao <YangX92@hotmail.com>
Fri, 7 Jun 2019 22:16:49 +0000 (15:16 -0700)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Mon, 24 Jun 2019 14:21:33 +0000 (16:21 +0200)
CVE-2019-11884

Struct ca is copied from userspace. It is not checked whether the "name"
field is NULL terminated, which allows local users to obtain potentially
sensitive information from kernel stack memory, via a HIDPCONNADD command.

This vulnerability is similar to CVE-2011-1079.

Signed-off-by: Young Xiao <YangX92@hotmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Cc: stable@vger.kernel.org
(cherry picked from commit a1616a5ac99ede5d605047a9012481ce7ff18b16)
Signed-off-by: Connor Kuehl <connor.kuehl@canonical.com>
Acked-by: Kamal Mostafa <kamal@canonical.com>
Acked-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Po-Hsu Lin <po-hsu.lin@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
net/bluetooth/hidp/sock.c

index 008ba439bd62ae2e55a7ff92900ebb88339d67d1..cc80c76177b6e3f5e3343c758ebc462eee201fae 100644 (file)
@@ -76,6 +76,7 @@ static int hidp_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long
                        sockfd_put(csock);
                        return err;
                }
+               ca.name[sizeof(ca.name)-1] = 0;
 
                err = hidp_connection_add(&ca, csock, isock);
                if (!err && copy_to_user(argp, &ca, sizeof(ca)))