[PATCH RESEND v2 18/51] platform/x86: toshiba_acpi: reject malformed brightness and fan writes

sashiko-bot at kernel.org sashiko-bot at kernel.org
Thu Nov 5 11:29:24 PST 2026


> When lcd_proc_write() and fan_proc_write() were refactored their checks
> were inverted but the && stayed. They only fail if sscanf() didn't
> parse anything and the value is out of range at the same time, and for
> the brightness value < 0 && value > levels can't be true at all. So an
> out of range brightness or fan setting is passed on to the hardware,
> and so is the uninitialized value if nothing could be parsed.
> 
> Restore the checks as they were before the refactoring.
> 
> Fixes: e1a949c1b988 ("toshiba_acpi: Refactor *{get, set} functions return value")
> Fixes: 3e07e5baa2af ("toshiba_acpi: Add set_fan_status function")
> Cc: stable at vger.kernel.org
> Signed-off-by: Christian Brauner (Amutable) <brauner at kernel.org>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261104-work-procfs-bugfixes-v2-0-021c84d852e0@kernel.org?part=18




More information about the kexec mailing list