<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/net/ipv6, branch v4.7</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v4.7</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.7'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2016-07-11T19:43:15Z</updated>
<entry>
<title>udp: prevent bugcheck if filter truncates packet too much</title>
<updated>2016-07-11T19:43:15Z</updated>
<author>
<name>Michal Kubeček</name>
<email>mkubecek@suse.cz</email>
</author>
<published>2016-07-08T15:52:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a612769774a30e4fc143c4cb6395c12573415660'/>
<id>urn:sha1:a612769774a30e4fc143c4cb6395c12573415660</id>
<content type='text'>
If socket filter truncates an udp packet below the length of UDP header
in udpv6_queue_rcv_skb() or udp_queue_rcv_skb(), it will trigger a
BUG_ON in skb_pull_rcsum(). This BUG_ON (and therefore a system crash if
kernel is configured that way) can be easily enforced by an unprivileged
user which was reported as CVE-2016-6162. For a reproducer, see
http://seclists.org/oss-sec/2016/q3/8

Fixes: e6afc8ace6dd ("udp: remove headers from UDP packets before queueing")
Reported-by: Marco Grassi &lt;marco.gra@gmail.com&gt;
Signed-off-by: Michal Kubecek &lt;mkubecek@suse.cz&gt;
Acked-by: Eric Dumazet &lt;edumazet@google.com&gt;
Acked-by: Willem de Bruijn &lt;willemb@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>ipv6: Fix mem leak in rt6i_pcpu</title>
<updated>2016-07-05T21:09:23Z</updated>
<author>
<name>Martin KaFai Lau</name>
<email>kafai@fb.com</email>
</author>
<published>2016-07-05T19:10:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=903ce4abdf374e3365d93bcb3df56c62008835ba'/>
<id>urn:sha1:903ce4abdf374e3365d93bcb3df56c62008835ba</id>
<content type='text'>
It was first reported and reproduced by Petr (thanks!) in
https://bugzilla.kernel.org/show_bug.cgi?id=119581

free_percpu(rt-&gt;rt6i_pcpu) used to always happen in ip6_dst_destroy().

However, after fixing a deadlock bug in
commit 9c7370a166b4 ("ipv6: Fix a potential deadlock when creating pcpu rt"),
free_percpu() is not called before setting non_pcpu_rt-&gt;rt6i_pcpu to NULL.

It is worth to note that rt6i_pcpu is protected by table-&gt;tb6_lock.

kmemleak somehow did not report it.  We nailed it down by
observing the pcpu entries in /proc/vmallocinfo (first suggested
by Hannes, thanks!).

Signed-off-by: Martin KaFai Lau &lt;kafai@fb.com&gt;
Fixes: 9c7370a166b4 ("ipv6: Fix a potential deadlock when creating pcpu rt")
Reported-by: Petr Novopashenniy &lt;pety@rusnet.ru&gt;
Tested-by: Petr Novopashenniy &lt;pety@rusnet.ru&gt;
Acked-by: Hannes Frederic Sowa &lt;hannes@stressinduktion.org&gt;
Cc: Hannes Frederic Sowa &lt;hannes@stressinduktion.org&gt;
Cc: Petr Novopashenniy &lt;pety@rusnet.ru&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>ipmr/ip6mr: Initialize the last assert time of mfc entries.</title>
<updated>2016-06-28T08:14:09Z</updated>
<author>
<name>Tom Goff</name>
<email>thomas.goff@ll.mit.edu</email>
</author>
<published>2016-06-23T20:11:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=70a0dec45174c976c64b4c8c1d0898581f759948'/>
<id>urn:sha1:70a0dec45174c976c64b4c8c1d0898581f759948</id>
<content type='text'>
This fixes wrong-interface signaling on 32-bit platforms for entries
created when jiffies &gt; 2^31 + MFC_ASSERT_THRESH.

