linux-stable/tools
David Ahern 0239c439ce ipv4: Fix device used for dst_alloc with local routes
[ Upstream commit b87b04f501 ]

Oliver reported a use case where deleting a VRF device can hang
waiting for the refcnt to drop to 0. The root cause is that the dst
is allocated against the VRF device but cached on the loopback
device.

The use case (added to the selftests) has an implicit VRF crossing
due to the ordering of the FIB rules (lookup local is before the
l3mdev rule, but the problem occurs even if the FIB rules are
re-ordered with local after l3mdev because the VRF table does not
have a default route to terminate the lookup). The end result is
is that the FIB lookup returns the loopback device as the nexthop,
but the ingress device is in a VRF. The mismatch causes the dst
alloc against the VRF device but then cached on the loopback.

The fix is to bring the trick used for IPv6 (see ip6_rt_get_dev_rcu):
pick the dst alloc device based the fib lookup result but with checks
that the result has a nexthop device (e.g., not an unreachable or
prohibit entry).

Fixes: f5a0aab84b ("net: ipv4: dst for local input routes should use l3mdev if relevant")
Reported-by: Oliver Herms <oliver.peter.herms@gmail.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-06-23 14:42:45 +02:00
..
accounting
arch ia64: tools: remove duplicate definition of ia64_mf() on ia64 2021-04-28 13:40:02 +02:00
bootconfig tools/bootconfig: Fix error return code in apply_xbc() 2021-06-16 12:01:45 +02:00
bpf bpftool: Add sock_release help info for cgroup attach/prog load command 2021-06-03 09:00:51 +02:00
build tools: Factor HOSTCC, HOSTLD, HOSTAR definitions 2021-01-30 13:55:19 +01:00
cgroup tools/cgroup/slabinfo.py: updated to work on current kernel 2021-05-07 11:04:31 +02:00
debugging
edid
firewire
firmware
gpio tools: gpio: fix %llu warning in gpio-watch.c 2021-01-27 11:55:20 +01:00
hv
iio iio: add IIO_MOD_O2 modifier 2020-08-22 10:53:12 +01:00
include linux/bits.h: fix compilation error with GENMASK 2021-06-03 09:00:45 +02:00
io_uring tools/io_uring: fix compile breakage 2020-09-21 07:50:58 -06:00
kvm/kvm_stat tools/kvm_stat: Add restart delay 2021-04-16 11:43:20 +02:00
laptop
leds
lib libbpf: Fixes incorrect rx_ring_setup_done 2021-06-23 14:42:41 +02:00
memory-model tools/memory-model: Expand the cheatsheet.txt notion of relaxed 2020-09-04 11:58:15 -07:00
objtool static_call: Allow module use without exposing static_call_key 2021-03-30 14:31:53 +02:00
pci
pcmcia
perf perf session: Correct buffer copying when peeking events 2021-06-16 12:01:46 +02:00
power tweewide: Fix most Shebang lines 2021-05-22 11:40:55 +02:00
scripts tools: Factor HOSTCC, HOSTLD, HOSTAR definitions 2021-01-30 13:55:19 +01:00
spi
testing ipv4: Fix device used for dst_alloc with local routes 2021-06-23 14:42:45 +02:00
thermal/tmon
time
usb tools: usb: move to tools buildsystem 2020-08-19 14:11:44 +02:00
virtio
vm mm: Add PG_arch_2 page flag 2020-09-04 12:46:06 +01:00
wmi
Makefile