Files
linux/net/ipv4
Paolo Abeni 2835b34e27 net: ipv4: avoid mixed n_redirects and rate_tokens usage
[ Upstream commit b406472b5a ]

Since commit c09551c6ff ("net: ipv4: use a dedicated counter
for icmp_v4 redirect packets") we use 'n_redirects' to account
for redirect packets, but we still use 'rate_tokens' to compute
the redirect packets exponential backoff.

If the device sent to the relevant peer any ICMP error packet
after sending a redirect, it will also update 'rate_token' according
to the leaking bucket schema; typically 'rate_token' will raise
above BITS_PER_LONG and the redirect packets backoff algorithm
will produce undefined behavior.

Fix the issue using 'n_redirects' to compute the exponential backoff
in ip_rt_send_redirect().

Note that we still clear rate_tokens after a redirect silence period,
to avoid changing an established behaviour.

The root cause predates git history; before the mentioned commit in
the critical scenario, the kernel stopped sending redirects, after
the mentioned commit the behavior more randomic.

Reported-by: Xiumei Mu <xmu@redhat.com>
Fixes: 1da177e4c3 ("Linux-2.6.12-rc2")
Fixes: c09551c6ff ("net: ipv4: use a dedicated counter for icmp_v4 redirect packets")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Acked-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-05-15 14:41:26 +09:00
..
2018-04-13 19:48:32 +02:00
2023-05-15 11:50:01 +09:00
2018-05-19 14:06:17 +02:00
2023-05-15 12:22:35 +09:00
2023-05-15 13:46:55 +09:00
2017-05-14 14:00:21 +02:00
2016-09-01 14:09:01 -07:00
2015-09-17 17:18:37 -07:00
2013-05-31 17:19:05 -07:00