<feed xmlns='http://www.w3.org/2005/Atom'>
<title>BMC/Intel-BMC/linux.git/drivers/hid/usbhid/hiddev.c, branch dev</title>
<subtitle>Intel OpenBMC Linux kernel source tree (mirror)</subtitle>
<id>https://git.radix-linux.su/BMC/Intel-BMC/linux.git/atom?h=dev</id>
<link rel='self' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/atom?h=dev'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/'/>
<updated>2013-02-25T12:26:41+00:00</updated>
<entry>
<title>HID: use hid_hw_wait() instead of direct call to usbhid</title>
<updated>2013-02-25T12:26:41+00:00</updated>
<author>
<name>Benjamin Tissoires</name>
<email>benjamin.tissoires@gmail.com</email>
</author>
<published>2013-02-25T10:31:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=b7966a4d7be0a10329f03330390f4bdaf453d74a'/>
<id>urn:sha1:b7966a4d7be0a10329f03330390f4bdaf453d74a</id>
<content type='text'>
This removes most of the dependencies between hid drivers and usbhid.

The patch was constructed by replacing all occurences of
usbhid_wait_io() by its hid_hw_wait() counterpart.
Then, drivers not requiring USB_HID anymore have their USB_HID
dependency cleaned in the Kconfig file.

As of today, few drivers are still requiring an explicit USB layer
dependency:
* ntrig (a patch is on its way)
* multitouch (one patch following and another on its way)
* lenovo tpkbd
* roccat
* sony

The last three are two deeply using direct calls to the usb subsystem
to be able to be cleaned right now.

Signed-off-by: Benjamin Tissoires &lt;benjamin.tissoires@gmail.com&gt;
Reviewed-by: Mika Westerberg &lt;mika.westerberg@linux.intel.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
<entry>
<title>HID: use hid_hw_request() instead of direct call to usbhid</title>
<updated>2013-02-25T12:26:41+00:00</updated>
<author>
<name>Benjamin Tissoires</name>
<email>benjamin.tissoires@gmail.com</email>
</author>
<published>2013-02-25T10:31:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=d881427253da011495f4193663d809d0e9dfa215'/>
<id>urn:sha1:d881427253da011495f4193663d809d0e9dfa215</id>
<content type='text'>
This allows the hid drivers to be independent from the transport layer.

The patch was constructed by replacing all occurences of
usbhid_submit_report() by its hid_hw_request() counterpart.
Then, drivers not requiring USB_HID anymore have their USB_HID
dependency cleaned in the Kconfig file.

Finally, few drivers still depends on USB_HID. Many of them
are requiring the io wait callback. They are found in the next patch.

Signed-off-by: Benjamin Tissoires &lt;benjamin.tissoires@gmail.com&gt;
Reviewed-by: Mika Westerberg &lt;mika.westerberg@linux.intel.com&gt;

For the sensor-hub part:
Tested-by: Mika Westerberg &lt;mika.westerberg@linux.intel.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
<entry>
<title>HID: hiddev: fix nonblocking read semantics wrt EIO/ERESTARTSYS</title>
<updated>2012-11-27T23:10:44+00:00</updated>
<author>
<name>Jiri Kosina</name>
<email>jkosina@suse.cz</email>
</author>
<published>2012-11-27T23:10:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=13f19624029f43f5d0f98a96a9e6ba4d38da96a9'/>
<id>urn:sha1:13f19624029f43f5d0f98a96a9e6ba4d38da96a9</id>
<content type='text'>
When the file has been open in non-blocking mode, EIO or ERESTARTSYS
would never be returned even if they should (for example when device
has been unplugged, you want EIO and not EAGAIN to be returned).

Move the O_NONBLOCK check after other checks have been performed.

Base on similar patch done to hidraw by
Founder Fang &lt;founder.fang@gmail.com&gt;

Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
<entry>
<title>HID: hiddev: Remove redundant check on unsigned variable</title>
<updated>2012-11-16T09:26:23+00:00</updated>
<author>
<name>Tushar Behera</name>
<email>tushar.behera@linaro.org</email>
</author>
<published>2012-11-16T06:50:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=d339f61d14692517e9ba5a977fc266769d6c5c28'/>
<id>urn:sha1:d339f61d14692517e9ba5a977fc266769d6c5c28</id>
<content type='text'>
No need to check whether unsigned variable is less than 0.

