<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/net/ipv6, branch v3.2.38</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/net/ipv6?h=v3.2.38</id>
<link rel='self' href='https://git.amat.us/linux/atom/net/ipv6?h=v3.2.38'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2013-01-16T01:13:24Z</updated>
<entry>
<title>inet: Fix kmemleak in tcp_v4/6_syn_recv_sock and dccp_v4/6_request_recv_sock</title>
<updated>2013-01-16T01:13:24Z</updated>
<author>
<name>Christoph Paasch</name>
<email>christoph.paasch@uclouvain.be</email>
</author>
<published>2012-12-14T04:07:58Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=9c68c2b7558ca787ad75075eb3f4e106033ed2e7'/>
<id>urn:sha1:9c68c2b7558ca787ad75075eb3f4e106033ed2e7</id>
<content type='text'>
[ Upstream commit e337e24d6624e74a558aa69071e112a65f7b5758 ]

If in either of the above functions inet_csk_route_child_sock() or
__inet_inherit_port() fails, the newsk will not be freed:

unreferenced object 0xffff88022e8a92c0 (size 1592):
  comm "softirq", pid 0, jiffies 4294946244 (age 726.160s)
  hex dump (first 32 bytes):
    0a 01 01 01 0a 01 01 02 00 00 00 00 a7 cc 16 00  ................
    02 00 03 01 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [&lt;ffffffff8153d190&gt;] kmemleak_alloc+0x21/0x3e
    [&lt;ffffffff810ab3e7&gt;] kmem_cache_alloc+0xb5/0xc5
    [&lt;ffffffff8149b65b&gt;] sk_prot_alloc.isra.53+0x2b/0xcd
    [&lt;ffffffff8149b784&gt;] sk_clone_lock+0x16/0x21e
    [&lt;ffffffff814d711a&gt;] inet_csk_clone_lock+0x10/0x7b
    [&lt;ffffffff814ebbc3&gt;] tcp_create_openreq_child+0x21/0x481
    [&lt;ffffffff814e8fa5&gt;] tcp_v4_syn_recv_sock+0x3a/0x23b
    [&lt;ffffffff814ec5ba&gt;] tcp_check_req+0x29f/0x416
    [&lt;ffffffff814e8e10&gt;] tcp_v4_do_rcv+0x161/0x2bc
    [&lt;ffffffff814eb917&gt;] tcp_v4_rcv+0x6c9/0x701
    [&lt;ffffffff814cea9f&gt;] ip_local_deliver_finish+0x70/0xc4
    [&lt;ffffffff814cec20&gt;] ip_local_deliver+0x4e/0x7f
    [&lt;ffffffff814ce9f8&gt;] ip_rcv_finish+0x1fc/0x233
    [&lt;ffffffff814cee68&gt;] ip_rcv+0x217/0x267
    [&lt;ffffffff814a7bbe&gt;] __netif_receive_skb+0x49e/0x553
    [&lt;ffffffff814a7cc3&gt;] netif_receive_skb+0x50/0x82

This happens, because sk_clone_lock initializes sk_refcnt to 2, and thus
a single sock_put() is not enough to free the memory. Additionally, things
like xfrm, memcg, cookie_values,... may have been initialized.
We have to free them properly.

This is fixed by forcing a call to tcp_done(), ending up in
inet_csk_destroy_sock, doing the final sock_put(). tcp_done() is necessary,
because it ends up doing all the cleanup on xfrm, memcg, cookie_values,
xfrm,...

Before calling tcp_done, we have to set the socket to SOCK_DEAD, to
force it entering inet_csk_destroy_sock. To avoid the warning in
inet_csk_destroy_sock, inet_num has to be set to 0.
As inet_csk_destroy_sock does a dec on orphan_count, we first have to
increase it.

Calling tcp_done() allows us to remove the calls to
tcp_clear_xmit_timer() and tcp_cleanup_congestion_control().

A similar approach is taken for dccp by calling dccp_done().

This is in the kernel since 093d282321 (tproxy: fix hash locking issue
when using port redirection in __inet_inherit_port()), thus since
version &gt;= 2.6.37.

Signed-off-by: Christoph Paasch &lt;christoph.paasch@uclouvain.be&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>ipv6: setsockopt(IPIPPROTO_IPV6, IPV6_MINHOPCOUNT) forgot to set return value</title>
<updated>2012-12-06T11:20:11Z</updated>
<author>
<name>Hannes Frederic Sowa</name>
<email>hannes@stressinduktion.org</email>
</author>
<published>2012-11-10T19:52:34Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=edd265dc3128ce255654440b6bdf518dbe6325fd'/>
<id>urn:sha1:edd265dc3128ce255654440b6bdf518dbe6325fd</id>
<content type='text'>
[ Upstream commit d4596bad2a713fcd0def492b1960e6d899d5baa8 ]

