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: <20260109083130.50ae4ba9@kernel.org>
Date: Fri, 9 Jan 2026 08:31:30 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: "Russell King (Oracle)" <linux@...linux.org.uk>
Cc: Heiner Kallweit <hkallweit1@...il.com>, Andrew Lunn <andrew@...n.ch>,
 Andrew Lunn <andrew+netdev@...n.ch>, Paolo Abeni <pabeni@...hat.com>, Eric
 Dumazet <edumazet@...gle.com>, David Miller <davem@...emloft.net>,
 "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: [PATCH net-next] net: phy: fixed_phy: replace list of fixed
 PHYs with static array

On Fri, 9 Jan 2026 15:10:18 +0000 Russell King (Oracle) wrote:
> > Isn't IDA an overkill for a range this tiny?
> > IDA is useful if the ID range is large and may be sparse.
> > Here a bitmap would suffice.
> > 
> > DECLARE_BITMAP(phy_fixed_ids, NUM_FP); 
> > 
> > id = find_first_zero_bit(phy_fixed_ids, NUM_FP);
> > if (id >= NUM_FP)
> > 	return -ENOSPC;
> > 
> > set_bit(id, phy_fixed_ids);  
> 
> Racy without locking.

True, if there's no existing locking wrap it in a do {} while and use
test_and_set_bit() as the condition for repeat.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