From c958c901a8b6db53567e467f81dbff943de81d87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Wed, 20 Jul 2016 13:48:15 +0200 Subject: [PATCH] Fix HID fix backport --- ...fix-out-of-bound-access-in-extract-and-implement.patch | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/patches.backports/0001-HID-fix-out-of-bound-access-in-extract-and-implement.patch b/patches.backports/0001-HID-fix-out-of-bound-access-in-extract-and-implement.patch index 53fa62b..6843b8a 100644 --- a/patches.backports/0001-HID-fix-out-of-bound-access-in-extract-and-implement.patch +++ b/patches.backports/0001-HID-fix-out-of-bound-access-in-extract-and-implement.patch @@ -42,7 +42,7 @@ index 7e89288..16c2c66 100644 * Search linux-kernel and linux-usb-devel archives for "hid-core extract". */ --__u32 hid_field_extract(const struct hid_device *hid, __u8 *report, +-static __u32 extract(const struct hid_device *hid, __u8 *report, - unsigned offset, unsigned n) -{ - u64 x; @@ -68,11 +68,11 @@ index 7e89288..16c2c66 100644 +} - if (n > 32) -+u32 hid_field_extract(const struct hid_device *hid, u8 *report, ++static u32 extract(const struct hid_device *hid, u8 *report, + unsigned offset, unsigned n) +{ + if (n > 32) { - hid_warn(hid, "hid_field_extract() called with n (%d) > 32! (%s)\n", + hid_warn(hid, "extract() called with n (%d) > 32! (%s)\n", n, current->comm); + n = 32; + } @@ -84,8 +84,8 @@ index 7e89288..16c2c66 100644 - return (u32) x; + return __extract(report, offset, n); } - EXPORT_SYMBOL_GPL(hid_field_extract); + /* @@ -1106,31 +1123,56 @@ EXPORT_SYMBOL_GPL(hid_field_extract); * The data mangled in the bit stream remains in little endian * order the whole time. It make more sense to talk about