[linux] 06/10: HID: core: prevent out-of-bound readings (CVE-2016-7915)

debian-kernel at lists.debian.org debian-kernel at lists.debian.org
Wed Dec 28 20:44:02 UTC 2016


This is an automated email from the git hooks/post-receive script.

benh pushed a commit to branch wheezy-security
in repository linux.

commit 830f2dc3b9f2f2e062d99388a4d6a6aeb5276874
Author: Ben Hutchings <ben at decadent.org.uk>
Date:   Wed Dec 28 16:48:29 2016 +0000

    HID: core: prevent out-of-bound readings (CVE-2016-7915)
---
 debian/changelog                                   |  1 +
 .../hid-core-prevent-out-of-bound-readings.patch   | 43 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 3 files changed, 45 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index dbe88b5..61fce58 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -107,6 +107,7 @@ linux (3.2.84-1) UNRELEASED; urgency=medium
   * isdn/gigaset: reset tty->receive_room when attaching ser_gigaset
   * tty: Prevent ldisc drivers from re-using stale tty fields (CVE-2015-8964)
   * block: fix use-after-free in sys_ioprio_get() (CVE-2016-7911)
+  * HID: core: prevent out-of-bound readings (CVE-2016-7915)
 
  -- Ben Hutchings <ben at decadent.org.uk>  Mon, 28 Nov 2016 18:43:52 +0000
 
diff --git a/debian/patches/bugfix/all/hid-core-prevent-out-of-bound-readings.patch b/debian/patches/bugfix/all/hid-core-prevent-out-of-bound-readings.patch
new file mode 100644
index 0000000..6ef059d
--- /dev/null
+++ b/debian/patches/bugfix/all/hid-core-prevent-out-of-bound-readings.patch
@@ -0,0 +1,43 @@
+From: Benjamin Tissoires <benjamin.tissoires at redhat.com>
+Date: Tue, 19 Jan 2016 12:34:58 +0100
+Subject: HID: core: prevent out-of-bound readings
+Origin: https://git.kernel.org/linus/50220dead1650609206efe91f0cc116132d59b3f
+Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2016-7915
+
+Plugging a Logitech DJ receiver with KASAN activated raises a bunch of
+out-of-bound readings.
+
+The fields are allocated up to MAX_USAGE, meaning that potentially, we do
+not have enough fields to fit the incoming values.
+Add checks and silence KASAN.
+
+Signed-off-by: Benjamin Tissoires <benjamin.tissoires at redhat.com>
+Signed-off-by: Jiri Kosina <jkosina at suse.cz>
+---
+ drivers/hid/hid-core.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/drivers/hid/hid-core.c
++++ b/drivers/hid/hid-core.c
+@@ -989,6 +989,7 @@ static void hid_input_field(struct hid_d
+ 		/* Ignore report if ErrorRollOver */
+ 		if (!(field->flags & HID_MAIN_ITEM_VARIABLE) &&
+ 		    value[n] >= min && value[n] <= max &&
++		    value[n] - min < field->maxusage &&
+ 		    field->usage[value[n] - min].hid == HID_UP_KEYBOARD + 1)
+ 			goto exit;
+ 	}
+@@ -1001,11 +1002,13 @@ static void hid_input_field(struct hid_d
+ 		}
+ 
+ 		if (field->value[n] >= min && field->value[n] <= max
++			&& field->value[n] - min < field->maxusage
+ 			&& field->usage[field->value[n] - min].hid
+ 			&& search(value, field->value[n], count))
+ 				hid_process_event(hid, field, &field->usage[field->value[n] - min], 0, interrupt);
+ 
+ 		if (value[n] >= min && value[n] <= max
++			&& value[n] - min < field->maxusage
+ 			&& field->usage[value[n] - min].hid
+ 			&& search(field->value, value[n], count))
+ 				hid_process_event(hid, field, &field->usage[value[n] - min], 1, interrupt);
diff --git a/debian/patches/series b/debian/patches/series
index 179b91d..b2b1ec6 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1112,6 +1112,7 @@ bugfix/all/perf-fix-race-in-swevent-hash.patch
 bugfix/all/isdn-gigaset-reset-tty-receive_room-when-attaching-s.patch
 bugfix/all/tty-prevent-ldisc-drivers-from-re-using-stale-tty-fi.patch
 bugfix/all/block-fix-use-after-free-in-sys_ioprio_get.patch
+bugfix/all/hid-core-prevent-out-of-bound-readings.patch
 
 # ABI maintenance
 debian/perf-hide-abi-change-in-3.2.30.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/kernel/linux.git



More information about the Kernel-svn-changes mailing list