public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Vladimir Davydov <VDavydov@parallels.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: Possible deadlock in ipv6?
Date: Wed, 06 Jun 2012 19:02:28 +0200	[thread overview]
Message-ID: <1339002148.26966.14.camel@edumazet-glaptop> (raw)
In-Reply-To: <D0983DA9-2545-4007-8A69-31DDCB9B7CCF@parallels.com>

On Wed, 2012-06-06 at 20:01 +0400, Vladimir Davydov wrote:
> On Jun 6, 2012, at 7:58 PM, Eric Dumazet wrote:
> 
> > On Wed, 2012-06-06 at 17:53 +0200, Eric Dumazet wrote:
> >> 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 !
> >> 
> >> 
> > 
> > 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 ;)

  reply	other threads:[~2012-06-06 17:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-06 14:49 Possible deadlock in ipv6? Vladimir Davydov
2012-06-06 15:53 ` Eric Dumazet
2012-06-06 15:58   ` Eric Dumazet
2012-06-06 16:01     ` Vladimir Davydov
2012-06-06 17:02       ` Eric Dumazet [this message]
2012-06-12  6:54     ` David Miller
2012-06-12  9:09       ` Eric Dumazet
2012-06-21  4:05         ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1339002148.26966.14.camel@edumazet-glaptop \
    --to=eric.dumazet@gmail.com \
    --cc=VDavydov@parallels.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox