[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f150dec8-7187-417a-a700-4ea7ce44f721@redhat.com>
Date: Thu, 1 Aug 2024 12:25:39 +0200
From: Paolo Abeni <pabeni@...hat.com>
To: Tariq Toukan <tariqt@...dia.com>, "David S. Miller"
<davem@...emloft.net>, Jakub Kicinski <kuba@...nel.org>,
Eric Dumazet <edumazet@...gle.com>, Jay Vosburgh <jv@...sburgh.net>,
Andy Gospodarek <andy@...yhouse.net>
Cc: netdev@...r.kernel.org, Saeed Mahameed <saeedm@...dia.com>,
Gal Pressman <gal@...dia.com>, Leon Romanovsky <leonro@...dia.com>,
Hangbin Liu <liuhangbin@...il.com>, Jianbo Liu <jianbol@...dia.com>
Subject: Re: [PATCH net V2 3/3] bonding: change ipsec_lock from spin lock to
mutex
On 8/1/24 11:49, Tariq Toukan wrote:
> diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
> index e6514ef7ad89..0f8d1b29dc7f 100644
> --- a/drivers/net/bonding/bond_main.c
> +++ b/drivers/net/bonding/bond_main.c
> @@ -436,41 +436,34 @@ static int bond_ipsec_add_sa(struct xfrm_state *xs,
> if (!bond_dev)
> return -EINVAL;
>
> - rcu_read_lock();
> bond = netdev_priv(bond_dev);
> slave = rcu_dereference(bond->curr_active_slave);
> - if (!slave) {
> - rcu_read_unlock();
I'm sorry, I probably was not clear with my question on the previous
revision.
I asked if this code is under RTNL lock already, if so we could replace
rcu_dereference with rtnl_dereference() and drop the rcu lock.
You stated this block is not under the RTNL lock, so we still need the
rcu lock around rcu_dereference().
Same thing in bond_ipsec_del_sa().
Please have a run with CONFIG_PROVE_RCU, it should splat on such
dereference.
Thanks,
Paolo
Powered by blists - more mailing lists