CC: Jiri Kosina &lt;jkosina@suse.cz&gt;
CC: linux-usb@vger.kernel.org
CC: linux-input@vger.kernel.org
Signed-off-by: Tushar Behera &lt;tushar.behera@linaro.org&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
<entry>
<title>HID: hiddev: Use vzalloc to allocate hiddev_list</title>
<updated>2012-04-27T14:03:40+00:00</updated>
<author>
<name>Havard Skinnemoen</name>
<email>hskinnemoen@google.com</email>
</author>
<published>2012-04-26T18:16:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=d4f0e4daf0d867f80c78ca4f9ac03a562e229e72'/>
<id>urn:sha1:d4f0e4daf0d867f80c78ca4f9ac03a562e229e72</id>
<content type='text'>
Everytime a HID device is opened, a new hiddev_list is allocated with
kzalloc. This requires 64KB of physically contiguous memory, which could
easily push a heavily loaded system over the edge.

Allocating the same amount of memory with vmalloc shouldn't be nearly as
demanding, so let's do that instead. The memory isn't used for DMA and
doesn't look particularly performance sensitive, so this should be safe.

Signed-off-by: Havard Skinnemoen &lt;hskinnemoen@google.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
<entry>
<title>HID: usbhid: fix dead lock between open and disconect</title>
<updated>2012-02-02T08:48:00+00:00</updated>
<author>
<name>Ming Lei</name>
<email>tom.leiming@gmail.com</email>
</author>
<published>2012-01-12T09:42:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=ba18311dff7933ccb9c41bbbb1ad3d70840069b5'/>
<id>urn:sha1:ba18311dff7933ccb9c41bbbb1ad3d70840069b5</id>
<content type='text'>
There is no reason to hold hiddev-&gt;existancelock before
calling usb_deregister_dev, so move it out of the lock.

The patch fixes the lockdep warning below.