Cc: Stephen Hemminger &lt;shemminger@vyatta.com&gt;
Signed-off-by: Hannes Frederic Sowa &lt;hannes@stressinduktion.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>ipv6: send unsolicited neighbour advertisements to all-nodes</title>
<updated>2012-11-16T16:47:18Z</updated>
<author>
<name>Hannes Frederic Sowa</name>
<email>hannes@stressinduktion.org</email>
</author>
<published>2012-11-06T16:18:41Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=2a40657242f3675a8820a00f59c2e96cbed25d23'/>
<id>urn:sha1:2a40657242f3675a8820a00f59c2e96cbed25d23</id>
<content type='text'>
[ Upstream commit 60713a0ca7fd6651b951cc1b4dbd528d1fc0281b ]

As documented in RFC4861 (Neighbor Discovery for IP version 6) 7.2.6.,
unsolicited neighbour advertisements should be sent to the all-nodes
multicast address.

Signed-off-by: Hannes Frederic Sowa &lt;hannes@stressinduktion.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>ipv6: Set default hoplimit as zero.</title>
<updated>2012-11-16T16:47:16Z</updated>
<author>
<name>Li RongQing</name>
<email>roy.qing.li@gmail.com</email>
</author>
<published>2012-10-24T06:01:18Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=379e38f89ef5e17a048482c900af4acb3afb86ef'/>
<id>urn:sha1:379e38f89ef5e17a048482c900af4acb3afb86ef</id>
<content type='text'>
[ Upstream commit 14edd87dc67311556f1254a8f29cf4dd6cb5b7d1 ]

Commit a02e4b7dae4551(Demark default hoplimit as zero) only changes the
hoplimit checking condition and default value in ip6_dst_hoplimit, not
zeros all hoplimit default value.

Keep the zeroing ip6_template_metrics[RTAX_HOPLIMIT - 1] to force it as
const, cause as a37e6e344910(net: force dst_default_metrics to const
section)

Signed-off-by: Li RongQing &lt;roy.qing.li@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>tcp: resets are misrouted</title>
<updated>2012-10-30T23:26:35Z</updated>
<author>
<name>Alexey Kuznetsov</name>
<email>kuznet@ms2.inr.ac.ru</email>
</author>
<published>2012-10-12T04:34:17Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=bc25463b2238562c3470c3bb0e15a9799defde7b'/>
<id>urn:sha1:bc25463b2238562c3470c3bb0e15a9799defde7b</id>
<content type='text'>
[ Upstream commit 4c67525849e0b7f4bd4fab2487ec9e43ea52ef29 ]

