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] [day] [month] [year] [list]
Message-ID: <20241203182303.0550b547@kernel.org>
Date: Tue, 3 Dec 2024 18:23:03 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: Shinas Rasheed <srasheed@...vell.com>
Cc: <netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
 <hgani@...vell.com>, <sedara@...vell.com>, <vimleshk@...vell.com>,
 <thaller@...hat.com>, <wizhao@...hat.com>, <kheib@...hat.com>,
 <egallen@...hat.com>, <konguyen@...hat.com>, <horms@...nel.org>,
 <einstein.xue@...axg.com>, Veerasenareddy Burru <vburru@...vell.com>,
 Andrew Lunn <andrew+netdev@...n.ch>, "David S. Miller"
 <davem@...emloft.net>, "Eric Dumazet" <edumazet@...gle.com>, Paolo Abeni
 <pabeni@...hat.com>, Satananda Burla <sburla@...vell.com>, Abhijit Ayarekar
 <aayarekar@...vell.com>
Subject: Re: [PATCH net v1 1/4] octeon_ep: fix race conditions in
 ndo_get_stats64

On Mon, 2 Dec 2024 23:21:27 -0800 Shinas Rasheed wrote:
> +	clear_bit(OCTEP_DEV_STATE_OPEN, &oct->state);
> +	/* Make sure device state open is cleared so that no more
> +	 * stats fetch can happen intermittently
> +	 */
> +	smp_mb__after_atomic();
> +	while (octep_drv_busy(oct))
> +		msleep(20);

This is a poor re-implementation of a lock.
We have more lock types in Linux than I care to count now.
Please just use the right one. Hint, it's probably a spin lock or
RCU+synchronize_net() on close.
-- 
pw-bot: cr

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