<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/usb/gadget/function/u_ether.c, branch linux-4.9.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.9.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.9.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2021-09-22T09:43:05Z</updated>
<entry>
<title>usb: gadget: u_ether: fix a potential null pointer dereference</title>
<updated>2021-09-22T09:43:05Z</updated>
<author>
<name>Maciej Żenczykowski</name>
</author>
<published>2021-07-01T11:48:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=62d927c42ec565a832a8c3f2e6e7b6c7846f253a'/>
<id>urn:sha1:62d927c42ec565a832a8c3f2e6e7b6c7846f253a</id>
<content type='text'>
[ Upstream commit 8ae01239609b29ec2eff55967c8e0fe3650cfa09 ]

f_ncm tx timeout can call us with null skb to flush
a pending frame.  In this case skb is NULL to begin
with but ceases to be null after dev-&gt;wrap() completes.

In such a case in-&gt;maxpacket will be read, even though
we've failed to check that 'in' is not NULL.

Though I've never observed this fail in practice,
however the 'flush operation' simply does not make sense with
a null usb IN endpoint - there's nowhere to flush to...
(note that we're the gadget/device, and IN is from the point
 of view of the host, so here IN actually means outbound...)

Cc: Brooke Basile &lt;brookebasile@gmail.com&gt;
Cc: "Bryan O'Donoghue" &lt;bryan.odonoghue@linaro.org&gt;
Cc: Felipe Balbi &lt;balbi@kernel.org&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Cc: Lorenzo Colitti &lt;lorenzo@google.com&gt;
Signed-off-by: Maciej Żenczykowski &lt;maze@google.com&gt;
Link: https://lore.kernel.org/r/20210701114834.884597-6-zenczykowski@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>usb: gadget: u_ether: enable qmult on SuperSpeed Plus as well</title>
<updated>2020-10-29T08:05:36Z</updated>
<author>
<name>Lorenzo Colitti</name>
</author>
<published>2020-08-18T16:19:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d09f63a3a7b641f96fe30aefbb2b724cede72207'/>
<id>urn:sha1:d09f63a3a7b641f96fe30aefbb2b724cede72207</id>
<content type='text'>
[ Upstream commit 4eea21dc67b0c6ba15ae41b1defa113a680a858e ]

The u_ether driver has a qmult setting that multiplies the
transmit queue length (which by default is 2).

The intent is that it should be enabled at high/super speed, but
because the code does not explicitly check for USB_SUPER_PLUS,
it is disabled at that speed.

Fix this by ensuring that the queue multiplier is enabled for any
wired link at high speed or above. Using &gt;= for USB_SPEED_*
constants seems correct because it is what the gadget_is_xxxspeed
functions do.

The queue multiplier substantially helps performance at higher
speeds. On a direct SuperSpeed Plus link to a Linux laptop,
iperf3 single TCP stream:

Before (qmult=1): 1.3 Gbps
After  (qmult=5): 3.2 Gbps

Fixes: 04617db7aa68 ("usb: gadget: add SS descriptors to Ethernet gadget")
Reviewed-by: Maciej Żenczykowski &lt;maze@google.com&gt;
Signed-off-by: Lorenzo Colitti &lt;lorenzo@google.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>usb: gadget: ether: Fix race between gether_disconnect and rx_submit</title>
<updated>2019-07-21T07:06:01Z</updated>
<author>
<name>Kiruthika Varadarajan</name>
</author>
<published>2019-06-18T08:39:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f1052d05ec5ae9cb1138d43b447c2937adae56d3'/>
<id>urn:sha1:f1052d05ec5ae9cb1138d43b447c2937adae56d3</id>
<content type='text'>
commit d29fcf7078bc8be2b6366cbd4418265b53c94fac upstream.

On spin lock release in rx_submit, gether_disconnect get a chance to
run, it makes port_usb NULL, rx_submit access NULL port USB, hence null
pointer crash.

Fixed by releasing the lock in rx_submit after port_usb is used.

Fixes: 2b3d942c4878 ("usb ethernet gadget: split out network core")
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Kiruthika Varadarajan &lt;Kiruthika.Varadarajan@harman.com&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>usb: gadget: u_ether: remove interrupt throttling</title>
<updated>2016-11-01T13:48:25Z</updated>
<author>
<name>Felipe Balbi</name>
</author>
<published>2016-11-01T11:20:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fd9afd3cbe404998d732be6cc798f749597c5114'/>
<id>urn:sha1:fd9afd3cbe404998d732be6cc798f749597c5114</id>
<content type='text'>
According to Dave Miller "the networking stack has a
hard requirement that all SKBs which are transmitted
must have their completion signalled in a fininte
amount of time. This is because, until the SKB is
freed by the driver, it holds onto socket,
netfilter, and other subsystem resources."

