<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/drivers/usb/core, branch v2.6.31</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>USB: usbfs: fix -ENOENT error code to be -ENODEV</title>
<updated>2009-08-07T23:05:13+00:00</updated>
<author>
<name>Alan Stern</name>
<email>stern@rowland.harvard.edu</email>
</author>
<published>2009-07-30T19:28:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=01105a246345f011fde64d24a601090b646e9e4c'/>
<id>01105a246345f011fde64d24a601090b646e9e4c</id>
<content type='text'>
This patch (as1272) changes the error code returned when an open call
for a USB device node fails to locate the corresponding device.  The
appropriate error code is -ENODEV, not -ENOENT.

Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
CC: Kay Sievers &lt;kay.sievers@vrfy.org&gt;
Cc: stable &lt;stable@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch (as1272) changes the error code returned when an open call
for a USB device node fails to locate the corresponding device.  The
appropriate error code is -ENODEV, not -ENOENT.

Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
CC: Kay Sievers &lt;kay.sievers@vrfy.org&gt;
Cc: stable &lt;stable@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>USB: devio: Properly do access_ok() checks</title>
<updated>2009-08-07T23:05:12+00:00</updated>
<author>
<name>Michael Buesch</name>
<email>mb@bu3sch.de</email>
</author>
<published>2009-07-29T09:39:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=18753ebc8a98efe0e8ff6167afb31cef220c8e50'/>
<id>18753ebc8a98efe0e8ff6167afb31cef220c8e50</id>
<content type='text'>
access_ok() checks must be done on every part of the userspace structure
that is accessed. If access_ok() on one part of the struct succeeded, it
does not imply it will succeed on other parts of the struct. (Does
depend on the architecture implementation of access_ok()).

This changes the __get_user() users to first check access_ok() on the
data structure.

Signed-off-by: Michael Buesch &lt;mb@bu3sch.de&gt;
Cc: stable &lt;stable@kernel.org&gt;
Cc: Pete Zaitcev &lt;zaitcev@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
access_ok() checks must be done on every part of the userspace structure
that is accessed. If access_ok() on one part of the struct succeeded, it
does not imply it will succeed on other parts of the struct. (Does
depend on the architecture implementation of access_ok()).

This changes the __get_user() users to first check access_ok() on the
data structure.

Signed-off-by: Michael Buesch &lt;mb@bu3sch.de&gt;
Cc: stable &lt;stable@kernel.org&gt;
Cc: Pete Zaitcev &lt;zaitcev@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>USB: Fix parsing of SuperSpeed Endpoint Companion descriptor.</title>
<updated>2009-07-28T21:31:13+00:00</updated>
<author>
<name>Sarah Sharp</name>
<email>sarah.a.sharp@linux.intel.com</email>
</author>
<published>2009-07-27T19:04:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=9f8e443816976edd68f415ea25c0223ea921e88c'/>
<id>9f8e443816976edd68f415ea25c0223ea921e88c</id>
<content type='text'>
usb_parse_ss_endpoint_companion() was supposed to allocate a structure to
hold the SuperSpeed Endpoint Companion descriptor, and either copy the
values the device returned, or fill in default values if the device
descriptor did not include the companion descriptor.

However, the previous code would miss the last endpoint in a configuration
with no descriptors after it.  Make usb_parse_endpoint() allocate the SS
endpoint companion descriptor and fill it with default values, even if
we've run out of buffer space in this configuration descriptor.

Signed-off-by: Sarah Sharp &lt;sarah.a.sharp@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
usb_parse_ss_endpoint_companion() was supposed to allocate a structure to
hold the SuperSpeed Endpoint Companion descriptor, and either copy the
values the device returned, or fill in default values if the device
descriptor did not include the companion descriptor.

However, the previous code would miss the last endpoint in a configuration
with no descriptors after it.  Make usb_parse_endpoint() allocate the SS
endpoint companion descriptor and fill it with default values, even if
we've run out of buffer space in this configuration descriptor.

