<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/net/ipv4, branch v4.4-rc2</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>raw: increment correct SNMP counters for ICMP messages</title>
<updated>2015-11-16T20:08:48+00:00</updated>
<author>
<name>Ben Cartwright-Cox</name>
<email>ben@benjojo.co.uk</email>
</author>
<published>2015-11-14T15:13:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=027ac58e3c757277dd6cb8975d1b69c27853aa76'/>
<id>027ac58e3c757277dd6cb8975d1b69c27853aa76</id>
<content type='text'>
Sending ICMP packets with raw sockets ends up in the SNMP counters
logging the type as the first byte of the IPv4 header rather than
the ICMP header. This is fixed by adding the IP Header Length to
the casting into a icmphdr struct.

Signed-off-by: Ben Cartwright-Cox &lt;ben@benjojo.co.uk&gt;
Acked-by: Eric Dumazet &lt;eric.dumazet@gmail.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>
Sending ICMP packets with raw sockets ends up in the SNMP counters
logging the type as the first byte of the IPv4 header rather than
the ICMP header. This is fixed by adding the IP Header Length to
the casting into a icmphdr struct.

Signed-off-by: Ben Cartwright-Cox &lt;ben@benjojo.co.uk&gt;
Acked-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tcp: ensure proper barriers in lockless contexts</title>
<updated>2015-11-15T23:36:38+00:00</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2015-11-12T16:43:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=00fd38d938db3f1ab1c486549afc450cb7e751b1'/>
<id>00fd38d938db3f1ab1c486549afc450cb7e751b1</id>
<content type='text'>
Some functions access TCP sockets without holding a lock and
might output non consistent data, depending on compiler and or
architecture.

tcp_diag_get_info(), tcp_get_info(), tcp_poll(), get_tcp4_sock() ...

Introduce sk_state_load() and sk_state_store() to fix the issues,
and more clearly document where this lack of locking is happening.

Signed-off-by: Eric Dumazet &lt;edumazet@google.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>
Some functions access TCP sockets without holding a lock and
might output non consistent data, depending on compiler and or
architecture.

tcp_diag_get_info(), tcp_get_info(), tcp_poll(), get_tcp4_sock() ...

Introduce sk_state_load() and sk_state_store() to fix the issues,
and more clearly document where this lack of locking is happening.

Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>netfilter: Fix removal of GRE expectation entries created by PPTP</title>
<updated>2015-11-09T12:32:14+00:00</updated>
<author>
<name>Anthony Lineham</name>
<email>anthony.lineham@alliedtelesis.co.nz</email>
</author>
<published>2015-10-21T22:17:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=c255cb2ed3c7960b2c68f45de1dc0ac2197c8f78'/>
<id>c255cb2ed3c7960b2c68f45de1dc0ac2197c8f78</id>
<content type='text'>
The uninitialized tuple structure caused incorrect hash calculation
and the lookup failed.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=106441
Signed-off-by: Anthony Lineham &lt;anthony.lineham@alliedtelesis.co.nz&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The uninitialized tuple structure caused incorrect hash calculation
and the lookup failed.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=106441
Signed-off-by: Anthony Lineham &lt;anthony.lineham@alliedtelesis.co.nz&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tcp: use correct req pointer in tcp_move_syn() calls</title>
<updated>2015-11-05T20:57:51+00:00</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2015-11-05T20:50:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=49a496c97d035f2eab7cef4894dd46202184fc81'/>
<id>49a496c97d035f2eab7cef4894dd46202184fc81</id>
<content type='text'>
I mistakenly took wrong request sock pointer when calling tcp_move_syn()

@req_unhash is either a copy of @req, or a NULL value for
FastOpen connexions (as we do not expect to unhash the temporary
request sock from ehash table)

Fixes: 805c4bc05705 ("tcp: fix req-&gt;saved_syn race")
Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Cc: Ying Cai &lt;ycai@google.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>
I mistakenly took wrong request sock pointer when calling tcp_move_syn()

@req_unhash is either a copy of @req, or a NULL value for
FastOpen connexions (as we do not expect to unhash the temporary
request sock from ehash table)

Fixes: 805c4bc05705 ("tcp: fix req-&gt;saved_syn race")
Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Cc: Ying Cai &lt;ycai@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ipv4: use sk_fullsock() in ipv4_conntrack_defrag()</title>
<updated>2015-11-05T19:36:09+00:00</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2015-11-05T19:34:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=f668f5f7e0861087ef9d64d473a9c1399fc25471'/>
<id>f668f5f7e0861087ef9d64d473a9c1399fc25471</id>
<content type='text'>
Before converting a 'socket pointer' into inet socket,
use sk_fullsock() to detect timewait or request sockets.

