mirror of https://github.com/thesofproject/sof.git
ipc3: Check component type in ipc_stream_pcm_params()
This handler was missing its type check and would follow comp_dev union fields on components that might be buffers or pipelines, leading to crashes downstream. Found via fuzzing. Signed-off-by: Andy Ross <andyross@google.com>
This commit is contained in:
parent
403c33f829
commit
65dc05a131
|
@ -222,6 +222,12 @@ static int ipc_stream_pcm_params(uint32_t stream)
|
|||
return -ENODEV;
|
||||
}
|
||||
|
||||
if (pcm_dev->type != COMP_TYPE_COMPONENT) {
|
||||
tr_err(&ipc_tr, "ipc_stream_pcm_params(): pcm_dev id %d not component (type %d)",
|
||||
pcm_dev->id, pcm_dev->type);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* check core */
|
||||
if (!cpu_is_me(pcm_dev->core))
|
||||
return ipc_process_on_core(pcm_dev->core, false);
|
||||
|
|
Loading…
Reference in New Issue