[ 5733.386271] ======================================================
[ 5733.386274] [ INFO: possible circular locking dependency detected ]
[ 5733.386278] 3.2.0-custom-next-20120111+ #1 Not tainted
[ 5733.386281] -------------------------------------------------------
[ 5733.386284] khubd/186 is trying to acquire lock:
[ 5733.386288]  (minor_rwsem){++++.+}, at: [&lt;ffffffffa0011a04&gt;] usb_deregister_dev+0x37/0x9e [usbcore]
[ 5733.386311]
[ 5733.386312] but task is already holding lock:
[ 5733.386315]  (&amp;hiddev-&gt;existancelock){+.+...}, at: [&lt;ffffffffa0094d17&gt;] hiddev_disconnect+0x26/0x87 [usbhid]
[ 5733.386328]
[ 5733.386329] which lock already depends on the new lock.
[ 5733.386330]
[ 5733.386333]
[ 5733.386334] the existing dependency chain (in reverse order) is:
[ 5733.386336]
[ 5733.386337] -&gt; #1 (&amp;hiddev-&gt;existancelock){+.+...}:
[ 5733.386346]        [&lt;ffffffff81082d26&gt;] lock_acquire+0xcb/0x10e
[ 5733.386357]        [&lt;ffffffff813df961&gt;] __mutex_lock_common+0x60/0x465
[ 5733.386366]        [&lt;ffffffff813dfe4d&gt;] mutex_lock_nested+0x36/0x3b
[ 5733.386371]        [&lt;ffffffffa0094ad6&gt;] hiddev_open+0x113/0x193 [usbhid]
[ 5733.386378]        [&lt;ffffffffa0011971&gt;] usb_open+0x66/0xc2 [usbcore]
[ 5733.386390]        [&lt;ffffffff8111a8b5&gt;] chrdev_open+0x12b/0x154
[ 5733.386402]        [&lt;ffffffff811159a8&gt;] __dentry_open.isra.16+0x20b/0x355
[ 5733.386408]        [&lt;ffffffff811165dc&gt;] nameidata_to_filp+0x43/0x4a
[ 5733.386413]        [&lt;ffffffff81122ed5&gt;] do_last+0x536/0x570
[ 5733.386419]        [&lt;ffffffff8112300b&gt;] path_openat+0xce/0x301
[ 5733.386423]        [&lt;ffffffff81123327&gt;] do_filp_open+0x33/0x81
[ 5733.386427]        [&lt;ffffffff8111664d&gt;] do_sys_open+0x6a/0xfc
[ 5733.386431]        [&lt;ffffffff811166fb&gt;] sys_open+0x1c/0x1e
[ 5733.386434]        [&lt;ffffffff813e7c79&gt;] system_call_fastpath+0x16/0x1b
[ 5733.386441]
[ 5733.386441] -&gt; #0 (minor_rwsem){++++.+}:
[ 5733.386448]        [&lt;ffffffff8108255d&gt;] __lock_acquire+0xa80/0xd74
[ 5733.386454]        [&lt;ffffffff81082d26&gt;] lock_acquire+0xcb/0x10e
[ 5733.386458]        [&lt;ffffffff813e01f5&gt;] down_write+0x44/0x77
[ 5733.386464]        [&lt;ffffffffa0011a04&gt;] usb_deregister_dev+0x37/0x9e [usbcore]
[ 5733.386475]        [&lt;ffffffffa0094d2d&gt;] hiddev_disconnect+0x3c/0x87 [usbhid]
[ 5733.386483]        [&lt;ffffffff8132df51&gt;] hid_disconnect+0x3f/0x54
[ 5733.386491]        [&lt;ffffffff8132dfb4&gt;] hid_device_remove+0x4e/0x7a
[ 5733.386496]        [&lt;ffffffff812c0957&gt;] __device_release_driver+0x81/0xcd
[ 5733.386502]        [&lt;ffffffff812c09c3&gt;] device_release_driver+0x20/0x2d
[ 5733.386507]        [&lt;ffffffff812c0564&gt;] bus_remove_device+0x114/0x128
[ 5733.386512]        [&lt;ffffffff812bdd6f&gt;] device_del+0x131/0x183
[ 5733.386519]        [&lt;ffffffff8132def3&gt;] hid_destroy_device+0x1e/0x3d
[ 5733.386525]        [&lt;ffffffffa00916b0&gt;] usbhid_disconnect+0x36/0x42 [usbhid]
[ 5733.386530]        [&lt;ffffffffa000fb60&gt;] usb_unbind_interface+0x57/0x11f [usbcore]
[ 5733.386542]        [&lt;ffffffff812c0957&gt;] __device_release_driver+0x81/0xcd
[ 5733.386547]        [&lt;ffffffff812c09c3&gt;] device_release_driver+0x20/0x2d
[ 5733.386552]        [&lt;ffffffff812c0564&gt;] bus_remove_device+0x114/0x128
[ 5733.386557]        [&lt;ffffffff812bdd6f&gt;] device_del+0x131/0x183
[ 5733.386562]        [&lt;ffffffffa000de61&gt;] usb_disable_device+0xa8/0x1d8 [usbcore]
[ 5733.386573]        [&lt;ffffffffa0006bd2&gt;] usb_disconnect+0xab/0x11f [usbcore]
[ 5733.386583]        [&lt;ffffffffa0008aa0&gt;] hub_thread+0x73b/0x1157 [usbcore]
[ 5733.386593]        [&lt;ffffffff8105dc0f&gt;] kthread+0x95/0x9d
[ 5733.386601]        [&lt;ffffffff813e90b4&gt;] kernel_thread_helper+0x4/0x10
[ 5733.386607]
[ 5733.386608] other info that might help us debug this:
[ 5733.386609]
[ 5733.386612]  Possible unsafe locking scenario:
[ 5733.386613]
[ 5733.386615]        CPU0                    CPU1
[ 5733.386618]        ----                    ----
[ 5733.386620]   lock(&amp;hiddev-&gt;existancelock);
[ 5733.386625]                                lock(minor_rwsem);
[ 5733.386630]                                lock(&amp;hiddev-&gt;existancelock);
[ 5733.386635]   lock(minor_rwsem);
[ 5733.386639]
[ 5733.386640]  *** DEADLOCK ***
[ 5733.386641]
[ 5733.386644] 6 locks held by khubd/186:
[ 5733.386646]  #0:  (&amp;__lockdep_no_validate__){......}, at: [&lt;ffffffffa00084af&gt;] hub_thread+0x14a/0x1157 [usbcore]
[ 5733.386661]  #1:  (&amp;__lockdep_no_validate__){......}, at: [&lt;ffffffffa0006b77&gt;] usb_disconnect+0x50/0x11f [usbcore]
[ 5733.386677]  #2:  (hcd-&gt;bandwidth_mutex){+.+.+.}, at: [&lt;ffffffffa0006bc8&gt;] usb_disconnect+0xa1/0x11f [usbcore]
[ 5733.386693]  #3:  (&amp;__lockdep_no_validate__){......}, at: [&lt;ffffffff812c09bb&gt;] device_release_driver+0x18/0x2d
[ 5733.386704]  #4:  (&amp;__lockdep_no_validate__){......}, at: [&lt;ffffffff812c09bb&gt;] device_release_driver+0x18/0x2d
[ 5733.386714]  #5:  (&amp;hiddev-&gt;existancelock){+.+...}, at: [&lt;ffffffffa0094d17&gt;] hiddev_disconnect+0x26/0x87 [usbhid]
[ 5733.386727]
[ 5733.386727] stack backtrace:
[ 5733.386731] Pid: 186, comm: khubd Not tainted 3.2.0-custom-next-20120111+ #1
[ 5733.386734] Call Trace:
[ 5733.386741]  [&lt;ffffffff81062881&gt;] ? up+0x34/0x3b
[ 5733.386747]  [&lt;ffffffff813d9ef3&gt;] print_circular_bug+0x1f8/0x209
[ 5733.386752]  [&lt;ffffffff8108255d&gt;] __lock_acquire+0xa80/0xd74
[ 5733.386756]  [&lt;ffffffff810808b4&gt;] ? trace_hardirqs_on_caller+0x15d/0x1a3
[ 5733.386763]  [&lt;ffffffff81043a3f&gt;] ? vprintk+0x3f4/0x419
[ 5733.386774]  [&lt;ffffffffa0011a04&gt;] ? usb_deregister_dev+0x37/0x9e [usbcore]
[ 5733.386779]  [&lt;ffffffff81082d26&gt;] lock_acquire+0xcb/0x10e
[ 5733.386789]  [&lt;ffffffffa0011a04&gt;] ? usb_deregister_dev+0x37/0x9e [usbcore]
[ 5733.386797]  [&lt;ffffffff813e01f5&gt;] down_write+0x44/0x77
[ 5733.386807]  [&lt;ffffffffa0011a04&gt;] ? usb_deregister_dev+0x37/0x9e [usbcore]
[ 5733.386818]  [&lt;ffffffffa0011a04&gt;] usb_deregister_dev+0x37/0x9e [usbcore]
[ 5733.386825]  [&lt;ffffffffa0094d2d&gt;] hiddev_disconnect+0x3c/0x87 [usbhid]
[ 5733.386830]  [&lt;ffffffff8132df51&gt;] hid_disconnect+0x3f/0x54
[ 5733.386834]  [&lt;ffffffff8132dfb4&gt;] hid_device_remove+0x4e/0x7a
[ 5733.386839]  [&lt;ffffffff812c0957&gt;] __device_release_driver+0x81/0xcd
[ 5733.386844]  [&lt;ffffffff812c09c3&gt;] device_release_driver+0x20/0x2d
[ 5733.386848]  [&lt;ffffffff812c0564&gt;] bus_remove_device+0x114/0x128
[ 5733.386854]  [&lt;ffffffff812bdd6f&gt;] device_del+0x131/0x183
[ 5733.386859]  [&lt;ffffffff8132def3&gt;] hid_destroy_device+0x1e/0x3d
[ 5733.386865]  [&lt;ffffffffa00916b0&gt;] usbhid_disconnect+0x36/0x42 [usbhid]
[ 5733.386876]  [&lt;ffffffffa000fb60&gt;] usb_unbind_interface+0x57/0x11f [usbcore]
[ 5733.386882]  [&lt;ffffffff812c0957&gt;] __device_release_driver+0x81/0xcd
[ 5733.386886]  [&lt;ffffffff812c09c3&gt;] device_release_driver+0x20/0x2d
[ 5733.386890]  [&lt;ffffffff812c0564&gt;] bus_remove_device+0x114/0x128
[ 5733.386895]  [&lt;ffffffff812bdd6f&gt;] device_del+0x131/0x183
[ 5733.386905]  [&lt;ffffffffa000de61&gt;] usb_disable_device+0xa8/0x1d8 [usbcore]
[ 5733.386916]  [&lt;ffffffffa0006bd2&gt;] usb_disconnect+0xab/0x11f [usbcore]
[ 5733.386921]  [&lt;ffffffff813dff82&gt;] ? __mutex_unlock_slowpath+0x130/0x141
[ 5733.386929]  [&lt;ffffffffa0008aa0&gt;] hub_thread+0x73b/0x1157 [usbcore]
[ 5733.386935]  [&lt;ffffffff8106a51d&gt;] ? finish_task_switch+0x78/0x150
[ 5733.386941]  [&lt;ffffffff8105e396&gt;] ? __init_waitqueue_head+0x4c/0x4c
[ 5733.386950]  [&lt;ffffffffa0008365&gt;] ? usb_remote_wakeup+0x56/0x56 [usbcore]
[ 5733.386955]  [&lt;ffffffff8105dc0f&gt;] kthread+0x95/0x9d
[ 5733.386961]  [&lt;ffffffff813e90b4&gt;] kernel_thread_helper+0x4/0x10
[ 5733.386966]  [&lt;ffffffff813e24b8&gt;] ? retint_restore_args+0x13/0x13
[ 5733.386970]  [&lt;ffffffff8105db7a&gt;] ? __init_kthread_worker+0x55/0x55
[ 5733.386974]  [&lt;ffffffff813e90b0&gt;] ? gs_change+0x13/0x13

