Bug 75517 - USB HID driver mishandles undefined usage
Summary: USB HID driver mishandles undefined usage
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: kernel
Version: 7.3
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Pete Zaitcev
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-10-09 14:08 UTC by Mark Salter
Modified: 2008-08-01 16:22 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-09-30 15:40:02 UTC
Embargoed:


Attachments (Terms of Use)

Description Mark Salter 2002-10-09 14:08:35 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9) Gecko/20020513

Description of problem:
The USB driver code mishandles HID devices which have generic desktop undefined
usages. The undefined usage is mistaken for a button usage.
The device where I see this is an Elo TouchSystems Accutouch touchscreen with
USB interface.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1.plug in USB HID with a general desktop undefined usage. i.e. Elo AccutTouch 3000U.
2.Use evtest to check input event interface. A button is reported for the
undefined usage.
3.
	

Actual Results:  [root@localhost msalter]# evtest /dev/input/event0
Input driver version is 1.0.0
Input device ID: bus 0x3 vendor 0x4e7 product 0x8 version 0x101
Input device name: "Elo TouchSystems, Inc. Elo TouchSystems AccuTouch 3000U"
Supported events:
  Event type 1 (Key)
    Event code 272 (LeftBtn)
  Event type 3 (Absolute)
    Event code 0 (X)
      Value      0
      Min     -128
      Max      127
      Flat      15
    Event code 1 (Y)
      Value   3065
      Min      184
      Max     3932
      Fuzz      14
      Flat     234
    Event code 2 (Z)
      Value   3204
      Min      184
      Max     3932
      Fuzz      14
      Flat     234
    Event code 11 (?)
      Value      0
      Min        0
      Max      256
      Fuzz       1
      Flat      16


Expected Results:  [root@localhost msalter]# evtest /dev/input/event0
Input driver version is 1.0.0
Input device ID: bus 0x3 vendor 0x4e7 product 0x8 version 0x101
Input device name: "Elo TouchSystems, Inc. Elo TouchSystems AccuTouch 3000U"
Supported events:
  Event type 1 (Key)
    Event code 272 (LeftBtn)
  Event type 3 (Absolute)
    Event code 0 (X)
      Value      0
      Min      184
      Max     3932
      Fuzz      14
      Flat     234
    Event code 1 (Y)
      Value      0
      Min      184
      Max     3932
      Fuzz      14
      Flat     234
    Event code 11 (?)
      Value      0
      Min        0
      Max      256
      Fuzz       1
      Flat      16


Additional info:

The following patch corrects the problem:

diff -rup kernel-2.4.18.orig/linux/drivers/usb/hid-input.c
kernel-2.4.18/linux/drivers/usb/hid-input.c
--- kernel-2.4.18.orig/linux/drivers/usb/hid-input.c	Sun Nov 11 13:09:37 2001
+++ kernel-2.4.18/linux/drivers/usb/hid-input.c	Tue Oct  8 13:41:51 2002
@@ -103,6 +103,10 @@ static void hidinput_configure_usage(str
 
 
	case HID_UP_GENDESK:
 
+
		/* ignore undefined usage */
+
	        if ((usage->hid & 0xffff) == 0x0000)
+
		    	return;
+
 
		if ((usage->hid & 0xf0) == 0x80) {	/* SystemControl */
 
			switch (usage->hid & 0xf) {
 
				case 0x1: usage->code = KEY_POWER;  break;

Comment 1 Vojtech Pavlik 2004-01-23 09:19:04 UTC
Hmm,

there is something weird with this bug report - you're reporting
that there is an extra button in evtest results, yet the two
examples of evtest results (actual and expected) differ by the
presence of the Z axis.

So is it the Z axis that's extra.

A descriptor dump would help a lot here.

(And yes, there is a problem with handling values in reports that
 don't have an usage attached to them, causing possibly an oops.
 It should be fixed in my BK tree at
               bk://kernel.bkbits.org/vojtech/input
 However, it will actually create more input mappings than before.)

Comment 2 Pete Zaitcev 2004-04-19 18:42:10 UTC
Vojtech, how do they generate a descriptor dump, for future reference?
Obviously, lsusb cannot show hid descriptors.

Comment 3 Bugzilla owner 2004-09-30 15:40:02 UTC
Thanks for the bug report. However, Red Hat no longer maintains this version of
the product. Please upgrade to the latest version and open a new bug if the problem
persists.

The Fedora Legacy project (http://fedoralegacy.org/) maintains some older releases, 
and if you believe this bug is interesting to them, please report the problem in
the bug tracker at: http://bugzilla.fedora.us/



Note You need to log in before you can comment on or make changes to this bug.