diff mbox

HID: reject input outside logical range only if null state is set

Message ID 01431f646f00a0ce0995e07578b61bae@be13.mail.saunalahti.fi
State New, archived
Delegated to: Jiri Kosina
Headers show

Commit Message

rnd@nic.fi Oct. 13, 2015, 5:59 a.m. UTC
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>



--
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

Comments

Jiri Kosina Oct. 21, 2015, 11:28 a.m. UTC | #1
On Tue, 13 Oct 2015, rnd@nic.fi wrote:

> 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)) {

Your patch has been corrupted by your mailer badly. Please try to fix it 
(some hints are in Documentation/email-clients.txt) and resubmit.

Thanks,
diff mbox

Patch

--- 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)) {