Repository navigation
ipc4: helper: reject cross-core modules early when unsupported - #11375
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
With CONFIG_SOF_USERSPACE_LL, the userspace constructor bypasses pipeline/core validation, allowing a cross-core module that exposes the privileged ipc_comp_free_remote() path during pipeline deletion.
1 open issue
What changed in this PR
This PR aims to prevent IPC4 cross-core module operations from crashing the DSP when user-space LL execution cannot issue privileged inter-core messages.
Changes:
- Adds a module/pipeline core check in
comp_new_ipc4()for user-space LL configurations without cross-core stream support. - Moves unsupported cross-core bind rejection ahead of remote attribute access, returning
IPC4_INVALID_REQUEST.
| File | Description |
|---|---|
src/ipc/ipc4/helper.c |
Adds constructor validation and rejects unsupported cross-core binds earlier. |
Review effort: Balanced
| if (IS_ENABLED(CONFIG_SOF_USERSPACE_LL) && !IS_ENABLED(CONFIG_CROSS_CORE_STREAM) && | ||
| ppl->core != ipc_config.core) { |
There was a problem hiding this comment.
Valid, I'll move the check
PR 11375: test resultsRun date: 2026-10-30 13:49 UTC Tested commit: b38835fcd9213bd2315c9a4a7157e48d9b15e2e1 |
| /* The user-space IPC thread cannot issue the IDC calls needed to | ||
| * bind or free a module living on another core than its pipeline. | ||
| */ | ||
| if (IS_ENABLED(CONFIG_SOF_USERSPACE_LL) && !IS_ENABLED(CONFIG_CROSS_CORE_STREAM) && |
There was a problem hiding this comment.
Why is this even limited to CONFIG_SOF_USERSPACE_LL?
If CONFIG_CROSS_CORE_STREAM is disabled, it's over anyway.
There was a problem hiding this comment.
true, I will drop the LL check
5286bc7 to
b38835f
Compare
Without CONFIG_CROSS_CORE_STREAM a stream must be processed entirely on a single core, but a module created on a different core than its pipeline (e.g. the compress decoder pinned to core 1) was still accepted. With CONFIG_SOF_USERSPACE_LL the IPC4 module commands run in a user thread which cannot issue IDC messages, so CONFIG_CROSS_CORE_STREAM is disabled in that configuration and the first cross-core operation then panicked the DSP from user space instead of failing: - ipc4_comp_connect() called comp_get_attribute() on the remote sink before checking cross_core_bind, hitting the privileged IDC path (rzalloc/idc_send_msg) -> privileged instruction exception. - the host's error unwind deleted the pipeline, and ipc_pipeline_module_free() used ipc_comp_free_remote() for the remote module -> load error on the kernel-only IDC data. Reject such a module already at MOD_INIT_INSTANCE whenever cross-core streams are disabled. Do the check, together with the existing parent pipeline existence check, in ipc4_comp_new_config() so that it covers every module creation path: comp_new_ipc4() as well as the CONFIG_SOF_USERSPACE_LL specific ipc4_user_module_load() and comp_new_ipc4_user(), which skipped both checks so far. Also move the cross-core check in ipc4_comp_connect() before any remote access so the bind fails with IPC4_INVALID_REQUEST instead of crashing. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Changes since v1:
|

With CONFIG_SOF_USERSPACE_LL the IPC4 module commands run in a user thread which cannot issue IDC messages. CONFIG_CROSS_CORE_STREAM is therefore disabled in that configuration, but a module created on a different core than its pipeline (e.g. the compress decoder pinned to core 1) was still accepted, and the first cross-core operation then panicked the DSP from user space instead of failing:
Reject such a module already at MOD_INIT_INSTANCE when user-space LL is enabled and cross-core streams are disabled, and move the cross-core check in ipc4_comp_connect() before any remote access so the bind fails with IPC4_INVALID_REQUEST instead of crashing.