Signed-off-by: Tom Goff &lt;thomas.goff@ll.mit.edu&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>ipv6: enforce egress device match in per table nexthop lookups</title>
<updated>2016-06-27T14:37:20Z</updated>
<author>
<name>Paolo Abeni</name>
<email>pabeni@redhat.com</email>
</author>
<published>2016-06-23T13:25:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=48f1dcb55a7d29aeb8965c567660c14d0dfd1a42'/>
<id>urn:sha1:48f1dcb55a7d29aeb8965c567660c14d0dfd1a42</id>
<content type='text'>
with the commit 8c14586fc320 ("net: ipv6: Use passed in table for
nexthop lookups"), net hop lookup is first performed on route creation
in the passed-in table.
However device match is not enforced in table lookup, so the found
route can be later discarded due to egress device mismatch and no
global lookup will be performed.
This cause the following to fail:

ip link add dummy1 type dummy
ip link add dummy2 type dummy
ip link set dummy1 up
ip link set dummy2 up
ip route add 2001:db8:8086::/48 dev dummy1 metric 20
ip route add 2001:db8:d34d::/64 via 2001:db8:8086::2 dev dummy1 metric 20
ip route add 2001:db8:8086::/48 dev dummy2 metric 21
ip route add 2001:db8:d34d::/64 via 2001:db8:8086::2 dev dummy2 metric 21
RTNETLINK answers: No route to host

This change fixes the issue enforcing device lookup in
ip6_nh_lookup_table()

v1-&gt;v2: updated commit message title

Fixes: 8c14586fc320 ("net: ipv6: Use passed in table for nexthop lookups")
Reported-and-tested-by: Beniamino Galvani &lt;bgalvani@redhat.com&gt;
Signed-off-by: Paolo Abeni &lt;pabeni@redhat.com&gt;
Acked-by: David Ahern &lt;dsa@cumulusnetworks.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>sit: correct IP protocol used in ipip6_err</title>
<updated>2016-06-17T00:10:30Z</updated>
<author>
<name>Simon Horman</name>
<email>simon.horman@netronome.com</email>
</author>
<published>2016-06-16T08:06:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d5d8760b78d0cfafe292f965f599988138b06a70'/>
<id>urn:sha1:d5d8760b78d0cfafe292f965f599988138b06a70</id>
<content type='text'>
Since 32b8a8e59c9c ("sit: add IPv4 over IPv4 support")
ipip6_err() may be called for packets whose IP protocol is
IPPROTO_IPIP as well as those whose IP protocol is IPPROTO_IPV6.

In the case of IPPROTO_IPIP packets the correct protocol value is not
passed to ipv4_update_pmtu() or ipv4_redirect().

This patch resolves this problem by using the IP protocol of the packet
rather than a hard-coded value. This appears to be consistent
with the usage of the protocol of a packet by icmp_socket_deliver()
the caller of ipip6_err().

I was able to exercise the redirect case by using a setup where an ICMP
redirect was received for the destination of the encapsulated packet.
However, it appears that although incorrect the protocol field is not used
in this case and thus no problem manifests.  On inspection it does not
appear that a problem will manifest in the fragmentation needed/update pmtu
case either.

In short I believe this is a cosmetic fix. None the less, the use of
IPPROTO_IPV6 seems wrong and confusing.

Reviewed-by: Dinan Gunawardena &lt;dinan.gunawardena@netronome.com&gt;
Signed-off-by: Simon Horman &lt;simon.horman@netronome.com&gt;
Acked-by: YOSHIFUJI Hideaki &lt;yoshfuji@linux-ipv6.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>gre: fix error handler</title>
<updated>2016-06-16T05:15:21Z</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2016-06-15T13:24:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e582615ad33dbd39623084a02e95567b116e1eea'/>
<id>urn:sha1:e582615ad33dbd39623084a02e95567b116e1eea</id>
<content type='text'>
1) gre_parse_header() can be called from gre_err()

   At this point transport header points to ICMP header, not the inner
header.

2) We can not really change transport header as ipgre_err() will later
assume transport header still points to ICMP header (using icmp_hdr())

3) pskb_may_pull() logic in gre_parse_header() really works
  if we are interested at zone pointed by skb-&gt;data

4) As Jiri explained in commit b7f8fe251e46 ("gre: do not pull header in
ICMP error processing") we should not pull headers in error handler.

So this fix :

A) changes gre_parse_header() to use skb-&gt;data instead of
skb_transport_header()

B) Adds a nhs parameter to gre_parse_header() so that we can skip the
not pulled IP header from error path.
  This offset is 0 for normal receive path.

