mirror of https://github.com/thesofproject/sof.git
ipc/pipeline: Check type in ipc_pipeline_complete()
This function is called based on external commands, and with an arbitrary component ID that may not actually be a pipeline. Check the type before following garbage pointers and passing them down into call trees. Found via fuzzing. Signed-off-by: Andy Ross <andyross@google.com>
This commit is contained in:
parent
7511a1da15
commit
d788b34749
|
@ -201,6 +201,12 @@ int ipc_pipeline_complete(struct ipc *ipc, uint32_t comp_id)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (ipc_pipe->type != COMP_TYPE_PIPELINE) {
|
||||
tr_err(&ipc_tr, "ipc_pipeline_complete(): component %d not pipeline (type %d)",
|
||||
ipc_pipe->id, ipc_pipe->type);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* check core */
|
||||
if (!cpu_is_me(ipc_pipe->core))
|
||||
return ipc_process_on_core(ipc_pipe->core, false);
|
||||
|
|
Loading…
Reference in New Issue