* [PATCH] macintosh/windfarm: Fix fan ID bounds check in smu_set_fan()
@ 2026-11-25 10:57 Thorsten Blum
0 siblings, 0 replies; only message in thread
From: Thorsten Blum @ 2026-11-25 10:57 UTC (permalink / raw)
To: Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
Christophe Leroy (CS GROUP), Benjamin Herrenschmidt,
Paul Mackerras
Cc: Thorsten Blum, linuxppc-dev
The 14-byte legacy fan payload contains 2 control bytes followed by 6
16-bit fan values. However, the existing check also accepts IDs 6 and 7.
ID 6 stores its value in the last 2 bytes of the buffer, but outside the
transmitted payload, while ID 7 writes beyond the 16-byte buffer.
Reject IDs greater than 5 for legacy fan commands.
Fixes: 75722d3992f5 ("[PATCH] ppc64: Thermal control for SMU based machines")
Signed-off-by: Thorsten Blum <blum@kernel.org>
---
drivers/macintosh/windfarm_smu_controls.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/macintosh/windfarm_smu_controls.c b/drivers/macintosh/windfarm_smu_controls.c
index 9adceae74345..f430f160f246 100644
--- a/drivers/macintosh/windfarm_smu_controls.c
+++ b/drivers/macintosh/windfarm_smu_controls.c
@@ -74,7 +74,7 @@ static int smu_set_fan(int pwm, u8 id, u16 value)
*((u16 *)(&buffer[2])) = value;
cmd.data_len = 4;
} else {
- if (id > 7)
+ if (id > 5)
return -EINVAL;
/* Fill argument buffer */
memset(buffer, 0, 16);
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-25 10:58 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-25 10:57 [PATCH] macintosh/windfarm: Fix fan ID bounds check in smu_set_fan() Thorsten Blum
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox