]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
HID: core: prevent out-of-bound readings
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>
Tue, 19 Jan 2016 11:34:58 +0000 (12:34 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 23 Feb 2017 03:54:45 +0000 (03:54 +0000)
commite137da9c2207aa45c353b224a12b1cecfdcb54cb
treebe7da18c8c10ea1e1bae4b5a9c966b9175f71eab
parent0fbed614ccd7ab27d77bc129a9d8539181d7d275
HID: core: prevent out-of-bound readings

commit 50220dead1650609206efe91f0cc116132d59b3f upstream.

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@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/hid/hid-core.c