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: <5040c16b-7784-42aa-bd2d-ee7e966a924f@sirena.org.uk>
Date: Tue, 4 Mar 2025 13:23:13 +0000
From: Mark Brown <broonie@...nel.org>
To: Zxyan Zhu <zxyan20@....com>
Cc: gregkh@...uxfoundation.org, rafael@...nel.org, dakr@...nel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] regmap: debugfs: Fix name collision without atomic
 operations

On Tue, Mar 04, 2025 at 08:22:21PM +0800, Zxyan Zhu wrote:

> A global variable caused debugfs name conflicts during re-entry,
> leading to creation failures. Use atomic operations to ensure safe
> and unique naming.

This doesn't help at all AFAICT?  IIRC this code was relying on some
higher level locking but ICBW.

> -						dummy_index);
> +						atomic_read(&dummy_index));

Here we do an atomic read...

>  		if (!map->debugfs_name)
>  			return;
>  		name = map->debugfs_name;
> -		dummy_index++;
> +		atomic_inc(&dummy_index);

...then later we do an atomic increment so something else could also
have come in and done an atomic read before we do the increment.

Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