All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Wei Wang <weiwan@google.com>
Cc: "Paweł Staszewski" <pstaszewski@itcare.pl>,
	"Cong Wang" <xiyou.wangcong@gmail.com>,
	"Linux Kernel Network Developers" <netdev@vger.kernel.org>,
	"Eric Dumazet" <edumazet@google.com>
Subject: Re: Latest net-next from GIT panic
Date: Wed, 20 Sep 2017 18:17:19 -0700	[thread overview]
Message-ID: <1505956639.29839.108.camel@edumazet-glaptop3.roam.corp.google.com> (raw)
In-Reply-To: <CAEA6p_AiLvZxsyu+iOCrPzW-H28N=HBnWycy8w6gdZHFk2Q1dQ@mail.gmail.com>

On Wed, 2017-09-20 at 18:09 -0700, Wei Wang wrote:
> > Thanks very much Pawel for the feedback.
> >
> > I was looking into the code (specifically IPv4 part) and found that in
> > free_fib_info_rcu(), we call free_nh_exceptions() without holding the
> > fnhe_lock. I am wondering if that could cause some race condition on
> > fnhe->fnhe_rth_input/output so a double call on dst_dev_put() on the
> > same dst could be happening.
> >
> > But as we call free_fib_info_rcu() only after the grace period, and
> > the lookup code which could potentially modify
> > fnhe->fnhe_rth_input/output all holds rcu_read_lock(), it seems
> > fine...
> >
> 
> Hi Pawel,
> 
> Could you try the following debug patch on top of net-next branch and
> reproduce the issue check if there are warning msg showing?
> 
> diff --git a/include/net/dst.h b/include/net/dst.h
> index 93568bd0a352..82aff41c6f63 100644
> --- a/include/net/dst.h
> +++ b/include/net/dst.h
> @@ -271,7 +271,7 @@ static inline void dst_use_noref(struct dst_entry
> *dst, unsigned long time)
>  static inline struct dst_entry *dst_clone(struct dst_entry *dst)
>  {
>         if (dst)
> -               atomic_inc(&dst->__refcnt);
> +               dst_hold(dst);
>         return dst;
>  }
> 
> Thanks.
> Wei
> 


Yes, we believe skb_dst_force() and skb_dst_force_safe() should be
unified  (to the 'safe' version)

We no longer have gc to protect from 0 -> 1 transition of dst refcount.

  reply	other threads:[~2017-09-21  1:17 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4745525f-18e4-7f69-fe21-8e507e407b33@itcare.pl>
2017-09-19 22:35 ` Latest net-next from GIT panic Paweł Staszewski
2017-09-19 23:45   ` Paweł Staszewski
2017-09-20  0:01     ` Paweł Staszewski
2017-09-20  0:06       ` Paweł Staszewski
2017-09-20  0:26         ` Paweł Staszewski
2017-09-20  3:24         ` Eric Dumazet
2017-09-20  7:58           ` Paweł Staszewski
2017-09-20  8:44             ` Paweł Staszewski
2017-09-20  9:45               ` Paweł Staszewski
2017-09-20 10:21                 ` Paweł Staszewski
2017-09-20 10:22                   ` Paweł Staszewski
2017-09-20 11:02                     ` Paweł Staszewski
2017-09-20 12:23                       ` Paweł Staszewski
2017-09-20 12:49                         ` Paweł Staszewski
2017-09-20 13:05                           ` Paweł Staszewski
2017-09-20 13:09                             ` Paweł Staszewski
2017-09-20 13:11                           ` Eric Dumazet
2017-09-20 13:16                             ` Paweł Staszewski
2017-09-20 13:34                               ` Eric Dumazet
2017-09-20 13:37                                 ` Eric Dumazet
2017-09-20 13:39                                 ` Paweł Staszewski
2017-09-20 13:44                                   ` Eric Dumazet
2017-09-20 14:03                                     ` Paweł Staszewski
2017-09-20 14:40                                       ` Eric Dumazet
2017-09-20 15:05                                         ` Paweł Staszewski
2017-09-20 17:46                                           ` Wei Wang
2017-09-20 17:58                                             ` Paweł Staszewski
2017-09-20 17:50                             ` Cong Wang
2017-09-20 17:59                               ` Eric Dumazet
     [not found]                               ` <3c227be7-a954-a406-1987-24e908cf214c@itcare.pl>
2017-09-20 18:22                                 ` Cong Wang
2017-09-20 18:30                                   ` Eric Dumazet
2017-09-20 18:36                                     ` Cong Wang
2017-09-20 19:13                                       ` Paweł Staszewski
2017-09-20 19:23                                         ` Paweł Staszewski
2017-09-20 21:10                                           ` Paweł Staszewski
2017-09-20 21:24                                             ` Paweł Staszewski
2017-09-20 21:25                                               ` Paweł Staszewski
2017-09-20 21:27                                                 ` Paweł Staszewski
2017-09-20 22:09                                                 ` Wei Wang
2017-09-21  1:09                                                   ` Wei Wang
2017-09-21  1:17                                                     ` Eric Dumazet [this message]
2017-09-21  9:06                                                       ` Paweł Staszewski
2017-09-21 11:03                                                         ` Eric Dumazet
2017-09-21 11:12                                                           ` Paweł Staszewski
2017-09-21 11:14                                                             ` Paweł Staszewski
2017-09-21 11:31                                                           ` Paweł Staszewski
2017-09-21 13:18                                                             ` Paweł Staszewski
2017-09-21 14:56                                                               ` Eric Dumazet
2017-09-21 16:15                                                                 ` [PATCH net] net: prevent dst uses after free Eric Dumazet
2017-09-21 16:49                                                                   ` Wei Wang
2017-09-21 17:12                                                                   ` Martin KaFai Lau
2017-09-22  3:42                                                                   ` 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=1505956639.29839.108.camel@edumazet-glaptop3.roam.corp.google.com \
    --to=eric.dumazet@gmail.com \
    --cc=edumazet@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=pstaszewski@itcare.pl \
    --cc=weiwan@google.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.