<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/net/core/netpoll.c, branch v3.10.30</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>netpoll: Fix missing TXQ unlock and and OOPS.</title>
<updated>2014-01-15T23:28:50+00:00</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2014-01-03T00:50:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=50ba56ca77a62c3bc36ba9bde7bffecc63c30477'/>
<id>50ba56ca77a62c3bc36ba9bde7bffecc63c30477</id>
<content type='text'>
[ Upstream commit aca5f58f9ba803ec8c2e6bcf890db17589e8dfcc ]

The VLAN tag handling code in netpoll_send_skb_on_dev() has two problems.

1) It exits without unlocking the TXQ.

2) It then tries to queue a NULL skb to npinfo-&gt;txq.

Reported-by: Ahmed Tamrawi &lt;atamrawi@iastate.edu&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit aca5f58f9ba803ec8c2e6bcf890db17589e8dfcc ]

The VLAN tag handling code in netpoll_send_skb_on_dev() has two problems.

1) It exits without unlocking the TXQ.

2) It then tries to queue a NULL skb to npinfo-&gt;txq.

Reported-by: Ahmed Tamrawi &lt;atamrawi@iastate.edu&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>netpoll: fix NULL pointer dereference in netpoll_cleanup</title>
<updated>2013-10-13T23:08:29+00:00</updated>
<author>
<name>Nikolay Aleksandrov</name>
<email>nikolay@redhat.com</email>
</author>
<published>2013-09-19T13:02:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e66bdd7106911886aebf118e1c1aebb5a26d0752'/>
<id>e66bdd7106911886aebf118e1c1aebb5a26d0752</id>
<content type='text'>
[ Upstream commit d0fe8c888b1fd1a2f84b9962cabcb98a70988aec ]

I've been hitting a NULL ptr deref while using netconsole because the
np-&gt;dev check and the pointer manipulation in netpoll_cleanup are done
without rtnl and the following sequence happens when having a netconsole
over a vlan and we remove the vlan while disabling the netconsole:
	CPU 1					CPU2
					removes vlan and calls the notifier
enters store_enabled(), calls
netdev_cleanup which checks np-&gt;dev
and then waits for rtnl
					executes the netconsole netdev
					release notifier making np-&gt;dev
					== NULL and releases rtnl
continues to dereference a member of
np-&gt;dev which at this point is == NULL

Signed-off-by: Nikolay Aleksandrov &lt;nikolay@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit d0fe8c888b1fd1a2f84b9962cabcb98a70988aec ]

I've been hitting a NULL ptr deref while using netconsole because the
np-&gt;dev check and the pointer manipulation in netpoll_cleanup are done
without rtnl and the following sequence happens when having a netconsole
over a vlan and we remove the vlan while disabling the netconsole:
	CPU 1					CPU2
					removes vlan and calls the notifier
enters store_enabled(), calls
netdev_cleanup which checks np-&gt;dev
and then waits for rtnl
					executes the netconsole netdev
					release notifier making np-&gt;dev
					== NULL and releases rtnl
continues to dereference a member of
np-&gt;dev which at this point is == NULL

Signed-off-by: Nikolay Aleksandrov &lt;nikolay@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>netpoll: Should handle ETH_P_ARP other than ETH_P_IP in netpoll_neigh_reply</title>
<updated>2013-10-13T23:08:29+00:00</updated>
<author>
<name>Sonic Zhang</name>
<email>sonic.zhang@analog.com</email>
</author>
<published>2013-09-11T03:31:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=0885f6b8bb0403a56546d302e749c1defe47339d'/>
<id>0885f6b8bb0403a56546d302e749c1defe47339d</id>
<content type='text'>
[ Upstream commit b0dd663b60944a3ce86430fa35549fb37968bda0 ]

The received ARP request type in the Ethernet packet head is ETH_P_ARP other than ETH_P_IP.

[ Bug introduced by commit b7394d2429c198b1da3d46ac39192e891029ec0f
  ("netpoll: prepare for ipv6") ]

Signed-off-by: Sonic Zhang &lt;sonic.zhang@analog.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit b0dd663b60944a3ce86430fa35549fb37968bda0 ]

