]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.9.175/bluetooth-hidp-fix-buffer-overflow.patch
Linux 4.9.175
[thirdparty/kernel/stable-queue.git] / releases / 4.9.175 / bluetooth-hidp-fix-buffer-overflow.patch
CommitLineData
9fe8a919
GKH
1From a1616a5ac99ede5d605047a9012481ce7ff18b16 Mon Sep 17 00:00:00 2001
2From: Young Xiao <YangX92@hotmail.com>
3Date: Fri, 12 Apr 2019 15:24:30 +0800
4Subject: Bluetooth: hidp: fix buffer overflow
5
6From: Young Xiao <YangX92@hotmail.com>
7
8commit a1616a5ac99ede5d605047a9012481ce7ff18b16 upstream.
9
10Struct ca is copied from userspace. It is not checked whether the "name"
11field is NULL terminated, which allows local users to obtain potentially
12sensitive information from kernel stack memory, via a HIDPCONNADD command.
13
14This vulnerability is similar to CVE-2011-1079.
15
16Signed-off-by: Young Xiao <YangX92@hotmail.com>
17Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
18Cc: stable@vger.kernel.org
19Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
20
21---
22 net/bluetooth/hidp/sock.c | 1 +
23 1 file changed, 1 insertion(+)
24
25--- a/net/bluetooth/hidp/sock.c
26+++ b/net/bluetooth/hidp/sock.c
27@@ -76,6 +76,7 @@ static int hidp_sock_ioctl(struct socket
28 sockfd_put(csock);
29 return err;
30 }
31+ ca.name[sizeof(ca.name)-1] = 0;
32
33 err = hidp_connection_add(&ca, csock, isock);
34 if (!err && copy_to_user(argp, &ca, sizeof(ca)))