<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/net/usb/usbnet.c, branch v3.4.52</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v3.4.52</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v3.4.52'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2012-11-17T21:16:16+00:00</updated>
<entry>
<title>net: usb: Fix memory leak on Tx data path</title>
<updated>2012-11-17T21:16:16+00:00</updated>
<author>
<name>Hemant Kumar</name>
<email>hemantk@codeaurora.org</email>
</author>
<published>2012-10-25T18:17:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=545bc464cb07b204fbfb387a7010f31352e03625'/>
<id>urn:sha1:545bc464cb07b204fbfb387a7010f31352e03625</id>
<content type='text'>
[ Upstream commit 39707c2a3ba5011038b363f84d37c8a98d2d9db1 ]

Driver anchors the tx urbs and defers the urb submission if
a transmit request comes when the interface is suspended.
Anchoring urb increments the urb reference count. These
deferred urbs are later accessed by calling usb_get_from_anchor()
for submission during interface resume. usb_get_from_anchor()
unanchors the urb but urb reference count remains same.
This causes the urb reference count to remain non-zero
after usb_free_urb() gets called and urb never gets freed.
Hence call usb_put_urb() after anchoring the urb to properly
balance the reference count for these deferred urbs. Also,
unanchor these deferred urbs during disconnect, to free them
up.

Signed-off-by: Hemant Kumar &lt;hemantk@codeaurora.org&gt;
Acked-by: Oliver Neukum &lt;oneukum@suse.de&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usbnet: fix skb traversing races during unlink(v2)</title>
<updated>2012-05-15T17:41:42+00:00</updated>
<author>
<name>Ming Lei</name>
<email>tom.leiming@gmail.com</email>
</author>
<published>2012-04-26T03:33:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5b6e9bcdeb65634b4ad604eb4536404bbfc62cfa'/>
<id>urn:sha1:5b6e9bcdeb65634b4ad604eb4536404bbfc62cfa</id>
<content type='text'>
Commit 4231d47e6fe69f061f96c98c30eaf9fb4c14b96d(net/usbnet: avoid
recursive locking in usbnet_stop()) fixes the recursive locking
problem by releasing the skb queue lock before unlink, but may
cause skb traversing races:
	- after URB is unlinked and the queue lock is released,
	the refered skb and skb-&gt;next may be moved to done queue,
	even be released
	- in skb_queue_walk_safe, the next skb is still obtained
	by next pointer of the last skb
	- so maybe trigger oops or other problems

This patch extends the usage of entry-&gt;state to describe 'start_unlink'
state, so always holding the queue(rx/tx) lock to change the state if
the referd skb is in rx or tx queue because we need to know if the
refered urb has been started unlinking in unlink_urbs.

The other part of this patch is based on Huajun's patch:
always traverse from head of the tx/rx queue to get skb which is
to be unlinked but not been started unlinking.

Signed-off-by: Huajun Li &lt;huajun.li.lee@gmail.com&gt;
Signed-off-by: Ming Lei &lt;tom.leiming@gmail.com&gt;
Cc: Oliver Neukum &lt;oneukum@suse.de&gt;
Cc: stable@kernel.org
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>usbnet: fix failure handling in usbnet_probe</title>
<updated>2012-05-03T00:13:04+00:00</updated>
<author>
<name>tom.leiming@gmail.com</name>
<email>tom.leiming@gmail.com</email>
</author>
<published>2012-04-29T22:51:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a4723848d05dd31d298c551fb77ad28481309999'/>
<id>urn:sha1:a4723848d05dd31d298c551fb77ad28481309999</id>
<content type='text'>
If register_netdev returns failure, the dev-&gt;interrupt and
its transfer buffer should be released, so just fix it.

Signed-off-by: Ming Lei &lt;tom.leiming@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>usbnet: fix leak of transfer buffer of dev-&gt;interrupt</title>
<updated>2012-05-03T00:13:03+00:00</updated>
<author>
<name>tom.leiming@gmail.com</name>
<email>tom.leiming@gmail.com</email>
</author>
<published>2012-04-29T22:51:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=720f3d7cb19eb27f85f72836c8f8004ccb257f39'/>
<id>urn:sha1:720f3d7cb19eb27f85f72836c8f8004ccb257f39</id>
<content type='text'>
The transfer buffer of dev-&gt;interrupt is allocated in .probe path,
but not freed in .disconnet path, so mark the interrupt URB as
URB_FREE_BUFFER to free the buffer when the URB is destroyed.

Signed-off-by: Ming Lei &lt;tom.leiming@gmail.com&gt;
Acked-by: Oliver Neukum &lt;oneukum@suse.de&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>usbnet: consider device busy at each recieved packet</title>
<updated>2012-03-23T03:04:27+00:00</updated>
<author>
<name>Oliver Neukum</name>
<email>oliver@neukum.org</email>
</author>
<published>2012-03-03T17:45:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8a78335442cea429afb2b964318b6e257448ea00'/>
<id>urn:sha1:8a78335442cea429afb2b964318b6e257448ea00</id>
<content type='text'>
usbnet should centrally handle busy reporting in the rx path
so subdrivers need not worry. This hurts use cases which do
rx only or predominantly.

