<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/net/ipv4/route.c, branch linux-4.20.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.20.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.20.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2019-03-19T12:11:53Z</updated>
<entry>
<title>route: set the deleted fnhe fnhe_daddr to 0 in ip_del_fnhe to fix a race</title>
<updated>2019-03-19T12:11:53Z</updated>
<author>
<name>Xin Long</name>
</author>
<published>2019-03-08T06:50:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=baee859a50075257a058188196982e13ac501098'/>
<id>urn:sha1:baee859a50075257a058188196982e13ac501098</id>
<content type='text'>
[ Upstream commit ee60ad219f5c7c4fb2f047f88037770063ef785f ]

The race occurs in __mkroute_output() when 2 threads lookup a dst:

  CPU A                 CPU B
  find_exception()
                        find_exception() [fnhe expires]
                        ip_del_fnhe() [fnhe is deleted]
  rt_bind_exception()

In rt_bind_exception() it will bind a deleted fnhe with the new dst, and
this dst will get no chance to be freed. It causes a dev defcnt leak and
consecutive dmesg warnings:

  unregister_netdevice: waiting for ethX to become free. Usage count = 1

Especially thanks Jon to identify the issue.

This patch fixes it by setting fnhe_daddr to 0 in ip_del_fnhe() to stop
binding the deleted fnhe with a new dst when checking fnhe's fnhe_daddr
and daddr in rt_bind_exception().

It works as both ip_del_fnhe() and rt_bind_exception() are protected by
fnhe_lock and the fhne is freed by kfree_rcu().

Fixes: deed49df7390 ("route: check and remove route cache when we get route")
Signed-off-by: Jon Maxwell &lt;jmaxwell37@gmail.com&gt;
Signed-off-by: Xin Long &lt;lucien.xin@gmail.com&gt;
Reviewed-by: David Ahern &lt;dsahern@gmail.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>
</entry>
<entry>
<title>ipv4/route: fail early when inet dev is missing</title>
<updated>2019-03-19T12:11:52Z</updated>
<author>
<name>Paolo Abeni</name>
</author>
<published>2019-03-06T09:42:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=bec82cf2b9dc1a49d717ce91687d9d3ea01ecdf8'/>
<id>urn:sha1:bec82cf2b9dc1a49d717ce91687d9d3ea01ecdf8</id>
<content type='text'>
[ Upstream commit 22c74764aa2943ecdf9f07c900d8a9c8ba6c9265 ]

If a non local multicast packet reaches ip_route_input_rcu() while
the ingress device IPv4 private data (in_dev) is NULL, we end up
doing a NULL pointer dereference in IN_DEV_MFORWARD().

Since the later call to ip_route_input_mc() is going to fail if
!in_dev, we can fail early in such scenario and avoid the dangerous
code path.

v1 -&gt; v2:
 - clarified the commit message, no code changes

Reported-by: Tianhao Zhao &lt;tizhao@redhat.com&gt;
Fixes: e58e41596811 ("net: Enable support for VRF with ipv4 multicast")
Signed-off-by: Paolo Abeni &lt;pabeni@redhat.com&gt;
Reviewed-by: David Ahern &lt;dsahern@gmail.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>
</entry>
<entry>
<title>ipv4: Add ICMPv6 support when parse route ipproto</title>
<updated>2019-03-10T06:10:12Z</updated>
<author>
<name>Hangbin Liu</name>
</author>
<published>2019-02-27T08:15:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b17fa7944c7c50e195dc556b2e02448c372ac261'/>
<id>urn:sha1:b17fa7944c7c50e195dc556b2e02448c372ac261</id>
<content type='text'>
[ Upstream commit 5e1a99eae84999a2536f50a0beaf5d5262337f40 ]

For ip rules, we need to use 'ipproto ipv6-icmp' to match ICMPv6 headers.
But for ip -6 route, currently we only support tcp, udp and icmp.

Add ICMPv6 support so we can match ipv6-icmp rules for route lookup.

v2: As David Ahern and Sabrina Dubroca suggested, Add an argument to
rtm_getroute_parse_ip_proto() to handle ICMP/ICMPv6 with different family.

Reported-by: Jianlin Shi &lt;jishi@redhat.com&gt;
Fixes: eacb9384a3fe ("ipv6: support sport, dport and ip_proto in RTM_GETROUTE")
Signed-off-by: Hangbin Liu &lt;liuhangbin@gmail.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>
</entry>
<entry>
<title>net: ipv4: use a dedicated counter for icmp_v4 redirect packets</title>
<updated>2019-02-23T08:08:05Z</updated>
<author>
<name>Lorenzo Bianconi</name>
</author>
<published>2019-02-06T18:18:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5d5c002b1b24c3d037abb19f008ca343f176f219'/>
<id>urn:sha1:5d5c002b1b24c3d037abb19f008ca343f176f219</id>
<content type='text'>
[ Upstream commit c09551c6ff7fe16a79a42133bcecba5fc2fc3291 ]