Signed-off-by: Ming Lei &lt;ming.lei@canonical.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
<entry>
<title>switch device_get_devnode() and -&gt;devnode() to umode_t *</title>
<updated>2012-01-04T03:54:55+00:00</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2011-07-24T00:24:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=2c9ede55ecec58099b72e4bb8eab719f32f72c31'/>
<id>urn:sha1:2c9ede55ecec58099b72e4bb8eab719f32f72c31</id>
<content type='text'>
both callers of device_get_devnode() are only interested in lower 16bits
and nobody tries to return anything wider than 16bit anyway.

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>HID: hiddev: potential info leak in hiddev_ioctl()</title>
<updated>2011-09-26T23:33:10+00:00</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2011-09-23T06:21:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=9561f7faa45cb855b1ba83a4acf3f2ad3665e71f'/>
<id>urn:sha1:9561f7faa45cb855b1ba83a4acf3f2ad3665e71f</id>
<content type='text'>
Smatch has a new check for Rosenberg type information leaks where
structs are copied to the user with uninitialized stack data in them.

In this case, the hiddev_devinfo struct has a two byte hole.

struct hiddev_devinfo {
        __u32                      bustype;              /*     0     4 */
        __u32                      busnum;               /*     4     4 */
        __u32                      devnum;               /*     8     4 */
        __u32                      ifnum;                /*    12     4 */
        __s16                      vendor;               /*    16     2 */
        __s16                      product;              /*    18     2 */
        __s16                      version;              /*    20     2 */

