diff options
| author | Jad Keskes <inasj268@gmail.com> | 2026-07-30 15:55:48 +0100 |
|---|---|---|
| committer | Borislav Petkov (AMD) <bp@alien8.de> | 2026-08-07 16:11:52 -0700 |
| commit | 66cc9dec919dd63d8e4b3d386f7aed3ae684e645 (patch) | |
| tree | 1afba7e6d3dac426d3c381bfa99346ddbc4743c9 /include/linux/pps_kernel.h | |
| parent | e09afa69e3f5d5a304940cf4c6ea17642a1e3993 (diff) | |
EDAC/device_sysfs: Use kstrtouint() for poll_msec to prevent truncation
The poll_msec sysfs store file uses simple_strtoul() which accepts an unsigned
long, but the target field (poll_msec) is unsigned int. On 64-bit systems,
a value > UINT_MAX is silently truncated when stored.
Fix the mismatch by using kstrtouint() instead. This rejects values larger
than UINT_MAX at parse time, making truncation impossible. Also add a check
for value < 1 to reject the 0-delay case, which would cause the poll work to
spin without delay and consume 100% CPU.
Fixes: e27e3dac6517 ("drivers/edac: add edac_device class")
Signed-off-by: Jad Keskes <inasj268@gmail.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://patch.msgid.link/20260730145549.148229-1-inasj268@gmail.com
Diffstat (limited to 'include/linux/pps_kernel.h')
0 files changed, 0 insertions, 0 deletions