Fixes: ca6fb0651883 ("tcp: attach SYNACK messages to request sockets instead of listener")
Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Reported-by: Dmitry Vyukov &lt;dvyukov@google.com&gt;
Tested-by: Dmitry Vyukov &lt;dvyukov@google.com&gt;
Cc: Pablo Neira Ayuso &lt;pablo@netfilter.org&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>
Before converting a 'socket pointer' into inet socket,
use sk_fullsock() to detect timewait or request sockets.

Fixes: ca6fb0651883 ("tcp: attach SYNACK messages to request sockets instead of listener")
Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Reported-by: Dmitry Vyukov &lt;dvyukov@google.com&gt;
Tested-by: Dmitry Vyukov &lt;dvyukov@google.com&gt;
Cc: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tcp: fix req-&gt;saved_syn race</title>
<updated>2015-11-05T19:36:09+00:00</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2015-11-05T19:07:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=805c4bc05705fb2b71ec970960b456eee9900953'/>
<id>805c4bc05705fb2b71ec970960b456eee9900953</id>
<content type='text'>
For the reasons explained in commit ce1050089c96 ("tcp/dccp: fix
ireq-&gt;pktopts race"), we need to make sure we do not access
req-&gt;saved_syn unless we own the request sock.

This fixes races for listeners using TCP_SAVE_SYN option.

Fixes: e994b2f0fb92 ("tcp: do not lock listener to process SYN packets")
Fixes: 079096f103fa ("tcp/dccp: install syn_recv requests into ehash table")
Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Reported-by: Ying Cai &lt;ycai@google.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>
For the reasons explained in commit ce1050089c96 ("tcp/dccp: fix
ireq-&gt;pktopts race"), we need to make sure we do not access
req-&gt;saved_syn unless we own the request sock.

This fixes races for listeners using TCP_SAVE_SYN option.

Fixes: e994b2f0fb92 ("tcp: do not lock listener to process SYN packets")
Fixes: 079096f103fa ("tcp/dccp: install syn_recv requests into ehash table")
Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Reported-by: Ying Cai &lt;ycai@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: Fix prefsrc lookups</title>
<updated>2015-11-05T02:34:37+00:00</updated>
<author>
<name>David Ahern</name>
<email>dsa@cumulusnetworks.com</email>
</author>
<published>2015-11-03T23:59:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e1b8d903c6c3862160d2d5036806a94786c8fc4e'/>
<id>e1b8d903c6c3862160d2d5036806a94786c8fc4e</id>
<content type='text'>
A bug report (https://bugzilla.kernel.org/show_bug.cgi?id=107071) noted
that the follwoing ip command is failing with v4.3:

    $ ip route add 10.248.5.0/24 dev bond0.250 table vlan_250 src 10.248.5.154
    RTNETLINK answers: Invalid argument

021dd3b8a142d changed the lookup of the given preferred source address to
use the table id passed in, but this assumes the local entries are in the
given table which is not necessarily true for non-VRF use cases. When
validating the preferred source fallback to the local table on failure.

Fixes: 021dd3b8a142d ("net: Add routes to the table associated with the device")
Signed-off-by: David Ahern &lt;dsa@cumulusnetworks.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>
A bug report (https://bugzilla.kernel.org/show_bug.cgi?id=107071) noted
that the follwoing ip command is failing with v4.3:

    $ ip route add 10.248.5.0/24 dev bond0.250 table vlan_250 src 10.248.5.154
    RTNETLINK answers: Invalid argument

021dd3b8a142d changed the lookup of the given preferred source address to
use the table id passed in, but this assumes the local entries are in the
given table which is not necessarily true for non-VRF use cases. When
validating the preferred source fallback to the local table on failure.

Fixes: 021dd3b8a142d ("net: Add routes to the table associated with the device")
Signed-off-by: David Ahern &lt;dsa@cumulusnetworks.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ipv4: fix a potential deadlock in mcast getsockopt() path</title>
<updated>2015-11-05T02:29:59+00:00</updated>
<author>
<name>WANG Cong</name>
<email>xiyou.wangcong@gmail.com</email>
</author>
<published>2015-11-03T23:41:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=87e9f0315952b0dd8b5e51ba04beda03efc009d9'/>
<id>87e9f0315952b0dd8b5e51ba04beda03efc009d9</id>
<content type='text'>
Sasha reported the following lockdep warning:

  Possible unsafe locking scenario:

        CPU0                    CPU1
        ----                    ----
   lock(sk_lock-AF_INET);
                                lock(rtnl_mutex);
                                lock(sk_lock-AF_INET);
   lock(rtnl_mutex);

This is due to that for IP_MSFILTER and MCAST_MSFILTER, we take
rtnl lock before the socket lock in setsockopt() path, but take
the socket lock before rtnl lock in getsockopt() path. All the
rest optnames are setsockopt()-only.

Fix this by aligning the getsockopt() path with the setsockopt()
path, so that all mcast socket path would be locked in the same
order.

Note, IPv6 part is different where rtnl lock is not held.

Fixes: 54ff9ef36bdf ("ipv4, ipv6: kill ip_mc_{join, leave}_group and ipv6_sock_mc_{join, drop}")
Reported-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
Cc: Marcelo Ricardo Leitner &lt;marcelo.leitner@gmail.com&gt;
Signed-off-by: Cong Wang &lt;xiyou.wangcong@gmail.com&gt;
Reviewed-by: Marcelo Ricardo Leitner &lt;marcelo.leitner@gmail.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>
Sasha reported the following lockdep warning:

  Possible unsafe locking scenario:

        CPU0                    CPU1
        ----                    ----
   lock(sk_lock-AF_INET);
                                lock(rtnl_mutex);
                                lock(sk_lock-AF_INET);
   lock(rtnl_mutex);

This is due to that for IP_MSFILTER and MCAST_MSFILTER, we take
rtnl lock before the socket lock in setsockopt() path, but take
the socket lock before rtnl lock in getsockopt() path. All the
rest optnames are setsockopt()-only.

Fix this by aligning the getsockopt() path with the setsockopt()
path, so that all mcast socket path would be locked in the same
order.

Note, IPv6 part is different where rtnl lock is not held.

Fixes: 54ff9ef36bdf ("ipv4, ipv6: kill ip_mc_{join, leave}_group and ipv6_sock_mc_{join, drop}")
Reported-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
Cc: Marcelo Ricardo Leitner &lt;marcelo.leitner@gmail.com&gt;
Signed-off-by: Cong Wang &lt;xiyou.wangcong@gmail.com&gt;
Reviewed-by: Marcelo Ricardo Leitner &lt;marcelo.leitner@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ipv4: disable BH when changing ip local port range</title>
<updated>2015-11-05T02:29:06+00:00</updated>
<author>
<name>WANG Cong</name>
<email>xiyou.wangcong@gmail.com</email>
</author>
<published>2015-11-03T22:32:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=4ee3bd4a8c7463cdef0b82ebc33fc94a9170a7e0'/>
<id>4ee3bd4a8c7463cdef0b82ebc33fc94a9170a7e0</id>
<content type='text'>
This fixes the following lockdep warning:

 [ INFO: inconsistent lock state ]
 4.3.0-rc7+ #1197 Not tainted
 ---------------------------------
 inconsistent {IN-SOFTIRQ-R} -&gt; {SOFTIRQ-ON-W} usage.
 sysctl/1019 [HC0[0]:SC0[0]:HE1:SE1] takes:
  (&amp;(&amp;net-&gt;ipv4.ip_local_ports.lock)-&gt;seqcount){+.+-..}, at: [&lt;ffffffff81921de7&gt;] ipv4_local_port_range+0xb4/0x12a
 {IN-SOFTIRQ-R} state was registered at:
   [&lt;ffffffff810bd682&gt;] __lock_acquire+0x2f6/0xdf0
   [&lt;ffffffff810be6d5&gt;] lock_acquire+0x11c/0x1a4
   [&lt;ffffffff818e599c&gt;] inet_get_local_port_range+0x4e/0xae
   [&lt;ffffffff8166e8e3&gt;] udp_flow_src_port.constprop.40+0x23/0x116
   [&lt;ffffffff81671cb9&gt;] vxlan_xmit_one+0x219/0xa6a
   [&lt;ffffffff81672f75&gt;] vxlan_xmit+0xa6b/0xaa5
   [&lt;ffffffff817f2deb&gt;] dev_hard_start_xmit+0x2ae/0x465
   [&lt;ffffffff817f35ed&gt;] __dev_queue_xmit+0x531/0x633
   [&lt;ffffffff817f3702&gt;] dev_queue_xmit_sk+0x13/0x15
   [&lt;ffffffff818004a5&gt;] neigh_resolve_output+0x12f/0x14d
   [&lt;ffffffff81959cfa&gt;] ip6_finish_output2+0x344/0x39f
   [&lt;ffffffff8195bf58&gt;] ip6_finish_output+0x88/0x8e
   [&lt;ffffffff8195bfef&gt;] ip6_output+0x91/0xe5
   [&lt;ffffffff819792ae&gt;] dst_output_sk+0x47/0x4c
   [&lt;ffffffff81979392&gt;] NF_HOOK_THRESH.constprop.30+0x38/0x82
   [&lt;ffffffff8197981e&gt;] mld_sendpack+0x189/0x266
   [&lt;ffffffff8197b28b&gt;] mld_ifc_timer_expire+0x1ef/0x223
   [&lt;ffffffff810de581&gt;] call_timer_fn+0xfb/0x28c
   [&lt;ffffffff810ded1e&gt;] run_timer_softirq+0x1c7/0x1f1

Fixes: b8f1a55639e6 ("udp: Add function to make source port for UDP tunnels")
Cc: Tom Herbert &lt;tom@herbertland.com&gt;
Signed-off-by: Cong Wang &lt;xiyou.wangcong@gmail.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>
This fixes the following lockdep warning:

 [ INFO: inconsistent lock state ]
 4.3.0-rc7+ #1197 Not tainted
 ---------------------------------
 inconsistent {IN-SOFTIRQ-R} -&gt; {SOFTIRQ-ON-W} usage.
 sysctl/1019 [HC0[0]:SC0[0]:HE1:SE1] takes:
  (&amp;(&amp;net-&gt;ipv4.ip_local_ports.lock)-&gt;seqcount){+.+-..}, at: [&lt;ffffffff81921de7&gt;] ipv4_local_port_range+0xb4/0x12a
 {IN-SOFTIRQ-R} state was registered at:
   [&lt;ffffffff810bd682&gt;] __lock_acquire+0x2f6/0xdf0
   [&lt;ffffffff810be6d5&gt;] lock_acquire+0x11c/0x1a4
   [&lt;ffffffff818e599c&gt;] inet_get_local_port_range+0x4e/0xae
   [&lt;ffffffff8166e8e3&gt;] udp_flow_src_port.constprop.40+0x23/0x116
   [&lt;ffffffff81671cb9&gt;] vxlan_xmit_one+0x219/0xa6a
   [&lt;ffffffff81672f75&gt;] vxlan_xmit+0xa6b/0xaa5
   [&lt;ffffffff817f2deb&gt;] dev_hard_start_xmit+0x2ae/0x465
   [&lt;ffffffff817f35ed&gt;] __dev_queue_xmit+0x531/0x633
   [&lt;ffffffff817f3702&gt;] dev_queue_xmit_sk+0x13/0x15
   [&lt;ffffffff818004a5&gt;] neigh_resolve_output+0x12f/0x14d
   [&lt;ffffffff81959cfa&gt;] ip6_finish_output2+0x344/0x39f
   [&lt;ffffffff8195bf58&gt;] ip6_finish_output+0x88/0x8e
   [&lt;ffffffff8195bfef&gt;] ip6_output+0x91/0xe5
   [&lt;ffffffff819792ae&gt;] dst_output_sk+0x47/0x4c
   [&lt;ffffffff81979392&gt;] NF_HOOK_THRESH.constprop.30+0x38/0x82
   [&lt;ffffffff8197981e&gt;] mld_sendpack+0x189/0x266
   [&lt;ffffffff8197b28b&gt;] mld_ifc_timer_expire+0x1ef/0x223
   [&lt;ffffffff810de581&gt;] call_timer_fn+0xfb/0x28c
   [&lt;ffffffff810ded1e&gt;] run_timer_softirq+0x1c7/0x1f1

Fixes: b8f1a55639e6 ("udp: Add function to make source port for UDP tunnels")
Cc: Tom Herbert &lt;tom@herbertland.com&gt;
Signed-off-by: Cong Wang &lt;xiyou.wangcong@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net</title>
<updated>2015-11-03T18:41:45+00:00</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2015-11-03T18:41:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=73186df8d7fa574345f0ad626ebe89649f8308a5'/>
<id>73186df8d7fa574345f0ad626ebe89649f8308a5</id>
<content type='text'>
Minor overlapping changes in net/ipv4/ipmr.c, in 'net' we were
fixing the "BH-ness" of the counter bumps whilst in 'net-next'
the functions were modified to take an explicit 'net' parameter.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Minor overlapping changes in net/ipv4/ipmr.c, in 'net' we were
fixing the "BH-ness" of the counter bumps whilst in 'net-next'
the functions were modified to take an explicit 'net' parameter.

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