Re: [hwmon PATCH v2 3/8] hwmon: (adt7470) Fix busy-loop and I2C flooding in update thread
Guenter Roeck <[email protected]> Mon, 27 Jul 2026 17:55:22 -0700
| Newsgroups | org.kernel.vger.linux-hwmon,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
On Mon, Jul 27, 2026 at 09:22:19PM -0300, Luiz Angelo Daros de Luca wrote: > When userspace configures 'auto_update_interval' to 0 via sysfs, the > background kthread executes schedule_timeout_interruptible(0), which > returns immediately. > > If 'num_temp_sensors' is concurrently or previously set to 0, the > msleep_interruptible() delay inside adt7470_read_temperatures() also > becomes 0. This combination forces the background thread into a tight, > unbounded busy-loop, hogging the CPU and flooding the I2C bus with a > continuous stream of transactions. > > Fix this vulnerability by raising the lower limit of the clamp_val in > auto_update_interval_store() from 0 to 500 milliseconds. This guarantees > a reasonable minimum sleep window between sensor updates, protecting the > system from intentional or accidental I2C bus denial of service. > > Reported-by: [email protected] > Closes: https://lore.kernel.org/r/[email protected] > Fixes: 89fac11cb3e7 ("adt7470: make automatic fan control really work") > Signed-off-by: Luiz Angelo Daros de Luca <[email protected]> Applied. Thanks, Guenter