The received ARP request type in the Ethernet packet head is ETH_P_ARP other than ETH_P_IP.

[ Bug introduced by commit b7394d2429c198b1da3d46ac39192e891029ec0f
  ("netpoll: prepare for ipv6") ]

Signed-off-by: Sonic Zhang &lt;sonic.zhang@analog.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>netpoll: inverted down_trylock() test</title>
<updated>2013-05-06T15:06:52+00:00</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2013-05-06T02:15:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=a3dbbc2bab8d9a6e55fc0af3906d1dddbc0c531e'/>
<id>a3dbbc2bab8d9a6e55fc0af3906d1dddbc0c531e</id>
<content type='text'>
The return value is reversed from mutex_trylock().

Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The return value is reversed from mutex_trylock().

Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>netpoll: convert mutex into a semaphore</title>
<updated>2013-05-01T19:00:24+00:00</updated>
<author>
<name>Neil Horman</name>
<email>nhorman@tuxdriver.com</email>
</author>
<published>2013-04-30T05:35:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=bd7c4b604a6cd707803c7c6ba142bfa131f9a9f3'/>
<id>bd7c4b604a6cd707803c7c6ba142bfa131f9a9f3</id>
<content type='text'>
Bart Van Assche recently reported a warning to me:

&lt;IRQ&gt;  [&lt;ffffffff8103d79f&gt;] warn_slowpath_common+0x7f/0xc0
[&lt;ffffffff8103d7fa&gt;] warn_slowpath_null+0x1a/0x20
[&lt;ffffffff814761dd&gt;] mutex_trylock+0x16d/0x180
[&lt;ffffffff813968c9&gt;] netpoll_poll_dev+0x49/0xc30
[&lt;ffffffff8136a2d2&gt;] ? __alloc_skb+0x82/0x2a0
[&lt;ffffffff81397715&gt;] netpoll_send_skb_on_dev+0x265/0x410
[&lt;ffffffff81397c5a&gt;] netpoll_send_udp+0x28a/0x3a0
[&lt;ffffffffa0541843&gt;] ? write_msg+0x53/0x110 [netconsole]
[&lt;ffffffffa05418bf&gt;] write_msg+0xcf/0x110 [netconsole]
[&lt;ffffffff8103eba1&gt;] call_console_drivers.constprop.17+0xa1/0x1c0
[&lt;ffffffff8103fb76&gt;] console_unlock+0x2d6/0x450
[&lt;ffffffff8104011e&gt;] vprintk_emit+0x1ee/0x510
[&lt;ffffffff8146f9f6&gt;] printk+0x4d/0x4f
[&lt;ffffffffa0004f1d&gt;] scsi_print_command+0x7d/0xe0 [scsi_mod]

This resulted from my commit ca99ca14c which introduced a mutex_trylock
operation in a path that could execute in interrupt context.  When mutex
debugging is enabled, the above warns the user when we are in fact
exectuting in interrupt context
interrupt context.

After some discussion, It seems that a semaphore is the proper mechanism to use
here.  While mutexes are defined to be unusable in interrupt context, no such
condition exists for semaphores (save for the fact that the non blocking api
calls, like up and down_trylock must be used when in irq context).

Signed-off-by: Neil Horman &lt;nhorman@tuxdriver.com&gt;
Reported-by: Bart Van Assche &lt;bvanassche@acm.org&gt;
CC: Bart Van Assche &lt;bvanassche@acm.org&gt;
CC: David Miller &lt;davem@davemloft.net&gt;
CC: netdev@vger.kernel.org
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Bart Van Assche recently reported a warning to me:

