[RHEL7,COMMIT] Revert "MS/NET/IPV6: remove duplicate neigh_ifdown"

Submitted by Vasily Averin on Dec. 24, 2020, 6:41 p.m.

Details

Message ID 202012241841.0BOIftgD024176@vz7build.vvs.sw.ru
State New
Series "Revert "MS/NET/IPV6: remove duplicate neigh_ifdown""
Headers show

Commit Message

Vasily Averin Dec. 24, 2020, 6:41 p.m.
The commit is pushed to "branch-rh7-3.10.0-1160.11.1.vz7.172.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-1160.11.1.vz7.172.4
------>
commit 53e2c19c4e13cdc23ea2fdd8b05783bd81f77b26
Author: Vasily Averin <vvs@virtuozzo.com>
Date:   Thu Dec 24 21:41:55 2020 +0300

    Revert "MS/NET/IPV6: remove duplicate neigh_ifdown"
    
    This reverts commit 1727514587a11ec6c1a6704d86d9a0f3ec2d4bf1.
    "MS/NET/IPV6: remove duplicate neigh_ifdown"
    
    This patch should fix race described in PSBM-13449
    "
    addrconf_ifdown() calls neigh_ifdown(nd_tbl)
    neigh_ifdown() locks nd_tbl->lock for writing and calls pneigh_ifdown()
    Then we have the following call chain:
    pneigh_ifdown->pndisc_destructor->ipv6_dev_mc_dec->__ipv6_dev_mc_dec
     ->igmp6_group_dropped->igmp6_leave_group->igmp6_send
       ->icmp6_dst_alloc->ndisc_get_neigh
    
    ndisc_get_neigh() then calls __neigh_lookup_errno(nd_tbl) which calls neigh_lookup(nd_tbl)
    neigh_lookup() locks nd_tbl->lock for reading yielding a deadlock."
    
    Though it is not actual for vz7:
    icmp6_dst_alloc() does not calls ndisc_get_neigh()
    
    https://jira.sw.ru/browse/PSBM-124032
    Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
---
 net/ipv6/addrconf.c | 1 +
 1 file changed, 1 insertion(+)

Patch hide | download patch | download mbox

diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index bc9babf..47789a2 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -3413,6 +3413,7 @@  static int addrconf_ifdown(struct net_device *dev, int how)
 	ASSERT_RTNL();
 
 	rt6_ifdown(net, dev);
+	neigh_ifdown(&nd_tbl, dev);
 
 	idev = __in6_dev_get(dev);
 	if (idev == NULL)