]> www.infradead.org Git - users/hch/xfs.git/commit
xfrm: set dst dev to blackhole_netdev instead of loopback_dev in ifdown
authorXin Long <lucien.xin@gmail.com>
Mon, 16 May 2022 01:37:27 +0000 (21:37 -0400)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 17 May 2022 09:02:07 +0000 (11:02 +0200)
commit4d33ab08c0af140752a46f227a6bf97dab1e17b4
tree5a9e298e8b71a4e510a4c48d99fb86b84df37dc5
parentef6b1cd11962aec21c58d137006ab122dbc8d6fd
xfrm: set dst dev to blackhole_netdev instead of loopback_dev in ifdown

The global blackhole_netdev has replaced pernet loopback_dev to become the
one given to the object that holds an netdev when ifdown in many places of
ipv4 and ipv6 since commit 8d7017fd621d ("blackhole_netdev: use
blackhole_netdev to invalidate dst entries").

Especially after commit faab39f63c1f ("net: allow out-of-order netdev
unregistration"), it's no longer safe to use loopback_dev that may be
freed before other netdev.

This patch is to set dst dev to blackhole_netdev instead of loopback_dev
in ifdown.

v1->v2:
  - add Fixes tag as Eric suggested.

Fixes: faab39f63c1f ("net: allow out-of-order netdev unregistration")
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://lore.kernel.org/r/e8c87482998ca6fcdab214f5a9d582899ec0c648.1652665047.git.lucien.xin@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
net/xfrm/xfrm_policy.c