netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kaiwen Xu <kaiwen.xu@hulu.com>
To: Cong Wang <xiyou.wangcong@gmail.com>
Cc: David Miller <davem@davemloft.net>,
	Linux Kernel Network Developers <netdev@vger.kernel.org>
Subject: Re: [PATCH net v2] net: Do not hold the reference for the same sk_rx_dst
Date: Sat, 18 Mar 2017 21:03:54 -0700	[thread overview]
Message-ID: <20170319040354.GA59612@kevinmbp.test.hulu.com> (raw)
In-Reply-To: <CAM_iQpXFY+isbSR71GWyf_=-o-LEB6Ftj6P0_5c3zf9echsGnA@mail.gmail.com>

On Sat, Mar 18, 2017 at 08:49:43PM -0700, Cong Wang wrote:
> On Sat, Mar 18, 2017 at 6:48 PM, Kevin Xu <kaiwen.xu@hulu.com> wrote:
> > In some rare cases, inet_sk_rx_dst_set() may be called multiple times
> > on the same dst, causing double refcounting. Eventually, it
> > prevents net_device to be destroyed. The bug manifested as
> >
> > unregister_netdevice: waiting for lo to become free. Usage count = 1
> >
> > in the kernel log, preventing new network namespace creation.
> >
> > Signed-off-by: Kevin Xu <kaiwen.xu@hulu.com>
> 
> Don't know why you don't follow the discussion on your v1...
> 
> It is protected by bh_lock_sock(), so your patch is not needed
> at all.
> 
> Read net/ipv4/udp.c:
> 
> 1762 /* For TCP sockets, sk_rx_dst is protected by socket lock
> 1763  * For UDP, we use xchg() to guard against concurrent changes.
> 1764  */

I probably misunderstood. Do you mean v2 patch is actually not needed or
the whole workaround is not necessary?

  reply	other threads:[~2017-03-19  4:04 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-16  8:08 [PATCH] [PATCH net] net: Do not hold the reference for the same sk_rx_dst Kevin Xu
2017-03-16 10:01 ` Jakub Sitnicki
2017-03-16 10:12   ` Kevin Xu
2017-03-16 10:45     ` Jakub Sitnicki
2017-03-16 18:18       ` Kaiwen Xu
2017-03-16 18:42         ` Cong Wang
2017-03-16 18:16 ` David Miller
2017-03-19  1:48   ` [PATCH net v2] " Kevin Xu
2017-03-19  3:49     ` Cong Wang
2017-03-19  4:03       ` Kaiwen Xu [this message]
2017-03-20  4:09         ` Cong Wang
2017-03-20 21:23           ` Kaiwen Xu
2017-03-16 21:33 ` [PATCH] [PATCH net] " Eric Dumazet
2017-03-16 23:13   ` Cong Wang
2017-03-16 23:29     ` Eric Dumazet

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=20170319040354.GA59612@kevinmbp.test.hulu.com \
    --to=kaiwen.xu@hulu.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=xiyou.wangcong@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).