]> git.baikalelectronics.ru Git - kernel.git/commit
net: fix deadlock while clearing neighbor proxy table
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Thu, 12 Apr 2018 08:46:55 +0000 (10:46 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 13 Apr 2018 02:01:22 +0000 (22:01 -0400)
commitffffef26a552c6e18b9db93afe38125d8db0cd9a
tree1c6912ae100a38fd342e72324cd2d93edc38b161
parent793854bb5d054fddae4564f120d28643bc352e75
net: fix deadlock while clearing neighbor proxy table

When coming from ndisc_netdev_event() in net/ipv6/ndisc.c,
neigh_ifdown() is called with &nd_tbl, locking this while
clearing the proxy neighbor entries when eg. deleting an
interface. Calling the table's pndisc_destructor() with the
lock still held, however, can cause a deadlock: When a
multicast listener is available an IGMP packet of type
ICMPV6_MGM_REDUCTION may be sent out. When reaching
ip6_finish_output2(), if no neighbor entry for the target
address is found, __neigh_create() is called with &nd_tbl,
which it'll want to lock.

Move the elements into their own list, then unlock the table
and perform the destruction.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=199289
Fixes: 879278e7a0a3 ("ipv6: Do not depend on rt->n in ip6_finish_output2().")
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/neighbour.c