Signed-off-by: Sarah Sharp &lt;sarah.a.sharp@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>USB: handle zero-length usbfs submissions correctly</title>
<updated>2009-07-12T22:16:41+00:00</updated>
<author>
<name>Alan Stern</name>
<email>stern@rowland.harvard.edu</email>
</author>
<published>2009-06-29T15:04:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=9180135bc80ab11199d482b6111e23f74d65af4a'/>
<id>9180135bc80ab11199d482b6111e23f74d65af4a</id>
<content type='text'>
This patch (as1262) fixes a bug in usbfs: It refuses to accept
zero-length transfers, and it insists that the buffer pointer be valid
even if there is no data being transferred.

The patch also consolidates a bunch of repetitive access_ok() checks
into a single check, which incidentally fixes the lack of such a check
for Isochronous URBs.

Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Cc: stable &lt;stable@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch (as1262) fixes a bug in usbfs: It refuses to accept
zero-length transfers, and it insists that the buffer pointer be valid
even if there is no data being transferred.

The patch also consolidates a bunch of repetitive access_ok() checks
into a single check, which incidentally fixes the lack of such a check
for Isochronous URBs.

Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Cc: stable &lt;stable@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>USB: fix LANGID=0 regression</title>
<updated>2009-07-12T22:16:40+00:00</updated>
<author>
<name>Daniel Mack</name>
<email>daniel@caiaq.de</email>
</author>
<published>2009-07-10T09:04:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=0cce2eda19923e5e5ccc8b042dec5af87b3ffad0'/>
<id>0cce2eda19923e5e5ccc8b042dec5af87b3ffad0</id>
<content type='text'>
commit b7af0bb ("USB: allow malformed LANGID descriptors") broke support
for devices without string descriptor support.

Reporting string descriptors is optional to USB devices, and a device
lets us know it can't deal with strings by responding to the LANGID
request with a STALL token.

The kernel handled that correctly before b7af0bb came in, but failed
hard if the LANGID was reported but broken. More than that, if a device
was not able to provide string descriptors, the LANGID was retrieved
over and over again at each string read request.

This patch changes the behaviour so that

 a) the LANGID is only queried once
 b) devices which can't handle string requests are not asked again
 c) devices with malformed LANGID values have a sane fallback to 0x0409

Signed-off-by: Daniel Mack &lt;daniel@caiaq.de&gt;
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Cc: stable &lt;stable@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit b7af0bb ("USB: allow malformed LANGID descriptors") broke support
for devices without string descriptor support.

Reporting string descriptors is optional to USB devices, and a device
lets us know it can't deal with strings by responding to the LANGID
request with a STALL token.

The kernel handled that correctly before b7af0bb came in, but failed
hard if the LANGID was reported but broken. More than that, if a device
was not able to provide string descriptors, the LANGID was retrieved
over and over again at each string read request.

This patch changes the behaviour so that

 a) the LANGID is only queried once
 b) devices which can't handle string requests are not asked again
 c) devices with malformed LANGID values have a sane fallback to 0x0409

Signed-off-by: Daniel Mack &lt;daniel@caiaq.de&gt;
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Cc: stable &lt;stable@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>USB: fix race leading to a write after kfree in usbfs</title>
<updated>2009-07-12T22:16:40+00:00</updated>
<author>
<name>Oliver Neukum</name>
<email>oliver@neukum.org</email>
</author>
<published>2009-07-08T17:09:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=516a1a07f0219d6672fb6b8e49fb9d5d533c2e89'/>
<id>516a1a07f0219d6672fb6b8e49fb9d5d533c2e89</id>
<content type='text'>
this fixes a race between async_completed() and proc_reapurbnonblock().

CPU A                   CPU B

spin_lock(&amp;ps-&gt;lock);
list_move_tail(&amp;as-&gt;asynclist, &amp;ps-&gt;async_completed);
spin_unlock(&amp;ps-&gt;lock);

                                if (!(as = async_getcompleted(ps)))
                                        return -EAGAIN;
                                return processcompl(as, (void __user * __user *)arg);

processcompl() calls free_async() which calls kfree(as)

as-&gt;status = urb-&gt;status;
if (as-&gt;signr) {
        sinfo.si_signo = as-&gt;signr;
        sinfo.si_errno = as-&gt;status;
        sinfo.si_code = SI_ASYNCIO;
        sinfo.si_addr = as-&gt;userurb;
        kill_pid_info_as_uid(as-&gt;signr, &amp;sinfo, as-&gt;pid, as-&gt;uid,
                              as-&gt;euid, as-&gt;secid);
}
snoop(&amp;urb-&gt;dev-&gt;dev, "urb complete\n");
snoop_urb(urb, as-&gt;userurb);

write after kfree

Signed-off-by: Oliver Neukum &lt;oliver@neukum.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
this fixes a race between async_completed() and proc_reapurbnonblock().

CPU A                   CPU B

spin_lock(&amp;ps-&gt;lock);
list_move_tail(&amp;as-&gt;asynclist, &amp;ps-&gt;async_completed);
spin_unlock(&amp;ps-&gt;lock);

                                if (!(as = async_getcompleted(ps)))
                                        return -EAGAIN;
                                return processcompl(as, (void __user * __user *)arg);

processcompl() calls free_async() which calls kfree(as)

as-&gt;status = urb-&gt;status;
if (as-&gt;signr) {
        sinfo.si_signo = as-&gt;signr;
        sinfo.si_errno = as-&gt;status;
        sinfo.si_code = SI_ASYNCIO;
        sinfo.si_addr = as-&gt;userurb;
        kill_pid_info_as_uid(as-&gt;signr, &amp;sinfo, as-&gt;pid, as-&gt;uid,
                              as-&gt;euid, as-&gt;secid);
}
snoop(&amp;urb-&gt;dev-&gt;dev, "urb complete\n");
snoop_urb(urb, as-&gt;userurb);

write after kfree

Signed-off-by: Oliver Neukum &lt;oliver@neukum.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>Revert USB: usbfs: deprecate and hide option for !embedded</title>
<updated>2009-07-12T22:16:39+00:00</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@suse.de</email>
</author>
<published>2009-07-10T04:35:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=e12df02a171d1c10ee664e6571c0e4cb7e1b7c92'/>
<id>e12df02a171d1c10ee664e6571c0e4cb7e1b7c92</id>
<content type='text'>
This reverts commit cc71329b3b89b4a5be849b617f2c4f151f0b9213, so that
Red Hat machines can boot properly.  It seems that the Red Hat initrd
code tries to watch the /proc/bus/usb/devices file to monitor usb
devices showing up.  While this task is prone to lots of races and does
not show the true state of the system, they seem to like it.

So for now, don't move this option under the EMBEDDED config option.


Cc: Scott James Remnant &lt;scott@canonical.com&gt;
Cc: Kay Sievers &lt;kay.sievers@vrfy.org&gt;
Cc: Dave Airlie &lt;airlied@gmail.com&gt;
Cc: Peter Jones &lt;pjones@redhat.com&gt;
Cc: Jeff Chua &lt;jeff.chua.linux@gmail.com&gt;
Cc: Dave Jones &lt;davej@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit cc71329b3b89b4a5be849b617f2c4f151f0b9213, so that
Red Hat machines can boot properly.  It seems that the Red Hat initrd
code tries to watch the /proc/bus/usb/devices file to monitor usb
devices showing up.  While this task is prone to lots of races and does
not show the true state of the system, they seem to like it.

So for now, don't move this option under the EMBEDDED config option.


Cc: Scott James Remnant &lt;scott@canonical.com&gt;
Cc: Kay Sievers &lt;kay.sievers@vrfy.org&gt;
Cc: Dave Airlie &lt;airlied@gmail.com&gt;
Cc: Peter Jones &lt;pjones@redhat.com&gt;
Cc: Jeff Chua &lt;jeff.chua.linux@gmail.com&gt;
Cc: Dave Jones &lt;davej@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>USB: add missing class descriptions used in usb/devices file</title>
<updated>2009-07-12T22:16:39+00:00</updated>
<author>
<name>Frans Pop</name>
<email>elendil@planet.nl</email>
</author>
<published>2009-06-26T14:10:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=bf7fbb022f0a3da27a2bcf8d7c973c813d942384'/>
<id>bf7fbb022f0a3da27a2bcf8d7c973c813d942384</id>
<content type='text'>
Added descriptions (for WIRELESS_CONTROLLER and MISC) were taken from
the usb-devices script now included in usbutils.

