CVE-2025-71111: hwmon: (w83791d) Convert macros to functions to avoid TOCTOU
In the Linux kernel, the following vulnerability has been resolved:
hwmon: (w83791d) Convert macros to functions to avoid TOCTOU
The macro FANFROMREG evaluates its arguments multiple times. When used in lockless contexts involving shared driver data, this leads to Time-of-Check to Time-of-Use (TOCTOU) race conditions, potentially causing divide-by-zero errors.
Convert the macro to a static function. This guarantees that arguments are evaluated only once (pass-by-value), preventing the race conditions.
Additionally, in storefandiv, move the calculation of the minimum limit inside the update lock. This ensures that the read-modify-write sequence operates on consistent data.
Adhere to the principle of minimal changes by only converting macros that evaluate arguments multiple times and are used in lockless contexts.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.1.176-1Fixed in 6.1.190-1Fixed in 6.12.107-1Fixed in 6.12.113-1Fixed in 7.2.12-1Fixed in 7.2.13-1 - Compensating control
In hwmon (w83791d), convert the FAN_FROM_REG macro to a static function so its arguments are evaluated only once, limiting this change to macros that evaluate arguments multiple times and are used in lockless contexts.
- Compensating control
In store_fan_div, move the calculation of the minimum limit inside the update lock so the read-modify-write sequence operates on consistent data.
Event History
Frequently Asked Questions
What is the severity of CVE-2025-71111?
CVE-2025-71111 has been rated as a medium severity vulnerability.
How do I fix CVE-2025-71111?
To fix CVE-2025-71111, update to the latest version of the Linux kernel where this vulnerability has been patched.
What impact does CVE-2025-71111 have on system security?
CVE-2025-71111 can potentially lead to vulnerabilities in shared memory contexts, which may allow unauthorized access to sensitive data.
Which versions of the Linux kernel are affected by CVE-2025-71111?
CVE-2025-71111 affects multiple versions of the Linux kernel prior to the security patch.
Is CVE-2025-71111 remotely exploitable?
CVE-2025-71111 is not considered remotely exploitable, but it may pose risks in specific configurations involving shared memory.