        /* XXX 2 bytes hole, try to pack */

        __u32                      num_applications;     /*    24     4 */

Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
<entry>
<title>HID: hiddev: fix use after free in hiddev_release</title>
<updated>2011-05-26T12:04:40+00:00</updated>
<author>
<name>Dan Carpenter</name>
<email>error27@gmail.com</email>
</author>
<published>2011-05-26T08:49:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=5c699d7d3f94ee1dd934edea889b32f8279a4e65'/>
<id>urn:sha1:5c699d7d3f94ee1dd934edea889b32f8279a4e65</id>
<content type='text'>
There are a couple use after free bugs here.

Signed-off-by: Dan Carpenter &lt;error27@gmail.com&gt;
[jkosina@suse.cz: removed already fixed hunk]
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
<entry>
<title>HID: hiddev: fix potential use-after-free</title>
<updated>2011-05-24T09:43:18+00:00</updated>
<author>
<name>Jiri Kosina</name>
<email>jkosina@suse.cz</email>
</author>
<published>2011-05-24T09:43:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=7f77897ef2b6a5ee4eb8bc24fe8b1f3eab254328'/>
<id>urn:sha1:7f77897ef2b6a5ee4eb8bc24fe8b1f3eab254328</id>
<content type='text'>
Commit 6cb4b040795 ("HID: hiddev: fix race between hiddev_disconnect
and hiddev_release") made it possible to access hiddev (for unlocking
the existance mutex) once hiddev has been kfreed.

Change the order so that this can not happen (always unlock the mutex first,
it is needed only to protect access to -&gt;exist and -&gt;open).

Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
</feed>
