]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
neighbour: remove neigh_cleanup() method
authorEric Dumazet <edumazet@google.com>
Sat, 7 Dec 2019 20:23:21 +0000 (12:23 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 31 Dec 2019 15:41:37 +0000 (16:41 +0100)
[ Upstream commit f394722fb0d0f701119368959d7cd0ecbc46363a ]

neigh_cleanup() has not been used for seven years, and was a wrong design.

Messing with shared pointer in bond_neigh_init() without proper
memory barriers would at least trigger syzbot complains eventually.

It is time to remove this stuff.

Fixes: b63b70d87741 ("IPoIB: Use a private hash table for path lookup in xmit path")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/bonding/bond_main.c
include/net/neighbour.h
net/core/neighbour.c

index 62f65573eb04b190b825694fe772b9bf21836ba8..3a63a4e4f62bc94a51f33cf2ade0e3272319342a 100644 (file)
@@ -3622,18 +3622,10 @@ static int bond_neigh_init(struct neighbour *n)
                return 0;
 
        parms.neigh_setup = NULL;
-       parms.neigh_cleanup = NULL;
        ret = slave_ops->ndo_neigh_setup(slave->dev, &parms);
        if (ret)
                return ret;
 
-       /* Assign slave's neigh_cleanup to neighbour in case cleanup is called
-        * after the last slave has been detached.  Assumes that all slaves
-        * utilize the same neigh_cleanup (true at this writing as only user
-        * is ipoib).
-        */
-       n->parms->neigh_cleanup = parms.neigh_cleanup;
-
        if (!parms.neigh_setup)
                return 0;
 
index b8452cc0e059f5db44c0084b899c35b56833c5cf..5e679c8dae0b2192a8261f44b81a84b2a36a2f3d 100644 (file)
@@ -72,7 +72,6 @@ struct neigh_parms {
        struct net_device *dev;
        struct list_head list;
        int     (*neigh_setup)(struct neighbour *);
-       void    (*neigh_cleanup)(struct neighbour *);
        struct neigh_table *tbl;
 
        void    *sysctl_table;
index 5480edff0c8687a0b3a0e2dca90a83dc7ca52fe8..08ebc3ac53436c0c0969f72367c5ec2e6de480f8 100644 (file)
@@ -98,9 +98,6 @@ static int neigh_blackhole(struct neighbour *neigh, struct sk_buff *skb)
 
 static void neigh_cleanup_and_release(struct neighbour *neigh)
 {
-       if (neigh->parms->neigh_cleanup)
-               neigh->parms->neigh_cleanup(neigh);
-
        trace_neigh_cleanup_and_release(neigh, 0);
        __neigh_notify(neigh, RTM_DELNEIGH, 0, 0);
        call_netevent_notifiers(NETEVENT_NEIGH_UPDATE, neigh);