[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240812174834.4bcba98d@kernel.org>
Date: Mon, 12 Aug 2024 17:48:34 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Tariq Toukan <tariqt@...dia.com>
Cc: "David S. Miller" <davem@...emloft.net>, Paolo Abeni
<pabeni@...hat.com>, Eric Dumazet <edumazet@...gle.com>, "Jay Vosburgh"
<jv@...sburgh.net>, Andy Gospodarek <andy@...yhouse.net>,
<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 V3 1/3] bonding: implement xdo_dev_state_free and
call it after deletion
On Mon, 5 Aug 2024 08:03:55 +0300 Tariq Toukan wrote:
> +static void bond_ipsec_free_sa(struct xfrm_state *xs)
> +{
> + struct net_device *bond_dev = xs->xso.dev;
> + struct net_device *real_dev;
> + struct bonding *bond;
> + struct slave *slave;
> +
> + if (!bond_dev)
> + return;
can xs->xso.dev be NULL during the dev_free_state callback?
> + rcu_read_lock();
> + bond = netdev_priv(bond_dev);
> + slave = rcu_dereference(bond->curr_active_slave);
> + real_dev = slave ? slave->dev : NULL;
> + rcu_read_unlock();
What's holding onto real_dev once you drop the rcu lock here?
Powered by blists - more mailing lists