From: Vladimir Davydov <hidden> Date: 2012-06-06 14:49:26
I'm not familiar with the linux net subsystem, so I would appreciate if
someone could clarify if the following call chain is possible:
addrconf_ifdown() calls neigh_ifdown(nd_tbl) which locks nd_tbl.lock for
writing and calls
pneigh_ifdown
pndisc_destructor
ipv6_dev_mc_dec
__ipv6_dev_mc_dec
igmp6_group_dropped
igmp6_leave_group
igmp6_send
icmp6_dst_alloc
ip6_neigh_lookup
neigh_create
and neigh_create() locks nd_tbl.lock for writing again resulting in a
deadlock.
Thank you.
From: Eric Dumazet <hidden> Date: 2012-06-06 15:53:47
On Wed, 2012-06-06 at 18:49 +0400, Vladimir Davydov wrote:
I'm not familiar with the linux net subsystem, so I would appreciate if
someone could clarify if the following call chain is possible:
addrconf_ifdown() calls neigh_ifdown(nd_tbl) which locks nd_tbl.lock for
writing and calls
pneigh_ifdown
pndisc_destructor
ipv6_dev_mc_dec
__ipv6_dev_mc_dec
igmp6_group_dropped
igmp6_leave_group
igmp6_send
icmp6_dst_alloc
ip6_neigh_lookup
neigh_create
and neigh_create() locks nd_tbl.lock for writing again resulting in a
deadlock.
It seems a deadlock is possible indeed, good catch !
From: Eric Dumazet <hidden> Date: 2012-06-06 15:58:40
On Wed, 2012-06-06 at 17:53 +0200, Eric Dumazet wrote:
On Wed, 2012-06-06 at 18:49 +0400, Vladimir Davydov wrote:
quoted
I'm not familiar with the linux net subsystem, so I would appreciate if
someone could clarify if the following call chain is possible:
addrconf_ifdown() calls neigh_ifdown(nd_tbl) which locks nd_tbl.lock for
writing and calls
pneigh_ifdown
pndisc_destructor
ipv6_dev_mc_dec
__ipv6_dev_mc_dec
igmp6_group_dropped
igmp6_leave_group
igmp6_send
icmp6_dst_alloc
ip6_neigh_lookup
neigh_create
and neigh_create() locks nd_tbl.lock for writing again resulting in a
deadlock.
It seems a deadlock is possible indeed, good catch !
And it seems this neigh_down() can be removed, its called later
(after dev->ip6_ptr is cleared)
From: Vladimir Davydov <hidden> Date: 2012-06-06 16:01:43
On Jun 6, 2012, at 7:58 PM, Eric Dumazet wrote:
On Wed, 2012-06-06 at 17:53 +0200, Eric Dumazet wrote:
quoted
On Wed, 2012-06-06 at 18:49 +0400, Vladimir Davydov wrote:
quoted
I'm not familiar with the linux net subsystem, so I would appreciate if
someone could clarify if the following call chain is possible:
addrconf_ifdown() calls neigh_ifdown(nd_tbl) which locks nd_tbl.lock for
writing and calls
pneigh_ifdown
pndisc_destructor
ipv6_dev_mc_dec
__ipv6_dev_mc_dec
igmp6_group_dropped
igmp6_leave_group
igmp6_send
icmp6_dst_alloc
ip6_neigh_lookup
neigh_create
and neigh_create() locks nd_tbl.lock for writing again resulting in a
deadlock.
It seems a deadlock is possible indeed, good catch !
And it seems this neigh_down() can be removed, its called later
(after dev->ip6_ptr is cleared)
BTW, commit d1ed113f1669390da9898da3beddcc058d938587 did exactly the same, but it was reverted along with a bundle of other commits by 73a8bd74e2618990dbb218c3d82f53e60acd9af0.
From: Eric Dumazet <hidden> Date: 2012-06-06 17:02:32
On Wed, 2012-06-06 at 20:01 +0400, Vladimir Davydov wrote:
On Jun 6, 2012, at 7:58 PM, Eric Dumazet wrote:
quoted
On Wed, 2012-06-06 at 17:53 +0200, Eric Dumazet wrote:
quoted
On Wed, 2012-06-06 at 18:49 +0400, Vladimir Davydov wrote:
quoted
I'm not familiar with the linux net subsystem, so I would appreciate if
someone could clarify if the following call chain is possible:
addrconf_ifdown() calls neigh_ifdown(nd_tbl) which locks nd_tbl.lock for
writing and calls
pneigh_ifdown
pndisc_destructor
ipv6_dev_mc_dec
__ipv6_dev_mc_dec
igmp6_group_dropped
igmp6_leave_group
igmp6_send
icmp6_dst_alloc
ip6_neigh_lookup
neigh_create
and neigh_create() locks nd_tbl.lock for writing again resulting in a
deadlock.
It seems a deadlock is possible indeed, good catch !
And it seems this neigh_down() can be removed, its called later
(after dev->ip6_ptr is cleared)
BTW, commit d1ed113f1669390da9898da3beddcc058d938587 did exactly the same, but it was reverted along with a bundle of other commits by 73a8bd74e2618990dbb218c3d82f53e60acd9af0.
Yes, but the revert was a 'revert a serie', while this particular patch
seems fine, especially if fixing a deadlock ;)