summaryrefslogtreecommitdiff
path: root/rust/kernel/alloc
diff options
context:
space:
mode:
authorRosen Penev <rosenp@gmail.com>2026-11-13 22:20:23 -0800
committerGuenter Roeck <linux@roeck-us.net>2026-11-15 14:42:25 -0800
commit69624d7d821ec7d3f9801e86acf555a8edc82f99 (patch)
treed7149461fe69f50d14080f0072e70fdd06103642 /rust/kernel/alloc
parente6872defbb2eb1dc61b3ea168ca13e1362efbd86 (diff)
hwmon: (dell-smm) Reject a fan_max that the BIOS cannot take
The fan_max module parameter is used without any range check, unlike fan_mult. dell_smm_init_hwmon() allocates the nominal speed table with devm_kmalloc_array(dev, data->i8k_fan_max + 1, ...) and fan_max=4294967295 wraps the count to 0. devm_kmalloc() then returns ZERO_SIZE_PTR, which the first successful nominal speed call writes through. Values above 255 are also meaningless: the fan state is passed to the BIOS as fan | (speed << 8), so the higher bits end up in other parts of the request. Large values that do not wrap still cost one SMM call per state and fan while probing. Fail probing if the maximum fan state does not fit in a byte, like the existing check for fan_mult. Fixes: 81474fc2fae9 ("i8k: Add support for configurable maximum fan speed value") cc: stable@vger.kernel.org Signed-off-by: Rosen Penev <rosenp@gmail.com> Link: https://patch.msgid.link/6d3b86acf6713e9286e60ecf788582e840946238.1794633179.git.rosenp@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'rust/kernel/alloc')
0 files changed, 0 insertions, 0 deletions