Commit c9e2c27
committed
ipc4: handler: bounds-check multi-pipeline SET_PIPELINE_STATE count
For multi_ppl=1, ipc4_set_pipeline_state() takes pipelines_count
straight from the host mailbox and uses it as the ppl_id[] loop
bound, with no validation against the mailbox size.
The IPC4 fuzzer reached this path with a 6-byte input that decodes
to type=SOF_IPC4_GLB_SET_PIPELINE_STATE, multi_ppl=1 and a count
field that easily exceeds MAILBOX_HOSTBOX. Once an earlier testcase
had created a matching pipeline, the ppl_id[i] read walked past the
end of the hostbox and AddressSanitizer reported a heap-buffer
overflow.
Cap pipelines_count at what the hostbox can actually hold and reject
oversized requests with IPC4_ERROR_INVALID_PARAM, logging the offending
count via ipc_cmd_err() for parity with the surrounding handlers.
Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>1 parent b20c57b commit c9e2c27
1 file changed
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
441 | 441 | | |
442 | 442 | | |
443 | 443 | | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
444 | 459 | | |
445 | 460 | | |
446 | 461 | | |
| |||
0 commit comments