&lt;IRQ&gt;  [&lt;ffffffff8103d79f&gt;] warn_slowpath_common+0x7f/0xc0
[&lt;ffffffff8103d7fa&gt;] warn_slowpath_null+0x1a/0x20
[&lt;ffffffff814761dd&gt;] mutex_trylock+0x16d/0x180
[&lt;ffffffff813968c9&gt;] netpoll_poll_dev+0x49/0xc30
[&lt;ffffffff8136a2d2&gt;] ? __alloc_skb+0x82/0x2a0
[&lt;ffffffff81397715&gt;] netpoll_send_skb_on_dev+0x265/0x410
[&lt;ffffffff81397c5a&gt;] netpoll_send_udp+0x28a/0x3a0
[&lt;ffffffffa0541843&gt;] ? write_msg+0x53/0x110 [netconsole]
[&lt;ffffffffa05418bf&gt;] write_msg+0xcf/0x110 [netconsole]
[&lt;ffffffff8103eba1&gt;] call_console_drivers.constprop.17+0xa1/0x1c0
[&lt;ffffffff8103fb76&gt;] console_unlock+0x2d6/0x450
[&lt;ffffffff8104011e&gt;] vprintk_emit+0x1ee/0x510
[&lt;ffffffff8146f9f6&gt;] printk+0x4d/0x4f
[&lt;ffffffffa0004f1d&gt;] scsi_print_command+0x7d/0xe0 [scsi_mod]

This resulted from my commit ca99ca14c which introduced a mutex_trylock
operation in a path that could execute in interrupt context.  When mutex
debugging is enabled, the above warns the user when we are in fact
exectuting in interrupt context
interrupt context.

After some discussion, It seems that a semaphore is the proper mechanism to use
here.  While mutexes are defined to be unusable in interrupt context, no such
condition exists for semaphores (save for the fact that the non blocking api
calls, like up and down_trylock must be used when in irq context).

Signed-off-by: Neil Horman &lt;nhorman@tuxdriver.com&gt;
Reported-by: Bart Van Assche &lt;bvanassche@acm.org&gt;
CC: Bart Van Assche &lt;bvanassche@acm.org&gt;
CC: David Miller &lt;davem@davemloft.net&gt;
CC: netdev@vger.kernel.org
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: vlan: add protocol argument to packet tagging functions</title>
<updated>2013-04-19T18:46:06+00:00</updated>
<author>
<name>Patrick McHardy</name>
<email>kaber@trash.net</email>
</author>
<published>2013-04-19T02:04:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=86a9bad3ab6b6f858fd4443b48738cabbb6d094c'/>
<id>86a9bad3ab6b6f858fd4443b48738cabbb6d094c</id>
<content type='text'>
Add a protocol argument to the VLAN packet tagging functions. In case of HW
tagging, we need that protocol available in the ndo_start_xmit functions,
so it is stored in a new field in the skb. The new field fits into a hole
(on 64 bit) and doesn't increase the sks's size.

Signed-off-by: Patrick McHardy &lt;kaber@trash.net&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add a protocol argument to the VLAN packet tagging functions. In case of HW
tagging, we need that protocol available in the ndo_start_xmit functions,
so it is stored in a new field in the skb. The new field fits into a hole
(on 64 bit) and doesn't increase the sks's size.

Signed-off-by: Patrick McHardy &lt;kaber@trash.net&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: vlan: rename NETIF_F_HW_VLAN_* feature flags to NETIF_F_HW_VLAN_CTAG_*</title>
<updated>2013-04-19T18:45:26+00:00</updated>
<author>
<name>Patrick McHardy</name>
<email>kaber@trash.net</email>
</author>
<published>2013-04-19T02:04:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=f646968f8f7c624587de729115d802372b9063dd'/>
<id>f646968f8f7c624587de729115d802372b9063dd</id>
<content type='text'>
Rename the hardware VLAN acceleration features to include "CTAG" to indicate
that they only support CTAGs. Follow up patches will introduce 802.1ad
server provider tagging (STAGs) and require the distinction for hardware not
supporting acclerating both.

Signed-off-by: Patrick McHardy &lt;kaber@trash.net&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Rename the hardware VLAN acceleration features to include "CTAG" to indicate
that they only support CTAGs. Follow up patches will introduce 802.1ad
server provider tagging (STAGs) and require the distinction for hardware not
supporting acclerating both.

Signed-off-by: Patrick McHardy &lt;kaber@trash.net&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>netpoll: use DEFINE_STATIC_SRCU() to define netpoll_srcu</title>
<updated>2013-03-17T16:42:43+00:00</updated>
<author>
<name>Lai Jiangshan</name>
<email>laijs@cn.fujitsu.com</email>
</author>
<published>2013-03-15T06:50:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=7f9421c264f8a6e6137027a45ae576517f66fa56'/>
<id>7f9421c264f8a6e6137027a45ae576517f66fa56</id>
<content type='text'>
DEFINE_STATIC_SRCU() defines srcu struct and do init at build time.

