From: Benjamin Tissoires <benjamin.tissoires@redhat.com>
To: Jiri Kosina <jikos@kernel.org>,
Hans de Goede <hdegoede@redhat.com>,
Dave Hansen <dave.hansen@intel.com>,
Kai-Heng Feng <kai.heng.feng@canonical.com>
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
Benjamin Tissoires <benjamin.tissoires@redhat.com>,
stable@vger.kernel.org
Subject: [PATCH 1/4] Revert "HID: Increase maximum report size allowed by hid_field_extract()"
Date: Wed, 5 Jun 2019 14:44:05 +0200 [thread overview]
Message-ID: <20190605124408.8637-2-benjamin.tissoires@redhat.com> (raw)
In-Reply-To: <20190605124408.8637-1-benjamin.tissoires@redhat.com>
This reverts commit 94a9992f7dbdfb28976b565af220e0c4a117144a.
The commit allows for more than 32 bits in hid_field_extract(),
but the return value is a 32 bits int.
So basically what this commit is doing is just silencing those
legitimate errors.
Revert to a previous situation in the hope that a proper
fix will be impletemented.
Fixes: 94a9992f7dbd ("HID: Increase maximum report size allowed by hid_field_extract()")
Cc: stable@vger.kernel.org # v5.1
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
---
drivers/hid/hid-core.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index 08d310723e96..205d6b82a706 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -1311,10 +1311,10 @@ static u32 __extract(u8 *report, unsigned offset, int n)
u32 hid_field_extract(const struct hid_device *hid, u8 *report,
unsigned offset, unsigned n)
{
- if (n > 256) {
- hid_warn(hid, "hid_field_extract() called with n (%d) > 256! (%s)\n",
+ if (n > 32) {
+ hid_warn(hid, "hid_field_extract() called with n (%d) > 32! (%s)\n",
n, current->comm);
- n = 256;
+ n = 32;
}
return __extract(report, offset, n);
--
2.19.2
next prev parent reply other threads:[~2019-06-05 12:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-05 12:44 [PATCH 0/4] few reverts and fixes for 5.2 Benjamin Tissoires
2019-06-05 12:44 ` Benjamin Tissoires [this message]
2019-06-05 12:44 ` [PATCH 2/4] Revert "HID: core: Do not call request_module() in async context" Benjamin Tissoires
2019-06-05 12:44 ` [PATCH 3/4] Revert "HID: core: Call request_module before doing device_add" Benjamin Tissoires
2019-06-05 12:44 ` [PATCH 4/4] HID: logitech-dj: Fix 064d:c52f receiver support Benjamin Tissoires
2019-06-05 13:07 ` [PATCH 0/4] few reverts and fixes for 5.2 Jiri Kosina
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190605124408.8637-2-benjamin.tissoires@redhat.com \
--to=benjamin.tissoires@redhat.com \
--cc=dave.hansen@intel.com \
--cc=hdegoede@redhat.com \
--cc=jikos@kernel.org \
--cc=kai.heng.feng@canonical.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).