According to the algorithm described in the comment block at the
beginning of ip_rt_send_redirect, the host should try to send
'ip_rt_redirect_number' ICMP redirect packets with an exponential
backoff and then stop sending them at all assuming that the destination
ignores redirects.
If the device has previously sent some ICMP error packets that are
rate-limited (e.g TTL expired) and continues to receive traffic,
the redirect packets will never be transmitted. This happens since
peer-&gt;rate_tokens will be typically greater than 'ip_rt_redirect_number'
and so it will never be reset even if the redirect silence timeout
(ip_rt_redirect_silence) has elapsed without receiving any packet
requiring redirects.

Fix it by using a dedicated counter for the number of ICMP redirect
packets that has been sent by the host

I have not been able to identify a given commit that introduced the
issue since ip_rt_send_redirect implements the same rate-limiting
algorithm from commit 1da177e4c3f4 ("Linux-2.6.12-rc2")

Signed-off-by: Lorenzo Bianconi &lt;lorenzo.bianconi@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net</title>
<updated>2018-10-13T04:38:46Z</updated>
<author>
<name>David S. Miller</name>
</author>
<published>2018-10-13T04:38:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d864991b220b7c62e81d21209e1fd978fd67352c'/>
<id>urn:sha1:d864991b220b7c62e81d21209e1fd978fd67352c</id>
<content type='text'>
Conflicts were easy to resolve using immediate context mostly,
except the cls_u32.c one where I simply too the entire HEAD
chunk.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: ipv4: don't let PMTU updates increase route MTU</title>
<updated>2018-10-11T05:44:46Z</updated>
<author>
<name>Sabrina Dubroca</name>
</author>
<published>2018-10-09T15:48:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=28d35bcdd3925e7293408cdb8aa5f2aac5f0d6e3'/>
<id>urn:sha1:28d35bcdd3925e7293408cdb8aa5f2aac5f0d6e3</id>
<content type='text'>
When an MTU update with PMTU smaller than net.ipv4.route.min_pmtu is
received, we must clamp its value. However, we can receive a PMTU
exception with PMTU &lt; old_mtu &lt; ip_rt_min_pmtu, which would lead to an
increase in PMTU.

To fix this, take the smallest of the old MTU and ip_rt_min_pmtu.

Before this patch, in case of an update, the exception's MTU would
always change. Now, an exception can have only its lock flag updated,
but not the MTU, so we need to add a check on locking to the following
"is this exception getting updated, or close to expiring?" test.

Fixes: d52e5a7e7ca4 ("ipv4: lock mtu in fnhe when received PMTU &lt; net.ipv4.route.min_pmtu")
Signed-off-by: Sabrina Dubroca &lt;sd@queasysnail.net&gt;
Reviewed-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: Move free of dst_metrics to helper</title>
<updated>2018-10-05T04:54:25Z</updated>
<author>
<name>David Ahern</name>
</author>
<published>2018-10-05T03:07:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1620a33695d81611360d813a47ebde9386714036'/>
<id>urn:sha1:1620a33695d81611360d813a47ebde9386714036</id>
<content type='text'>
Move the refcounting and potential free of dst metrics associated
for ipv4 and ipv6 to a common helper.

Signed-off-by: David Ahern &lt;dsahern@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: common metrics init helper for dst_entry</title>
<updated>2018-10-05T04:54:19Z</updated>
<author>
<name>David Ahern</name>
</author>
<published>2018-10-05T03:07:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e1255ed4b6dafd9966c99cde5105891cc1ac70df'/>
<id>urn:sha1:e1255ed4b6dafd9966c99cde5105891cc1ac70df</id>
<content type='text'>
ipv4 and ipv6 both use refcounted metrics if FIB entries have metrics set.
Move the common initialization code to a helper and use for both protocols.

Signed-off-by: David Ahern &lt;dsahern@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: inet_rtm_getroute() - use new style struct initializer instead of memset</title>
<updated>2018-10-02T23:12:39Z</updated>
<author>
<name>Maciej Żenczykowski</name>
</author>
<published>2018-09-30T06:44:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e8e3fbe92c49d1e031eca72542956606c43122ba'/>
<id>urn:sha1:e8e3fbe92c49d1e031eca72542956606c43122ba</id>
<content type='text'>
Signed-off-by: Maciej Żenczykowski &lt;maze@google.com&gt;
Reviewed-by: David Ahern &lt;dsahern@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: ip_rt_get_source() - use new style struct initializer instead of memset</title>
<updated>2018-10-02T23:12:39Z</updated>
<author>
<name>Maciej Żenczykowski</name>
</author>
<published>2018-09-30T06:44:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e351bb6227fbe2bb5da6f38a4cf5bd18810b0557'/>
<id>urn:sha1:e351bb6227fbe2bb5da6f38a4cf5bd18810b0557</id>
<content type='text'>
(allows for better compiler optimization)

Signed-off-by: Maciej Żenczykowski &lt;maze@google.com&gt;
Reviewed-by: David Ahern &lt;dsahern@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