After commit e2446eaa ("tcp_v4_send_reset: binding oif to iif in no
sock case").. tcp resets are always lost, when routing is asymmetric.
Yes, backing out that patch will result in misrouting of resets for
dead connections which used interface binding when were alive, but we
actually cannot do anything here.  What's died that's died and correct
handling normal unbound connections is obviously a priority.

Comment to comment:
&gt; This has few benefits:
&gt;   1. tcp_v6_send_reset already did that.

It was done to route resets for IPv6 link local addresses. It was a
mistake to do so for global addresses. The patch fixes this as well.

Actually, the problem appears to be even more serious than guaranteed
loss of resets.  As reported by Sergey Soloviev &lt;sol@eqv.ru&gt;, those
misrouted resets create a lot of arp traffic and huge amount of
unresolved arp entires putting down to knees NAT firewalls which use
asymmetric routing.

Signed-off-by: Alexey Kuznetsov &lt;kuznet@ms2.inr.ac.ru&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>ipv6: mip6: fix mip6_mh_filter()</title>
<updated>2012-10-10T02:31:32Z</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2012-09-25T20:01:28Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=ef15da3b6b92295660dd0f0af7011cf941654ab4'/>
<id>urn:sha1:ef15da3b6b92295660dd0f0af7011cf941654ab4</id>
<content type='text'>
[ Upstream commit 96af69ea2a83d292238bdba20e4508ee967cf8cb ]

mip6_mh_filter() should not modify its input, or else its caller
would need to recompute ipv6_hdr() if skb-&gt;head is reallocated.

Use skb_header_pointer() instead of pskb_may_pull()

Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>ipv6: raw: fix icmpv6_filter()</title>
<updated>2012-10-10T02:31:32Z</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2012-09-25T07:03:40Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=c3fc2c27f7c56d074f740f1735a2760df4a441bd'/>
<id>urn:sha1:c3fc2c27f7c56d074f740f1735a2760df4a441bd</id>
<content type='text'>
[ Upstream commit 1b05c4b50edbddbdde715c4a7350629819f6655e ]

icmpv6_filter() should not modify its input, or else its caller
would need to recompute ipv6_hdr() if skb-&gt;head is reallocated.

Use skb_header_pointer() instead of pskb_may_pull() and
change the prototype to make clear both sk and skb are const.

Also, if icmpv6 header cannot be found, do not deliver the packet,
as we do in IPv4.

Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>ipv6: release reference of ip6_null_entry's dst entry in __ip6_del_rt</title>
<updated>2012-10-10T02:31:28Z</updated>
<author>
<name>Gao feng</name>
<email>gaofeng@cn.fujitsu.com</email>
</author>
<published>2012-09-19T19:25:34Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=242582dfc34fb64481d6466cbf816768356d2494'/>
<id>urn:sha1:242582dfc34fb64481d6466cbf816768356d2494</id>
<content type='text'>
[ Upstream commit 6825a26c2dc21eb4f8df9c06d3786ddec97cf53b ]

as we hold dst_entry before we call __ip6_del_rt,
so we should alse call dst_release not only return
-ENOENT when the rt6_info is ip6_null_entry.

and we already hold the dst entry, so I think it's
safe to call dst_release out of the write-read lock.

Signed-off-by: Gao feng &lt;gaofeng@cn.fujitsu.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>ipv6: addrconf: Avoid calling netdevice notifiers with RCU read-side lock</title>
<updated>2012-09-19T14:04:49Z</updated>
<author>
<name>Ben Hutchings</name>
<email>bhutchings@solarflare.com</email>
</author>
<published>2012-08-14T08:54:51Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=86134afa03b3d154314e81bbc874dfec66ab74c0'/>
<id>urn:sha1:86134afa03b3d154314e81bbc874dfec66ab74c0</id>
<content type='text'>
[ Upstream commit 4acd4945cd1e1f92b20d14e349c6c6a52acbd42d ]

Cong Wang reports that lockdep detected suspicious RCU usage while
enabling IPV6 forwarding:

 [ 1123.310275] ===============================
 [ 1123.442202] [ INFO: suspicious RCU usage. ]
 [ 1123.558207] 3.6.0-rc1+ #109 Not tainted
 [ 1123.665204] -------------------------------
 [ 1123.768254] include/linux/rcupdate.h:430 Illegal context switch in RCU read-side critical section!
 [ 1123.992320]
 [ 1123.992320] other info that might help us debug this:
 [ 1123.992320]
 [ 1124.307382]
 [ 1124.307382] rcu_scheduler_active = 1, debug_locks = 0
 [ 1124.522220] 2 locks held by sysctl/5710:
 [ 1124.648364]  #0:  (rtnl_mutex){+.+.+.}, at: [&lt;ffffffff81768498&gt;] rtnl_trylock+0x15/0x17
 [ 1124.882211]  #1:  (rcu_read_lock){.+.+.+}, at: [&lt;ffffffff81871df8&gt;] rcu_lock_acquire+0x0/0x29
 [ 1125.085209]
 [ 1125.085209] stack backtrace:
 [ 1125.332213] Pid: 5710, comm: sysctl Not tainted 3.6.0-rc1+ #109
 [ 1125.441291] Call Trace:
 [ 1125.545281]  [&lt;ffffffff8109d915&gt;] lockdep_rcu_suspicious+0x109/0x112
 [ 1125.667212]  [&lt;ffffffff8107c240&gt;] rcu_preempt_sleep_check+0x45/0x47
 [ 1125.781838]  [&lt;ffffffff8107c260&gt;] __might_sleep+0x1e/0x19b
[...]
 [ 1127.445223]  [&lt;ffffffff81757ac5&gt;] call_netdevice_notifiers+0x4a/0x4f
[...]
 [ 1127.772188]  [&lt;ffffffff8175e125&gt;] dev_disable_lro+0x32/0x6b
 [ 1127.885174]  [&lt;ffffffff81872d26&gt;] dev_forward_change+0x30/0xcb
 [ 1128.013214]  [&lt;ffffffff818738c4&gt;] addrconf_forward_change+0x85/0xc5
[...]

addrconf_forward_change() uses RCU iteration over the netdev list,
which is unnecessary since it already holds the RTNL lock.  We also
cannot reasonably require netdevice notifier functions not to sleep.

Reported-by: Cong Wang &lt;amwang@redhat.com&gt;
Signed-off-by: Ben Hutchings &lt;bhutchings@solarflare.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>ipv6: Move ipv6 proc file registration to end of init order</title>
<updated>2012-07-12T03:32:16Z</updated>
<author>
<name>Thomas Graf</name>
<email>tgraf@suug.ch</email>
</author>
<published>2012-06-18T12:08:33Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=bb6c2337ae71d5eb2e0c8106d6be2a209f2599df'/>
<id>urn:sha1:bb6c2337ae71d5eb2e0c8106d6be2a209f2599df</id>
<content type='text'>
[ Upstream commit d189634ecab947c10f6f832258b103d0bbfe73cc ]

/proc/net/ipv6_route reflects the contents of fib_table_hash. The proc
handler is installed in ip6_route_net_init() whereas fib_table_hash is
allocated in fib6_net_init() _after_ the proc handler has been installed.

This opens up a short time frame to access fib_table_hash with its pants
down.

Move the registration of the proc files to a later point in the init
order to avoid the race.

Tested :-)

Signed-off-by: Thomas Graf &lt;tgraf@suug.ch&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
</feed>
