diff mbox series

[net] dn_route: set rt neigh to blackhole_netdev instead of loopback_dev in ifdown

Message ID 68cf685582fe02e86d5320c9048faeb3d2b5a833.1652665051.git.lucien.xin@gmail.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series [net] dn_route: set rt neigh to blackhole_netdev instead of loopback_dev in ifdown | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net
netdev/fixes_present success Fixes tag present in non-next series
netdev/subject_prefix success Link
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 8 this patch: 8
netdev/cc_maintainers warning 5 maintainers not CCed: pabeni@redhat.com linux-decnet-user@lists.sourceforge.net zhengyongjun3@huawei.com keescook@chromium.org yajun.deng@linux.dev
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 8 this patch: 8
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Xin Long May 16, 2022, 1:37 a.m. UTC
Like other places in ipv4/6 dst ifdown, change to use blackhole_netdev
instead of pernet loopback_dev in dn dst ifdown.

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

Fixes: faab39f63c1f ("net: allow out-of-order netdev unregistration")
Signed-off-by: Xin Long <lucien.xin@gmail.com>
---
 net/decnet/dn_route.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Eric Dumazet May 16, 2022, 2:28 a.m. UTC | #1
On Sun, May 15, 2022 at 6:37 PM Xin Long <lucien.xin@gmail.com> wrote:
>
> Like other places in ipv4/6 dst ifdown, change to use blackhole_netdev
> instead of pernet loopback_dev in dn dst ifdown.
>
> Since commit faab39f63c1f ("net: allow out-of-order netdev
> unregistration"), in .ifdown it's been no longer safe to use loopback_dev
> that may be freed before other netdev.
>
> Fixes: faab39f63c1f ("net: allow out-of-order netdev unregistration")

This patch does not need a Fixes tag I think, because decnet has never supported
other netns than init_net.

This probably can be routed to net-next.

Not a big deal, just trying to avoid extra backports.

Thanks.

> Signed-off-by: Xin Long <lucien.xin@gmail.com>
> ---
>  net/decnet/dn_route.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c
> index 7e85f2a1ae25..99cc52e672b3 100644
> --- a/net/decnet/dn_route.c
> +++ b/net/decnet/dn_route.c
> @@ -159,7 +159,7 @@ static void dn_dst_ifdown(struct dst_entry *dst, struct net_device *dev, int how
>                 struct neighbour *n = rt->n;
>
>                 if (n && n->dev == dev) {
> -                       n->dev = dev_net(dev)->loopback_dev;
> +                       n->dev = blackhole_netdev;
>                         dev_hold(n->dev);
>                         dev_put(dev);
>                 }
> --
> 2.31.1
>
diff mbox series

Patch

diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c
index 7e85f2a1ae25..99cc52e672b3 100644
--- a/net/decnet/dn_route.c
+++ b/net/decnet/dn_route.c
@@ -159,7 +159,7 @@  static void dn_dst_ifdown(struct dst_entry *dst, struct net_device *dev, int how
 		struct neighbour *n = rt->n;
 
 		if (n && n->dev == dev) {
-			n->dev = dev_net(dev)->loopback_dev;
+			n->dev = blackhole_netdev;
 			dev_hold(n->dev);
 			dev_put(dev);
 		}