Also sort the classes in the same order as in include/linux/usb/ch9.h
for easier comparison for future updates.

Signed-off-by: Frans Pop &lt;elendil@planet.nl&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Added descriptions (for WIRELESS_CONTROLLER and MISC) were taken from
the usb-devices script now included in usbutils.

Also sort the classes in the same order as in include/linux/usb/ch9.h
for easier comparison for future updates.

Signed-off-by: Frans Pop &lt;elendil@planet.nl&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>USB: fix memleak in usbfs</title>
<updated>2009-07-12T22:16:39+00:00</updated>
<author>
<name>Oliver Neukum</name>
<email>oliver@neukum.org</email>
</author>
<published>2009-06-28T21:34:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=d794a02111cd3393da69bc7d6dd2b6074bd037cc'/>
<id>d794a02111cd3393da69bc7d6dd2b6074bd037cc</id>
<content type='text'>
This patch fixes a memory leak in devio.c::processcompl

If writing to user space fails the packet must be discarded, as it
already has been removed from the queue of completed packets.

Signed-off-by: Oliver Neukum &lt;oliver@neukum.org&gt;
Cc: stable &lt;stable@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch fixes a memory leak in devio.c::processcompl

If writing to user space fails the packet must be discarded, as it
already has been removed from the queue of completed packets.

Signed-off-by: Oliver Neukum &lt;oliver@neukum.org&gt;
Cc: stable &lt;stable@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>USB: fix the clear_tt_buffer interface</title>
<updated>2009-07-12T22:16:38+00:00</updated>
<author>
<name>Alan Stern</name>
<email>stern@rowland.harvard.edu</email>
</author>
<published>2009-06-29T14:43:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=cb88a1b887bb8908f6e00ce29e893ea52b074940'/>
<id>cb88a1b887bb8908f6e00ce29e893ea52b074940</id>
<content type='text'>
This patch (as1255) updates the interface for calling
usb_hub_clear_tt_buffer().  Even the name of the function is changed!

When an async URB (i.e., Control or Bulk) going through a high-speed
hub to a non-high-speed device is cancelled or fails, the hub's
Transaction Translator buffer may be left busy still trying to
complete the transaction.  The buffer has to be cleared; that's what
usb_hub_clear_tt_buffer() does.

It isn't safe to send any more URBs to the same endpoint until the TT
buffer is fully clear.  Therefore the HCD needs to be told when the
Clear-TT-Buffer request has finished.  This patch adds a callback
method to struct hc_driver for that purpose, and makes the hub driver
invoke the callback at the proper time.

The patch also changes a couple of names; "hub_tt_kevent" and
"tt.kevent" now look rather antiquated.

Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Cc: stable &lt;stable@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch (as1255) updates the interface for calling
usb_hub_clear_tt_buffer().  Even the name of the function is changed!

When an async URB (i.e., Control or Bulk) going through a high-speed
hub to a non-high-speed device is cancelled or fails, the hub's
Transaction Translator buffer may be left busy still trying to
complete the transaction.  The buffer has to be cleared; that's what
usb_hub_clear_tt_buffer() does.

It isn't safe to send any more URBs to the same endpoint until the TT
buffer is fully clear.  Therefore the HCD needs to be told when the
Clear-TT-Buffer request has finished.  This patch adds a callback
method to struct hc_driver for that purpose, and makes the hub driver
invoke the callback at the proper time.

The patch also changes a couple of names; "hub_tt_kevent" and
"tt.kevent" now look rather antiquated.

Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Cc: stable &lt;stable@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
</feed>
