linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: rnd@nic.fi
To: linux-input@vger.kernel.org
Cc: jikos@kernel.org
Subject: [PATCH] HID: reject input outside logical range only if null state is set
Date: Tue, 13 Oct 2015 08:59:32 +0300	[thread overview]
Message-ID: <01431f646f00a0ce0995e07578b61bae@be13.mail.saunalahti.fi> (raw)

Kernel 3.19.0 one-line fix for an issue in drivers/hid/hid-input.c where 
USB HID control null state flag is not checked when rejecting inputs 
outside logical minimum-maximum range. The check should be made as per 
USB HID specification 1.11, section 6.2.2.5, p.31. I have no resources 
for large-scale testing, but this fixes problems with the game 
controller I have (INNEX NES Controller USB).

More details: https://bugzilla.kernel.org/show_bug.cgi?id=68621


Signed-Off-by: Valtteri Heikkilä <rnd@nic.fi>
--- a/drivers/hid/hid-input.c 2015-05-25 09:58:49.743527141 +0800
+++ b/drivers/hid/hid-input.c 2015-05-25 11:04:13.201191432 +0800
@@ -1097,6 +1097,7 @@
* don't specify logical min and max.
*/
if ((field->flags & HID_MAIN_ITEM_VARIABLE) &&
+ (field->flags & HID_MAIN_ITEM_NULL_STATE) &&
(field->logical_minimum < field->logical_maximum) &&
(value < field->logical_minimum ||
value > field->logical_maximum)) {



--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

             reply	other threads:[~2015-10-13  6:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-13  5:59 rnd [this message]
2015-10-21 11:28 ` [PATCH] HID: reject input outside logical range only if null state is set 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=01431f646f00a0ce0995e07578b61bae@be13.mail.saunalahti.fi \
    --to=rnd@nic.fi \
    --cc=jikos@kernel.org \
    --cc=linux-input@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).