[RH7] Revert "MS/NET/IPV6: remove duplicate neigh_ifdown"

Submitted by Vasily Averin on Dec. 23, 2020, 1:39 p.m.


Message ID 727a52ca-3220-ae6d-6596-34a27b6fb20f@virtuozzo.com
State New
Series "Revert "MS/NET/IPV6: remove duplicate neigh_ifdown""
Headers show

Commit Message

Vasily Averin Dec. 23, 2020, 1:39 p.m.
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:

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()

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)
 	rt6_ifdown(net, dev);
+	neigh_ifdown(&nd_tbl, dev);
 	idev = __in6_dev_get(dev);
 	if (idev == NULL)