diff options
author | Jiri Kosina <jkosina@suse.cz> | 2014-08-21 16:57:48 +0200 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2014-08-21 17:43:28 +0200 |
commit | 4ab25786c87eb20857bbb715c3ae34ec8fd6a214 (patch) | |
tree | a1f0b37bd3f77e369398df733e76c222f0a8f86d /drivers/hid/hid-kye.c | |
parent | HID: logitech: perform bounds checking on device_id early enough (diff) | |
download | linux-4ab25786c87eb20857bbb715c3ae34ec8fd6a214.tar.xz linux-4ab25786c87eb20857bbb715c3ae34ec8fd6a214.zip |
HID: fix a couple of off-by-ones
There are a few very theoretical off-by-one bugs in report descriptor size
checking when performing a pre-parsing fixup. Fix those.
Cc: stable@vger.kernel.org
Reported-by: Ben Hawkes <hawkes@google.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/hid-kye.c')
-rw-r--r-- | drivers/hid/hid-kye.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hid/hid-kye.c b/drivers/hid/hid-kye.c index e77696367591..b92bf01a1ae8 100644 --- a/drivers/hid/hid-kye.c +++ b/drivers/hid/hid-kye.c @@ -300,7 +300,7 @@ static __u8 *kye_report_fixup(struct hid_device *hdev, __u8 *rdesc, * - change the button usage range to 4-7 for the extra * buttons */ - if (*rsize >= 74 && + if (*rsize >= 75 && rdesc[61] == 0x05 && rdesc[62] == 0x08 && rdesc[63] == 0x19 && rdesc[64] == 0x08 && rdesc[65] == 0x29 && rdesc[66] == 0x0f && |