summaryrefslogtreecommitdiffstats
path: root/recipes-kernel/linux/files/HID_CVE_patches/0004-HID-sony-validate-HID-output-report-details.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-kernel/linux/files/HID_CVE_patches/0004-HID-sony-validate-HID-output-report-details.patch')
-rw-r--r--recipes-kernel/linux/files/HID_CVE_patches/0004-HID-sony-validate-HID-output-report-details.patch43
1 files changed, 0 insertions, 43 deletions
diff --git a/recipes-kernel/linux/files/HID_CVE_patches/0004-HID-sony-validate-HID-output-report-details.patch b/recipes-kernel/linux/files/HID_CVE_patches/0004-HID-sony-validate-HID-output-report-details.patch
deleted file mode 100644
index 3a4e843..0000000
--- a/recipes-kernel/linux/files/HID_CVE_patches/0004-HID-sony-validate-HID-output-report-details.patch
+++ /dev/null
@@ -1,43 +0,0 @@
1From 9446edb9a1740989cf6c20daf7510fb9a23be14a Mon Sep 17 00:00:00 2001
2From: Kees Cook <keescook@chromium.org>
3Date: Wed, 11 Sep 2013 21:56:52 +0200
4Subject: [PATCH] HID: sony: validate HID output report details
5
6This driver must validate the availability of the HID output report and
7its size before it can write LED states via buzz_set_leds(). This stops
8a heap overflow that is possible if a device provides a malicious HID
9output report:
10
11[ 108.171280] usb 1-1: New USB device found, idVendor=054c, idProduct=0002
12...
13[ 117.507877] BUG kmalloc-192 (Not tainted): Redzone overwritten
14
15CVE-2013-2890
16
17Signed-off-by: Kees Cook <keescook@chromium.org>
18Cc: stable@vger.kernel.org #3.11
19Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
20Signed-off-by: Jiri Kosina <jkosina@suse.cz>
21Signed-off-by: Adrian Dudau <adrian.dudau@enea.com>
22---
23 drivers/hid/hid-sony.c | 4 ++++
24 1 file changed, 4 insertions(+)
25
26diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c
27index 30dbb6b..b18320d 100644
28--- a/drivers/hid/hid-sony.c
29+++ b/drivers/hid/hid-sony.c
30@@ -537,6 +537,10 @@ static int buzz_init(struct hid_device *hdev)
31 drv_data = hid_get_drvdata(hdev);
32 BUG_ON(!(drv_data->quirks & BUZZ_CONTROLLER));
33
34+ /* Validate expected report characteristics. */
35+ if (!hid_validate_values(hdev, HID_OUTPUT_REPORT, 0, 0, 7))
36+ return -ENODEV;
37+
38 buzz = kzalloc(sizeof(*buzz), GFP_KERNEL);
39 if (!buzz) {
40 hid_err(hdev, "Insufficient memory, cannot allocate driver data\n");
41--
421.7.9.5
43