ASoC: SOF: ipc3/ipc4-control: harden kcontrol payload handling
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest6 patches 1 replyIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/6 | ASoC: SOF: ipc4-control: Fix TOCTOU in sof_ipc4_bytes_putsound/ | +7 | 0 replies | |
| 2/6 | ASoC: SOF: ipc4-control: Validate notification payload sizesound/ | +23 | 0 replies | |
| 3/6 | ASoC: SOF: ipc3-control: Use overflow checks in control_update size calcsound/ | +16 | 0 replies | |
| 4/6 | ASoC: SOF: ipc3-control: Validate size in snd_sof_update_controlsound/ | +9 | 0 replies | |
| 5/6 | ASoC: SOF: ipc3-control: Fix TOCTOU in bytes_put and bytes_getsound/ | +16 | 0 replies | |
| 6/6 | ASoC: SOF: ipc3-control: Fix heap overflow in bytes_ext put/getsound/ | +19 | 0 replies |
Reviews trailers per patch
All 6 patches have a Reviewed-by or Acked-by.
| Patch | Liam Girdwood | Bard Liao |
|---|---|---|
| 1/6 | R-b | R-b |
| 2/6 | R-b | R-b |
| 3/6 | R-b | R-b |
| 4/6 | R-b | R-b |
| 5/6 | R-b | R-b |
| 6/6 | R-b | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 0/6] ASoC: SOF: ipc3/ipc4-control: harden kcontrol payload handling
Hi,
This series hardens SOF kcontrol data paths for both IPC3 and IPC4 by fixing size-handling bugs in put/get/update flows and tightening bounds checks around firmware/user-provided payload lengths.
The changes include:
Fix TOCTOU-style size misuse in IPC3/IPC4 bytes put paths by validating and using the incoming payload size.
Add notification/update payload size validation before parsing control data. Use overflow-checked arithmetic when computing expected IPC3 control sizes. Ensure update/copy bounds are validated against actual allocation limits. Fix IPC3 bytes_ext bounds checks to account for struct header offset, closing a heap overflow/over-read issue from unprivileged userspace TLV access. Overall, the series makes control payload processing robust against malformed or inconsistent sizes and prevents out-of-bounds accesses.
Regards,
Peter
---
Peter Ujfalusi (6):
ASoC: SOF: ipc4-control: Fix TOCTOU in sof_ipc4_bytes_put
ASoC: SOF: ipc4-control: Validate notification payload size
ASoC: SOF: ipc3-control: Use overflow checks in control_update size
calc
ASoC: SOF: ipc3-control: Validate size in snd_sof_update_control
ASoC: SOF: ipc3-control: Fix TOCTOU in bytes_put and bytes_get
ASoC: SOF: ipc3-control: Fix heap overflow in bytes_ext put/get
sound/soc/sof/ipc3-control.c | 79 +++++++++++++++++++++++++++--------- sound/soc/sof/ipc4-control.c | 34 ++++++++++++++-- 2 files changed, 90 insertions(+), 23 deletions(-)
Signature · 1 line
2.54.0