<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/usb/core/devio.c, branch linux-2.6.31.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.31.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.31.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2010-04-01T22:56:00Z</updated>
<entry>
<title>USB: fix usbfs regression</title>
<updated>2010-04-01T22:56:00Z</updated>
<author>
<name>Alan Stern</name>
</author>
<published>2010-03-06T20:04:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=194d2386083401a8a82379870a1fef7c24ca8723'/>
<id>urn:sha1:194d2386083401a8a82379870a1fef7c24ca8723</id>
<content type='text'>
commit 7152b592593b9d48b33f8997b1dfd6df9143f7ec upstream.

This patch (as1352) fixes a bug in the way isochronous input data is
returned to userspace for usbfs transfers.  The entire buffer must be
copied, not just the first actual_length bytes, because the individual
packets will be discontiguous if any of them are short.

Reported-by: Markus Rechberger &lt;mrechberger@gmail.com&gt;
Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>USB: usbfs: only copy the actual data received</title>
<updated>2010-04-01T22:55:43Z</updated>
<author>
<name>Greg KH</name>
</author>
<published>2010-02-16T01:37:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=acbf8a14113c8abeb10a21cefc551d03bdd8f3f7'/>
<id>urn:sha1:acbf8a14113c8abeb10a21cefc551d03bdd8f3f7</id>
<content type='text'>
commit d4a4683ca054ed9917dfc9e3ff0f7ecf74ad90d6 upstream

We need to only copy the data received by the device to userspace, not
the whole kernel buffer, which can contain "stale" data.

Thanks to Marcus Meissner for pointing this out and testing the fix.

Reported-by: Marcus Meissner &lt;meissner@suse.de&gt;
Tested-by: Marcus Meissner &lt;meissner@suse.de&gt;
Cc: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: stable &lt;stable@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
Acked-by: Jeff Mahoney &lt;jeffm@suse.com&gt;
</content>
</entry>
<entry>
<title>USB: usbfs: properly clean up the as structure on error paths</title>
<updated>2010-04-01T22:55:43Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2010-02-17T04:35:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=97fde87ccff1bf623631c58a1f032533983cb090'/>
<id>urn:sha1:97fde87ccff1bf623631c58a1f032533983cb090</id>
<content type='text'>
commit ddeee0b2eec2a51b0712b04de4b39e7bec892a53 upstream

USB: usbfs: properly clean up the as structure on error paths

I notice that the processcompl_compat() function seems to be leaking the
'struct async *as' in the error paths.

I think that the calling convention is fundamentally buggered. The
caller is the one that did the "reap_as()" to get the as thing, the
caller should be the one to free it too.

Freeing it in the caller also means that it very clearly always gets
freed, and avoids the need for any "free in the error case too".

From: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Cc: Marcus Meissner &lt;meissner@suse.de&gt;
Cc: stable &lt;stable@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
Acked-by: Jeff Mahoney &lt;jeffm@suse.com&gt;
</content>
</entry>
<entry>
<title>USB: usbfs: fix -ENOENT error code to be -ENODEV</title>
<updated>2009-08-07T23:05:13Z</updated>
<author>
<name>Alan Stern</name>
</author>
<published>2009-07-30T19:28:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=01105a246345f011fde64d24a601090b646e9e4c'/>
<id>urn:sha1: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>
</entry>
<entry>
<title>USB: devio: Properly do access_ok() checks</title>
<updated>2009-08-07T23:05:12Z</updated>
<author>
<name>Michael Buesch</name>
</author>
<published>2009-07-29T09:39:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=18753ebc8a98efe0e8ff6167afb31cef220c8e50'/>
<id>urn:sha1: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>
</entry>
<entry>
<title>USB: handle zero-length usbfs submissions correctly</title>
<updated>2009-07-12T22:16:41Z</updated>
<author>
<name>Alan Stern</name>
</author>
<published>2009-06-29T15:04:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9180135bc80ab11199d482b6111e23f74d65af4a'/>
<id>urn:sha1: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>
</entry>
<entry>
<title>USB: fix race leading to a write after kfree in usbfs</title>
<updated>2009-07-12T22:16:40Z</updated>
<author>
<name>Oliver Neukum</name>
</author>
<published>2009-07-08T17:09:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=516a1a07f0219d6672fb6b8e49fb9d5d533c2e89'/>
<id>urn:sha1: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>
</entry>
<entry>
<title>USB: fix memleak in usbfs</title>
<updated>2009-07-12T22:16:39Z</updated>
<author>
<name>Oliver Neukum</name>
</author>
<published>2009-06-28T21:34:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d794a02111cd3393da69bc7d6dd2b6074bd037cc'/>
<id>urn:sha1: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>
</entry>
<entry>
<title>USB: add reset endpoint operations</title>
<updated>2009-04-17T17:50:27Z</updated>
<author>
<name>David Vrabel</name>
</author>
<published>2009-04-08T17:36:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3444b26afa145148951112534f298bdc554ec789'/>
<id>urn:sha1:3444b26afa145148951112534f298bdc554ec789</id>
<content type='text'>
Wireless USB endpoint state has a sequence number and a current
window and not just a single toggle bit.  So allow HCDs to provide a
endpoint_reset method and call this or clear the software toggles as
required (after a clear halt, set configuration etc.).

usb_settoggle() and friends are then HCD internal and are moved into
core/hcd.h and all device drivers call usb_reset_endpoint() instead.

If the device endpoint state has been reset (with a clear halt) but
the host endpoint state has not then subsequent data transfers will
not complete. The device will only work again after it is reset or
disconnected.

Signed-off-by: David Vrabel &lt;david.vrabel@csr.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
</entry>
<entry>
<title>USB: more u32 conversion after transfer_buffer_length and actual_length</title>
<updated>2009-03-24T23:20:45Z</updated>
<author>
<name>Roel Kluin</name>
</author>
<published>2009-03-13T11:19:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=71d2718f2507dc17501d04e2bdca7b8e694ce365'/>
<id>urn:sha1:71d2718f2507dc17501d04e2bdca7b8e694ce365</id>
<content type='text'>
transfer_buffer_length and actual_length have become unsigned, therefore some
additional conversion of local variables, function arguments and print
specifications is desired.

A test for a negative urb-&gt;transfer_buffer_length became obsolete; instead
we ensure that it does not exceed INT_MAX. Also, urb-&gt;actual_length is always
less than urb-&gt;transfer_buffer_length.

rh_string() does no longer return -EPIPE in the case of an unsupported ID.
Instead its only caller, rh_call_control() does the check.

Signed-off-by: Roel Kluin &lt;roel.kluin@gmail.com&gt;
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
</feed>