C) remove obsolete IPV6 includes

Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Cc: Tom Herbert &lt;tom@herbertland.com&gt;
Cc: Maciej Żenczykowski &lt;maze@google.com&gt;
Cc: Jiri Benc &lt;jbenc@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>udp reuseport: fix packet of same flow hashed to different socket</title>
<updated>2016-06-14T21:23:09Z</updated>
<author>
<name>Su, Xuemin</name>
<email>suxm@chinanetcenter.com</email>
</author>
<published>2016-06-13T03:02:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d1e37288c9146dccff830e3253e403af8705b51f'/>
<id>urn:sha1:d1e37288c9146dccff830e3253e403af8705b51f</id>
<content type='text'>
There is a corner case in which udp packets belonging to a same
flow are hashed to different socket when hslot-&gt;count changes from 10
to 11:

1) When hslot-&gt;count &lt;= 10, __udp_lib_lookup() searches udp_table-&gt;hash,
and always passes 'daddr' to udp_ehashfn().

2) When hslot-&gt;count &gt; 10, __udp_lib_lookup() searches udp_table-&gt;hash2,
but may pass 'INADDR_ANY' to udp_ehashfn() if the sockets are bound to
INADDR_ANY instead of some specific addr.

That means when hslot-&gt;count changes from 10 to 11, the hash calculated by
udp_ehashfn() is also changed, and the udp packets belonging to a same
flow will be hashed to different socket.

This is easily reproduced:
1) Create 10 udp sockets and bind all of them to 0.0.0.0:40000.
2) From the same host send udp packets to 127.0.0.1:40000, record the
socket index which receives the packets.
3) Create 1 more udp socket and bind it to 0.0.0.0:44096. The number 44096
is 40000 + UDP_HASH_SIZE(4096), this makes the new socket put into the
same hslot as the aformentioned 10 sockets, and makes the hslot-&gt;count
change from 10 to 11.
4) From the same host send udp packets to 127.0.0.1:40000, and the socket
index which receives the packets will be different from the one received
in step 2.
This should not happen as the socket bound to 0.0.0.0:44096 should not
change the behavior of the sockets bound to 0.0.0.0:40000.

It's the same case for IPv6, and this patch also fixes that.

Signed-off-by: Su, Xuemin &lt;suxm@chinanetcenter.com&gt;
Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>ipv6: fix checksum annotation in udp6_csum_init</title>
<updated>2016-06-14T19:26:42Z</updated>
<author>
<name>Hannes Frederic Sowa</name>
<email>hannes@stressinduktion.org</email>
</author>
<published>2016-06-11T19:15:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c148d16369ff0095eca950d17968ba1d56a47b53'/>
<id>urn:sha1:c148d16369ff0095eca950d17968ba1d56a47b53</id>
<content type='text'>
Cc: Tom Herbert &lt;tom@herbertland.com&gt;
Fixes: 4068579e1e098fa ("net: Implmement RFC 6936 (zero RX csums for UDP/IPv6")
Signed-off-by: Hannes Frederic Sowa &lt;hannes@stressinduktion.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>ipv6: tcp: fix endianness annotation in tcp_v6_send_response</title>
<updated>2016-06-14T19:25:35Z</updated>
<author>
<name>Hannes Frederic Sowa</name>
<email>hannes@stressinduktion.org</email>
</author>
<published>2016-06-11T18:41:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5119bd16815d3f0364390a1369392dcc036790e7'/>
<id>urn:sha1:5119bd16815d3f0364390a1369392dcc036790e7</id>
<content type='text'>
Cc: Florent Fourcot &lt;florent.fourcot@enst-bretagne.fr&gt;
Fixes: 1d13a96c74fc ("ipv6: tcp: fix flowlabel value in ACK messages send from TIME_WAIT")
Signed-off-by: Hannes Frederic Sowa &lt;hannes@stressinduktion.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>ipv6: fix endianness error in icmpv6_err</title>
<updated>2016-06-14T19:24:35Z</updated>
<author>
<name>Hannes Frederic Sowa</name>
<email>hannes@stressinduktion.org</email>
</author>
<published>2016-06-11T18:32:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=dcb94b88c09ce82a80e188d49bcffdc83ba215a6'/>
<id>urn:sha1:dcb94b88c09ce82a80e188d49bcffdc83ba215a6</id>
<content type='text'>
IPv6 ping socket error handler doesn't correctly convert the new 32 bit
mtu to host endianness before using.

Cc: Lorenzo Colitti &lt;lorenzo@google.com&gt;
Fixes: 6d0bfe22611602f ("net: ipv6: Add IPv6 support to the ping socket.")
Signed-off-by: Hannes Frederic Sowa &lt;hannes@stressinduktion.org&gt;
Acked-by: Lorenzo Colitti &lt;lorenzo@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
