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: <ZrwgRaDc1Vo0Jhcj@Laptop-X1>
Date: Wed, 14 Aug 2024 11:11:01 +0800
From: Hangbin Liu <liuhangbin@...il.com>
To: Jianbo Liu <jianbol@...dia.com>
Cc: "kuba@...nel.org" <kuba@...nel.org>,
	"davem@...emloft.net" <davem@...emloft.net>,
	Tariq Toukan <tariqt@...dia.com>,
	"andy@...yhouse.net" <andy@...yhouse.net>,
	Gal Pressman <gal@...dia.com>,
	"jv@...sburgh.net" <jv@...sburgh.net>,
	"pabeni@...hat.com" <pabeni@...hat.com>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	"edumazet@...gle.com" <edumazet@...gle.com>,
	Saeed Mahameed <saeedm@...dia.com>,
	Leon Romanovsky <leonro@...dia.com>
Subject: Re: [PATCH net V3 1/3] bonding: implement xdo_dev_state_free and
 call it after deletion

On Wed, Aug 14, 2024 at 02:03:58AM +0000, Jianbo Liu wrote:
> On Tue, 2024-08-13 at 07:14 -0700, Jakub Kicinski wrote:
> > On Tue, 13 Aug 2024 02:58:12 +0000 Jianbo Liu wrote:
> > > > > +       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?  
> > > 
> > > I think it should be xfrm state (and bond device).
> > 
> > Please explain it in the commit message in more certain terms.
> 
> Sorry, I don't understand. The real_dev is saved in xs->xso.real_dev,
> and also bond's slave. It's straightforward. What else do I need to
> explain?

I think Jakub means you need to make sure the real_dev is not freed during
xfrmdev_ops. See bond_ipsec_add_sa(). You unlock it too early and later
xfrmdev_ops is not protected.

Hangbin

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