]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ipvs: do not keep dest_dst if dev is going down
authorJulian Anastasov <ja@ssi.bg>
Sat, 14 Feb 2026 14:58:50 +0000 (16:58 +0200)
committerFlorian Westphal <fw@strlen.de>
Tue, 17 Feb 2026 14:04:20 +0000 (15:04 +0100)
commit8fde939b0206afc1d5846217a01a16b9bc8c7896
tree0ed9d2b8e61142858b3bd084b7c8fb022b2eef4c
parent05cfe9863ef049d98141dc2969eefde72fb07625
ipvs: do not keep dest_dst if dev is going down

There is race between the netdev notifier ip_vs_dst_event()
and the code that caches dst with dev that is going down.
As the FIB can be notified for the closed device after our
handler finishes, it is possible valid route to be returned
and cached resuling in a leaked dev reference until the dest
is not removed.

To prevent new dest_dst to be attached to dest just after the
handler dropped the old one, add a netif_running() check
to make sure the notifier handler is not currently running
for device that is closing.

Fixes: 7a4f0761fce3 ("IPVS: init and cleanup restructuring")
Signed-off-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Florian Westphal <fw@strlen.de>
net/netfilter/ipvs/ip_vs_xmit.c