Netdev List
 help / color / mirror / Atom feed
From: "Mika Penttilä" <mika.penttila@nextfour.com>
To: David Ahern <dsa@cumulusnetworks.com>, Xin Long <lucien.xin@gmail.com>
Cc: network dev <netdev@vger.kernel.org>, davem <davem@davemloft.net>
Subject: Re: [PATCH net] ipv6: fix a dst leak when removing its exception
Date: Thu, 15 Nov 2018 19:13:14 +0000	[thread overview]
Message-ID: <d68eb639-889c-4c1a-3659-e396ed6126ec@nextfour.com> (raw)
In-Reply-To: <b7fbce37-5de0-0770-f7a0-1c3ed680431e@cumulusnetworks.com>


On 15.11.2018 20.17, David Ahern wrote:
> On 11/14/18 11:23 PM, Xin Long wrote:
>> On Thu, Nov 15, 2018 at 3:33 PM David Ahern <dsa@cumulusnetworks.com> wrote:
>>> On 11/14/18 11:03 AM, David Ahern wrote:
>>>> On 11/13/18 8:48 AM, Xin Long wrote:
>>>>> These is no need to hold dst before calling rt6_remove_exception_rt().
>>>>> The call to dst_hold_safe() in ip6_link_failure() was for ip6_del_rt(),
>>>>> which has been removed in Commit 93531c674315 ("net/ipv6: separate
>>>>> handling of FIB entries from dst based routes"). Otherwise, it will
>>>>> cause a dst leak.
>>>>>
>>>>> This patch is to simply remove the dst_hold_safe() call before calling
>>>>> rt6_remove_exception_rt() and also do the same in ip6_del_cached_rt().
>>>>> It's safe, because the removal of the exception that holds its dst's
>>>>> refcnt is protected by rt6_exception_lock.
>>>>>
>>>>> Fixes: 93531c674315 ("net/ipv6: separate handling of FIB entries from dst based routes")
>>>>> Fixes: 23fb93a4d3f1 ("net/ipv6: Cleanup exception and cache route handling")
>>>>> Reported-by: Li Shuang <shuali@redhat.com>
>>>>> Signed-off-by: Xin Long <lucien.xin@gmail.com>
>>>>> ---
>>>>>  net/ipv6/route.c | 7 +++----
>>>>>  1 file changed, 3 insertions(+), 4 deletions(-)
>>>> was this problem actually hit or is this patch based on a code analysis?
>>>>
>>> I ask because I have not been able to reproduce the leak using existing
>>> tests (e.g., pmtu) that I know create exceptions.
>>>
>>> If this problem was hit, it would be good to get a test case for it.
>> The attachment is the ip6_dst.sh with IPVS.
>>
>> # sh ip6_dst.sh
>>
>> But this one triggers the kernel warnings caused by 2 places:
>>    unregister_netdevice: waiting for br0 to become free. Usage count = 3
>>
>> 1. one is IPVS, I just posted the fix:
>> https://patchwork.ozlabs.org/patch/998123/  [1]
>> 2. the other one is IPv6,
>> ip6_link_failure() will be hit.
>>
>> So to make this reproduce clearly, you may want to apply
>> patch [1] firstly.
>>
> Thanks for the script. It does not replicate the problem using net-next
> tree as of
>
> commit 6d5db6c37929cb0a84e64ba0590a74593e5ce3b8
> Merge: 15cef30974c5 bd3b5d462add
> Author: David S. Miller <davem@davemloft.net>
> Date:   Wed Nov 14 08:51:28 2018 -0800
>
>     Merge branch 'nfp-abm-track-all-Qdiscs'
>
>
> I would be really surprised if the fib6_info change introduced a need to
> change the dst hold's for exception routes. I am not seeing the
> connection, so I really want to see it reproduced.
>
> Thanks


Maybe it's not 100% reproducer then, but I think the fix is obviously right.

--Mika


  reply	other threads:[~2018-11-16  5:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-13 16:48 [PATCH net] ipv6: fix a dst leak when removing its exception Xin Long
2018-11-14 19:03 ` David Ahern
2018-11-15  6:33   ` David Ahern
2018-11-15  7:23     ` Xin Long
2018-11-15 18:17       ` David Ahern
2018-11-15 19:13         ` Mika Penttilä [this message]
2018-11-20  2:16       ` David Miller
2018-11-20  2:19         ` David Ahern
2018-11-15 19:49 ` David Ahern
2018-11-17  3:45 ` 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=d68eb639-889c-4c1a-3659-e396ed6126ec@nextfour.com \
    --to=mika.penttila@nextfour.com \
    --cc=davem@davemloft.net \
    --cc=dsa@cumulusnetworks.com \
    --cc=lucien.xin@gmail.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