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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ad289f9a-41c3-4544-8aeb-535615f45aef@nvidia.com>
Date: Wed, 8 Jan 2025 11:40:05 +0800
From: Jianbo Liu <jianbol@...dia.com>
To: Hangbin Liu <liuhangbin@...il.com>
CC: Jakub Kicinski <kuba@...nel.org>, <netdev@...r.kernel.org>, Jay Vosburgh
	<jv@...sburgh.net>, Andy Gospodarek <andy@...yhouse.net>, "David S. Miller"
	<davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, Paolo Abeni
	<pabeni@...hat.com>, Nikolay Aleksandrov <razor@...ckwall.org>, Simon Horman
	<horms@...nel.org>, Tariq Toukan <tariqt@...dia.com>, Andrew Lunn
	<andrew+netdev@...n.ch>, Shuah Khan <shuah@...nel.org>, Steffen Klassert
	<steffen.klassert@...unet.com>, Herbert Xu <herbert@...dor.apana.org.au>,
	Sabrina Dubroca <sd@...asysnail.net>, <linux-kselftest@...r.kernel.org>,
	<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH net 0/2] bond: fix xfrm offload feature during init



On 1/8/2025 10:46 AM, Hangbin Liu wrote:
> On Mon, Jan 06, 2025 at 10:47:16AM +0000, Hangbin Liu wrote:
>> On Thu, Jan 02, 2025 at 11:33:34AM +0800, Jianbo Liu wrote:
>>>>> Re-locking doesn't look great, glancing at the code I don't see any
>>>>> obvious better workarounds. Easiest fix would be to don't let the
>>>>> drivers sleep in the callbacks and then we can go back to a spin lock.
>>>>> Maybe nvidia people have better ideas, I'm not familiar with this
>>>>> offload.
>>>>
>>>> I don't know how to disable bonding sleeping since we use mutex_lock now.
>>>> Hi Jianbo, do you have any idea?
>>>>
>>>
>>> I think we should allow drivers to sleep in the callbacks. So, maybe it's
>>> better to move driver's xdo_dev_state_delete out of state's spin lock.
>>
>> I just check the code, xfrm_dev_state_delete() and later
>> dev->xfrmdev_ops->xdo_dev_state_delete(x) have too many xfrm_state x
>> checks. Can we really move it out of spin lock from xfrm_state_delete()
> 
> I tried to move the mutex lock code to a work queue, but found we need to
> check (ipsec->xs == xs) in bonding. So we still need xfrm_state x during bond

Maybe I miss something, but why need to hold spin lock. You can keep 
xfrm state by its refcnt.

> ipsec gc.
> 
> So either we add a new lock for xfrm_state, or we need to unlock spin lock in
> bonding bond_ipsec_del_sa().
> 
> Cc IPsec experts to see if they have any comments.
> 
> Background: The xfrm_dev_state_delete() in xfrm_state_delete() is protected
> by spin lock. But the driver delete ops dev->xfrmdev_ops->xdo_dev_state_delete(x)
> may sleep, e.g. bond_ipsec_del_sa(). What we should deal with this issue?
> 
> Thanks
> Hangbin


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