lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Wed, 14 Feb 2018 17:55:16 +0800
From:   Xin Long <lucien.xin@...il.com>
To:     Steffen Klassert <steffen.klassert@...unet.com>
Cc:     Eyal Birger <eyal.birger@...il.com>,
        Herbert Xu <herbert@...dor.apana.org.au>,
        Wei Wang <weiwan@...gle.com>, davem <davem@...emloft.net>,
        network dev <netdev@...r.kernel.org>,
        Florian Westphal <fw@...len.de>, shmulik@...anetworks.com,
        shannon.nelson@...cle.com
Subject: Re: [PATCH ipsec,v3] net: xfrm_policy: fix device unregistration hang

On Wed, Feb 14, 2018 at 5:24 PM, Steffen Klassert
<steffen.klassert@...unet.com> wrote:
> On Tue, Feb 13, 2018 at 08:23:14PM +0200, Eyal Birger wrote:
>> Hi Xin Long,
>>
>> On Tue, 13 Feb 2018 23:18:14 +0800
>> Xin Long <lucien.xin@...il.com> wrote:
>>
>> > On Tue, Feb 13, 2018 at 6:54 PM, Eyal Birger <eyal.birger@...il.com>
>> > wrote:
>> > > In setups like the following:
>> > >
>> > >        Host A          --        Host B
>> > > tun0 -- ipsec -- eth0  --  eth0 -- ipsec -- tun0
>> > >
>> > > where tun0 are tunnel devices using dst_cache (ipip, ipip6, etc...).
>> > >
>> > > Unregistration of an underlying eth0 device leads to the following
>> > > log messages:
>> > >
>> > > unregister_netdevice: waiting for eth0 to become free. Usage count
>> > > = 2
>> > >
>> > > This is since xfrm dsts device references are not released upon
>> > > device unregistration when the xfrm dst is cached in a dst_cache.
>> > >
>> > > This issue was first introduced in commit 52df157f17e5
>> > > ("xfrm: take refcnt of dst when creating struct xfrm_dst bundle")
>> > > as part of an effort to remove routing garbage collection.
>> > >
>> > > Several approaches for fixing this were discussed in [1]; this
>> > > commit keeps track of allocated xdsts and releases their device
>> > > references on a netdev unregister/down events.
>> > >
>> > > Signed-off-by: Eyal Birger <eyal.birger@...il.com>
>> > > Fixes: 52df157f17e5 ("xfrm: take refcnt of dst when creating struct
>> > > xfrm_dst bundle")
>> > I had another fix [1] for this issue in my local tree.
>> > That reuses uncached_list to track xdsts, and fewer job to do for
>> > this. As naturally uncached_list is already the list that is supposed
>> > to do this job. We don't have to introduce a new list and members.
>> >
>> > [1] https://paste.fedoraproject.org/paste/X8FQzEXjGXQBTKAVLnDn4w
>>
>> I have tested your patch and it resolves the issue described.
>> I like not having to introduce a new list and lock.
>
> Me too. This looks like the best of all proposed solutions.
Cool.

>
>>
>> Small note: I think you need to increase net->ipv6.rt6_stats->fib_rt_uncache
>> when adding to the IPv6 uncached list from the xfrm code.
You're right, thanks for the note.

>
> Xing, plaese incorporate the review and submit the patch.
Will post soon.

>
> Thanks!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