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: <9c9b5eb5-ed5f-4b94-a44d-eec829faf22f@roeck-us.net>
Date: Fri, 21 Nov 2025 07:50:31 -0800
From: Guenter Roeck <linux@...ck-us.net>
To: Gui-Dong Han <hanguidong02@...il.com>
Cc: juergh@...ton.me, linux-hwmon@...r.kernel.org,
	linux-kernel@...r.kernel.org, baijiaju1990@...il.com
Subject: Re: [PATCH] hwmon: (vt1211) Convert macros to functions to avoid
 TOCTOU

On Thu, Nov 20, 2025 at 12:13:31PM +0800, Gui-Dong Han wrote:
> The macros IN_FROM_REG, TEMP_FROM_REG, and RPM_FROM_REG evaluate their
> arguments multiple times. These macros are used in lockless show functions
> involving shared driver data, leading to Time-of-Check to Time-of-Use race
> conditions.
> 
> For example, RPM_FROM_REG checks if a value is 0 or 255, and then uses it
> in a division. If the value is modified by another thread to 0 after the
> check but before the division, it causes a divide-by-zero error.
> 
> Convert these macros to static functions. This guarantees that arguments
> are evaluated only once (pass-by-value), fixing the race conditions.
> Adhere to the principle of minimal changes by only converting the specific
> macros involved in these lockless contexts.
> 
> Link: https://lore.kernel.org/all/CALbr=LYJ_ehtp53HXEVkSpYoub+XYSTU8Rg=o1xxMJ8=5z8B-g@mail.gmail.com/
> Signed-off-by: Gui-Dong Han <hanguidong02@...il.com>
> ---

Applied.

Thanks,
Guenter

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