summaryrefslogtreecommitdiffstats
path: root/recipes-kernel/linux/files/HID_CVE_patches/0008-HID-lenovo-tpkbd-validate-output-report-details.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-kernel/linux/files/HID_CVE_patches/0008-HID-lenovo-tpkbd-validate-output-report-details.patch')
-rw-r--r--recipes-kernel/linux/files/HID_CVE_patches/0008-HID-lenovo-tpkbd-validate-output-report-details.patch48
1 files changed, 0 insertions, 48 deletions
diff --git a/recipes-kernel/linux/files/HID_CVE_patches/0008-HID-lenovo-tpkbd-validate-output-report-details.patch b/recipes-kernel/linux/files/HID_CVE_patches/0008-HID-lenovo-tpkbd-validate-output-report-details.patch
deleted file mode 100644
index 1c53d77..0000000
--- a/recipes-kernel/linux/files/HID_CVE_patches/0008-HID-lenovo-tpkbd-validate-output-report-details.patch
+++ /dev/null
@@ -1,48 +0,0 @@
1From 0a9cd0a80ac559357c6a90d26c55270ed752aa26 Mon Sep 17 00:00:00 2001
2From: Kees Cook <keescook@chromium.org>
3Date: Wed, 11 Sep 2013 21:56:55 +0200
4Subject: [PATCH] HID: lenovo-tpkbd: validate output report details
5
6A HID device could send a malicious output report that would cause the
7lenovo-tpkbd HID driver to write just beyond the output report allocation
8during initialization, causing a heap overflow:
9
10[ 76.109807] usb 1-1: New USB device found, idVendor=17ef, idProduct=6009
11...
12[ 80.462540] BUG kmalloc-192 (Tainted: G W ): Redzone overwritten
13
14CVE-2013-2894
15
16Signed-off-by: Kees Cook <keescook@chromium.org>
17Cc: stable@vger.kernel.org
18Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
19Signed-off-by: Jiri Kosina <jkosina@suse.cz>
20Signed-off-by: Adrian Dudau <adrian.dudau@enea.com>
21---
22 drivers/hid/hid-lenovo-tpkbd.c | 10 +++++++++-
23 1 file changed, 9 insertions(+), 1 deletion(-)
24
25diff --git a/drivers/hid/hid-lenovo-tpkbd.c b/drivers/hid/hid-lenovo-tpkbd.c
26index 07837f5..762d988 100644
27--- a/drivers/hid/hid-lenovo-tpkbd.c
28+++ b/drivers/hid/hid-lenovo-tpkbd.c
29@@ -339,7 +339,15 @@ static int tpkbd_probe_tp(struct hid_device *hdev)
30 struct tpkbd_data_pointer *data_pointer;
31 size_t name_sz = strlen(dev_name(dev)) + 16;
32 char *name_mute, *name_micmute;
33- int ret;
34+ int i, ret;
35+
36+ /* Validate required reports. */
37+ for (i = 0; i < 4; i++) {
38+ if (!hid_validate_values(hdev, HID_FEATURE_REPORT, 4, i, 1))
39+ return -ENODEV;
40+ }
41+ if (!hid_validate_values(hdev, HID_OUTPUT_REPORT, 3, 0, 2))
42+ return -ENODEV;
43
44 if (sysfs_create_group(&hdev->dev.kobj,
45 &tpkbd_attr_group_pointer)) {
46--
471.7.9.5
48