Signed-off-by: Lai Jiangshan &lt;laijs@cn.fujitsu.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
DEFINE_STATIC_SRCU() defines srcu struct and do init at build time.

Signed-off-by: Lai Jiangshan &lt;laijs@cn.fujitsu.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>netpoll: fix smatch warnings in netpoll core code</title>
<updated>2013-02-13T16:56:46+00:00</updated>
<author>
<name>Neil Horman</name>
<email>nhorman@tuxdriver.com</email>
</author>
<published>2013-02-13T16:32:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=959d5fdee7aa32fa04bc2c37e3d3871ad266fe97'/>
<id>959d5fdee7aa32fa04bc2c37e3d3871ad266fe97</id>
<content type='text'>
Dan Carpenter contacted me with some notes regarding some smatch warnings in the
netpoll code, some of which I introduced with my recent netpoll locking fixes,
some which were there prior.   Specifically they were:

net-next/net/core/netpoll.c:243 netpoll_poll_dev() warn: inconsistent
  returns mutex:&amp;ni-&gt;dev_lock: locked (213,217) unlocked (210,243)
net-next/net/core/netpoll.c:706 netpoll_neigh_reply() warn: potential
  pointer math issue ('skb_transport_header(send_skb)' is a 128 bit pointer)

This patch corrects the locking imbalance (the first error), and adds some
parenthesis to correct the second error.  Tested by myself. Applies to net-next

Signed-off-by: Neil Horman &lt;nhorman@tuxdriver.com&gt;
CC: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
CC: "David S. Miller" &lt;davem@davemloft.net&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Dan Carpenter contacted me with some notes regarding some smatch warnings in the
netpoll code, some of which I introduced with my recent netpoll locking fixes,
some which were there prior.   Specifically they were:

net-next/net/core/netpoll.c:243 netpoll_poll_dev() warn: inconsistent
  returns mutex:&amp;ni-&gt;dev_lock: locked (213,217) unlocked (210,243)
net-next/net/core/netpoll.c:706 netpoll_neigh_reply() warn: potential
  pointer math issue ('skb_transport_header(send_skb)' is a 128 bit pointer)

This patch corrects the locking imbalance (the first error), and adds some
parenthesis to correct the second error.  Tested by myself. Applies to net-next

Signed-off-by: Neil Horman &lt;nhorman@tuxdriver.com&gt;
CC: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
CC: "David S. Miller" &lt;davem@davemloft.net&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>netpoll: cleanup sparse warnings</title>
<updated>2013-02-12T00:19:58+00:00</updated>
<author>
<name>Neil Horman</name>
<email>nhorman@tuxdriver.com</email>
</author>
<published>2013-02-11T10:25:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=0790bbb68f9d483348c1d65381f3dd92602bfd05'/>
<id>0790bbb68f9d483348c1d65381f3dd92602bfd05</id>
<content type='text'>
With my recent commit I introduced two sparse warnings.  Looking closer there
were a few more in the same file, so I fixed them all up.  Basic rcu pointer
dereferencing suff.

I've validated these changes using CONFIG_PROVE_RCU while starting and stopping
netconsole repeatedly in bonded and non-bonded configurations

Signed-off-by: Neil Horman &lt;nhorman@tuxdriver.com&gt;
CC: fengguang.wu@intel.com
CC: David Miller &lt;davem@davemloft.net&gt;
CC: eric.dumazet@gmail.com

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
With my recent commit I introduced two sparse warnings.  Looking closer there
were a few more in the same file, so I fixed them all up.  Basic rcu pointer
dereferencing suff.

I've validated these changes using CONFIG_PROVE_RCU while starting and stopping
netconsole repeatedly in bonded and non-bonded configurations

Signed-off-by: Neil Horman &lt;nhorman@tuxdriver.com&gt;
CC: fengguang.wu@intel.com
CC: David Miller &lt;davem@davemloft.net&gt;
CC: eric.dumazet@gmail.com

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
</feed>
