Linux Kernel hwmon w83791d TOCTOU Race Condition Vulnerability

Vulnerability

A vulnerability in the Linux kernel's hardware monitoring driver for the Winbond W83791D chip has been addressed. The issue arose because the macro FAN_FROM_REG was evaluated multiple times, leading to Time-of-Check to Time-of-Use (TOCTOU) race conditions in lockless contexts with shared driver data. This could potentially cause divide-by-zero errors. The vulnerability has been fixed by converting the macro into a static function, ensuring that arguments are evaluated only once. Additionally, the calculation of the minimum fan limit has been moved inside a data update lock to maintain consistency during read-modify-write operations.

Impact

The vulnerability could lead to race conditions, causing unexpected behavior in the driver, such as divide-by-zero errors, which could disrupt system stability or functionality.

Reproduction

The vulnerability can be reproduced by using the Winbond W83791D hardware monitoring driver in a lockless context where shared driver data is accessed. The FAN_FROM_REG macro, when evaluated multiple times, creates a TOCTOU race condition that can be exploited, potentially leading to a divide-by-zero error.

Remediation

Users can apply the latest patches available in the Linux kernel stable tree to address this vulnerability.

Added: Jan 14, 2026, 4:16 PM
Updated: Jan 14, 2026, 5:54 PM

Vulnerability Rating

Custom Algorithm
spread
9.0
impact
2.5
exploitability
3.9
remediation
7.7
relevance
2.1
threat
4.8
urgency
2.9
incentive
0.0

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.