Signed-off-by: Oliver Neukum &lt;oneukum@suse.de&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>usbnet: don't clear urb-&gt;dev in tx_complete</title>
<updated>2012-03-22T23:32:34+00:00</updated>
<author>
<name>tom.leiming@gmail.com</name>
<email>tom.leiming@gmail.com</email>
</author>
<published>2012-03-22T03:22:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5d5440a835710d09f0ef18da5000541ec98b537a'/>
<id>urn:sha1:5d5440a835710d09f0ef18da5000541ec98b537a</id>
<content type='text'>
URB unlinking is always racing with its completion and tx_complete
may be called before or during running usb_unlink_urb, so tx_complete
must not clear urb-&gt;dev since it will be used in unlink path,
otherwise invalid memory accesses or usb device leak may be caused
inside usb_unlink_urb.

Cc: stable@kernel.org
Cc: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Cc: Oliver Neukum &lt;oliver@neukum.org&gt;
Signed-off-by: Ming Lei &lt;tom.leiming@gmail.com&gt;
Acked-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>usbnet: increase URB reference count before usb_unlink_urb</title>
<updated>2012-03-22T23:32:34+00:00</updated>
<author>
<name>tom.leiming@gmail.com</name>
<email>tom.leiming@gmail.com</email>
</author>
<published>2012-03-22T03:22:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0956a8c20b23d429e79ff86d4325583fc06f9eb4'/>
<id>urn:sha1:0956a8c20b23d429e79ff86d4325583fc06f9eb4</id>
<content type='text'>
Commit 4231d47e6fe69f061f96c98c30eaf9fb4c14b96d(net/usbnet: avoid
recursive locking in usbnet_stop()) fixes the recursive locking
problem by releasing the skb queue lock, but it makes usb_unlink_urb
racing with defer_bh, and the URB to being unlinked may be freed before
or during calling usb_unlink_urb, so use-after-free problem may be
triggerd inside usb_unlink_urb.

The patch fixes the use-after-free problem by increasing URB
reference count with skb queue lock held before calling
usb_unlink_urb, so the URB won't be freed until return from
usb_unlink_urb.

Cc: stable@kernel.org
Cc: Sebastian Andrzej Siewior &lt;bigeasy@linutronix.de&gt;
Cc: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Cc: Oliver Neukum &lt;oliver@neukum.org&gt;
Reported-by: Dave Jones &lt;davej@redhat.com&gt;
Signed-off-by: Ming Lei &lt;tom.leiming@gmail.com&gt;
Acked-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net</title>
<updated>2012-03-19T03:29:41+00:00</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2012-03-19T03:29:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4da0bd736552e6377b407b3c3d3ae518ebbdd269'/>
<id>urn:sha1:4da0bd736552e6377b407b3c3d3ae518ebbdd269</id>
<content type='text'>
</content>
</entry>
<entry>
<title>usbnet: use netif_tx_wake_queue instead of netif_start_queue</title>
<updated>2012-03-17T05:50:19+00:00</updated>
<author>
<name>Alexey Orishko</name>
<email>alexey.orishko@gmail.com</email>
</author>
<published>2012-03-14T04:00:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1aa9bc5b2f4cf8c48944fb9a607bf1dd674e2c10'/>
<id>urn:sha1:1aa9bc5b2f4cf8c48944fb9a607bf1dd674e2c10</id>
<content type='text'>
If host is going to autosuspend function with two interfaces and
if IP packet has arrived in-between of two usbnet_suspend() callbacks,
i.e usbnet_resume() is called in-between, tx data flow is stopped.
When autosuspend timer expires and device is put to autosuspend
again, tx queue is waked up and data can be sent again.
This behavior might be repeated several times in a row.

Tested on Intel/ARM.

Reviewed-by: Sjur Brændeland &lt;sjur.brandeland@stericsson.com&gt;
Tested-by: Dmitry Tarnyagin &lt;dmitry.tarnyagin@stericsson.com&gt;
Signed-off-by: Alexey Orishko &lt;alexey.orishko@stericsson.com&gt;
Acked-by: Oliver Neukum &lt;oneukum@suse.de&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net/usbnet: reserve headroom on rx skbs</title>
<updated>2012-03-16T09:01:05+00:00</updated>
<author>
<name>Eric Dumazet</name>
<email>eric.dumazet@gmail.com</email>
</author>
<published>2012-03-14T06:56:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7bdd402706cf26bfef9050dfee3f229b7f33ee4f'/>
<id>urn:sha1:7bdd402706cf26bfef9050dfee3f229b7f33ee4f</id>
<content type='text'>
network drivers should reserve some headroom on incoming skbs so that we
dont need expensive reallocations, eg forwarding packets in tunnels.

This NET_SKB_PAD padding is done in various helpers, like
__netdev_alloc_skb_ip_align() in this patch, combining NET_SKB_PAD and
NET_IP_ALIGN magic.

Signed-off-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Cc: Oliver Neukum &lt;oneukum@suse.de&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Acked-by: Oliver Neukum &lt;oneukum@suse.de&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