In summary, this means that using TX IRQ throttling
for the networking gadgets is, at least, complex and
we should avoid it for the time being.

Cc: &lt;stable@vger.kernel.org&gt;
Reported-by: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Tested-by: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Suggested-by: David Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>usb: gadget: function: u_ether: don't starve tx request queue</title>
<updated>2016-10-17T08:14:00Z</updated>
<author>
<name>Felipe Balbi</name>
</author>
<published>2016-10-04T12:14:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6c83f77278f17a7679001027e9231291c20f0d8a'/>
<id>urn:sha1:6c83f77278f17a7679001027e9231291c20f0d8a</id>
<content type='text'>
If we don't guarantee that we will always get an
interrupt at least when we're queueing our very last
request, we could fall into situation where we queue
every request with 'no_interrupt' set. This will
cause the link to get stuck.

The behavior above has been triggered with g_ether
and dwc3.

Cc: &lt;stable@vger.kernel.org&gt;
Reported-by: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>Revert "usb: gadget: NCM: Protect dev-&gt;port_usb using dev-&gt;lock"</title>
<updated>2016-09-19T09:05:43Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
</author>
<published>2016-09-19T09:05:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3a383cc0b8cc33af188fe2062b6ba5a69af25fa7'/>
<id>urn:sha1:3a383cc0b8cc33af188fe2062b6ba5a69af25fa7</id>
<content type='text'>
This reverts commit c9ffc78745f89e300fe704348dd8e6800acf4d18 as it was
reported to be broken.

Cc: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
Cc: Jim Baxter &lt;jim_baxter@mentor.com&gt;
Cc: Harish Jenny K N &lt;harish_kandiga@mentor.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: gadget: NCM: Protect dev-&gt;port_usb using dev-&gt;lock</title>
<updated>2016-09-09T11:49:20Z</updated>
<author>
<name>Harish Jenny K N</name>
</author>
<published>2016-09-09T09:30:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c9ffc78745f89e300fe704348dd8e6800acf4d18'/>
<id>urn:sha1:c9ffc78745f89e300fe704348dd8e6800acf4d18</id>
<content type='text'>
This commit incorporates findings from
https://lkml.org/lkml/2016/4/25/594

The function has been modified to make sure we hold
the dev lock when accessing the net device pointer.

Acked-by: Jim Baxter &lt;jim_baxter@mentor.com&gt;
Signed-off-by: Harish Jenny K N &lt;harish_kandiga@mentor.com&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>usb: gadget: u_ether: fix another dereference after null check</title>
<updated>2016-09-09T11:49:02Z</updated>
<author>
<name>Harish Jenny K N</name>
</author>
<published>2016-09-09T09:30:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=79775f441838403be856e06eaab893a3fe9dd7b2'/>
<id>urn:sha1:79775f441838403be856e06eaab893a3fe9dd7b2</id>
<content type='text'>
dev-&gt;port_usb is checked for null pointer previously, so dev-&gt;port_usb
might be null during no zlp check, fix it by adding null pointer check.

Acked-by: Jim Baxter &lt;jim_baxter@mentor.com&gt;
Signed-off-by: Harish Jenny K N &lt;harish_kandiga@mentor.com&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>usb: gadget: u_ether: add a flag to avoid skb_reserve() calling</title>
<updated>2016-08-31T07:06:03Z</updated>
<author>
<name>Yoshihiro Shimoda</name>
</author>
<published>2016-08-22T08:48:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=05f6b0ff68429bb7c6b84b35e71b522c3bae76ae'/>
<id>urn:sha1:05f6b0ff68429bb7c6b84b35e71b522c3bae76ae</id>
<content type='text'>
This patch adds a flag "no_skb_reserve" in struct eth_dev.
So, if a peripheral driver sets the quirk_avoids_skb_reserve flag,
upper network gadget drivers (e.g. f_ncm.c) can avoid skb_reserve()
calling using the flag as well.

Signed-off-by: Yoshihiro Shimoda &lt;yoshihiro.shimoda.uh@renesas.com&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>usb: gadget: u_ether: fix dereference after null check coverify warning</title>
<updated>2016-08-11T12:09:44Z</updated>
<author>
<name>Peter Chen</name>
</author>
<published>2016-07-01T07:33:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=88c09eacf560c3303d0ee8cf91b8b7ff7f000350'/>
<id>urn:sha1:88c09eacf560c3303d0ee8cf91b8b7ff7f000350</id>
<content type='text'>
dev-&gt;port_usb is checked for null pointer at above code, so dev-&gt;port_usb
might be null, fix it by adding null pointer check.

Signed-off-by: Peter Chen &lt;peter.chen@nxp.com&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
</content>
</entry>
</feed>
