Repository navigation
Conversation
The chain DMA error path freed the ipc_comp_dev with rfree(). Since commit 85feda1 ("ipc: allocate IPC objects from the user-accessible system heap"), ipc4_add_comp_dev() allocates it with sof_heap_alloc() from sof_sys_user_heap_get(). With CONFIG_SOF_USERSPACE_LL that is the LL user heap, a block inside the kernel heap, so rfree() put the chunk into the kernel heap and corrupted it. Free it with sof_heap_free() from the same heap, as the other ipc_comp_dev free paths do. Fixes: 85feda1 ("ipc: allocate IPC objects from the user-accessible system heap") Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
kv2019i
requested review from
dbaluta,
lbetlej,
lgirdwood,
mmaka1 and
plbossart
as code owners
November 11, 2026 11:10
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the change intended to prevent heap corruption in IPC4 chain DMA error cleanup.
No open issues 🎉
What changed in this PR
Fixes a heap mismatch in IPC4 chain DMA error cleanup that could corrupt the kernel heap when CONFIG_SOF_USERSPACE_LL is enabled.
Changes:
- Replaces
rfree()withsof_heap_free(sof_sys_user_heap_get(), ...)so the component container is freed through the same heap used for its allocation.
| File | Description |
|---|---|
src/ipc/ipc4/handler-user.c |
Uses the matching heap deallocator in the chain DMA error path. |
Review effort: Balanced
PR 11441: test resultsRun date: 2026-11-11 11:40 UTC Tested commit: 053be1dd25dd30d1b536a62df9676d5ff4653550 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The chain DMA error path freed the ipc_comp_dev with rfree(). Since commit 85feda1 ("ipc: allocate IPC objects from the user-accessible system heap"), ipc4_add_comp_dev() allocates it with sof_heap_alloc() from sof_sys_user_heap_get(). With CONFIG_SOF_USERSPACE_LL that is the LL user heap, a block inside the kernel heap, so rfree() put the chunk into the kernel heap and corrupted it.
Free it with sof_heap_free() from the same heap, as the other ipc_comp_dev free paths do.
Fixes: 85feda1 ("ipc: allocate IPC objects from the user-accessible system heap")