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: <20250408075908.27f834da@kernel.org>
Date: Tue, 8 Apr 2025 07:59:08 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Joe Damato <jdamato@...tly.com>
Cc: davem@...emloft.net, netdev@...r.kernel.org, edumazet@...gle.com,
 pabeni@...hat.com, andrew+netdev@...n.ch, horms@...nel.org,
 sdf@...ichev.me, hramamurthy@...gle.com, kuniyu@...zon.com
Subject: Re: [PATCH net-next 2/8] net: designate XSK pool pointers in queues
 as "ops protected"

On Mon, 7 Apr 2025 19:17:36 -0700 Joe Damato wrote:
> > -	xp_clear_dev(pool);
> > +	if (netdev) {
> > +		netdev_lock_ops(netdev);
> > +		xp_clear_dev(pool);
> > +		netdev_unlock_ops(netdev);
> > +	}
> >  	rtnl_unlock();  
> 
> Is it actually possible for netdev to be NULL here?

So I've been told in v1 review :) I should have probably linked to
previous postings, these patches had been a part of various series
before.

The code is indeed buggy, tho, we need to move the netdev = pool->netdev
assignment under rtnl_lock..

> I feel like it probably isn't, but if it were possible we'd need an
> else case here to xp_clear_dev(pool) without the netdev_lock_ops?

It does nothing when netdev is null. Actually, due to "other changes"
all callers of xp_clear_dev() are now wrapped in the lock. We can
move the locking inside that helper.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