Skip to content

platform: posix: free bound IPC4 buffers in fuzz teardown - #11587

Open
tmleman wants to merge 1 commit into
thesofproject:mainfrom
tmleman:topic/upstream/pr/posix/ipc_teardown
Open

tmleman wants to merge 1 commit into
thesofproject:mainfrom
tmleman:topic/upstream/pr/posix/ipc_teardown

Conversation

@tmleman

@tmleman tmleman commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

IPC4 does not keep BIND buffers in comp_list. The firmware releases them on UNBIND or DELETE_PIPELINE, where ipc_pipeline_module_free() disconnects each module and frees a buffer once both of its ends are detached. The fuzz teardown instead frees components directly with ipc_comp_free(), which only detaches the buffers, so every buffer bound by a testcase leaked into the heap used by all following testcases.

With CONFIG_SYS_HEAP_HARDENING_EXTREME (UBSan fuzz build) each heap operation validates the whole heap, so the per-execution cost grew with the number of executions in a process. Replaying the 29k-input IPC4 corpus took ~4600 s instead of ~175 s and made campaign iterations overrun their time budget.

Mirror the DELETE_PIPELINE buffer release for each component before ipc_comp_free() in the IPC4 teardown.

IPC4 does not keep BIND buffers in comp_list. The firmware releases
them on UNBIND or DELETE_PIPELINE, where ipc_pipeline_module_free()
disconnects each module and frees a buffer once both of its ends are
detached. The fuzz teardown instead frees components directly with
ipc_comp_free(), which only detaches the buffers, so every buffer
bound by a testcase leaked into the heap used by all following
testcases.

With CONFIG_SYS_HEAP_HARDENING_EXTREME (UBSan fuzz build) each heap
operation validates the whole heap, so the per-execution cost grew
with the number of executions in a process. Replaying the 29k-input
IPC4 corpus took ~4600 s instead of ~175 s and made campaign
iterations overrun their time budget.

Mirror the DELETE_PIPELINE buffer release for each component before
ipc_comp_free() in the IPC4 teardown.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
Copilot AI balanced review requested due to automatic review settings December 2, 2026 09:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The IPC4 teardown buffer-cleanup change has no active review issues.

No open issues 🎉

What changed in this PR

Fixes IPC4 buffer leaks in POSIX fuzz teardown, preventing heap growth and progressive slowdowns across testcases.

Changes:

  • Releases bound buffers before component destruction, mirroring DELETE_PIPELINE cleanup.
  • Documents IPC4-specific buffer ownership and teardown behavior.
File Description
src/​kernel/​platform/​posix/​ipc.c Adds IPC4 bound-buffer cleanup to the component teardown pass.

Review effort: Balanced

@intel-sofci

Copy link
Copy Markdown

PR 11587: test results

Run date: 2026-12-02 11:25 UTC

Tested commit: b3bb3820fc49ae71351746de0acf02082980beda

mtl pass rate lnl pass rate ptl pass rate wcl pass rate nvl pass rate

@lgirdwood

Copy link
Copy Markdown
Member

@tmleman can you check CI and let me know if good to merge. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants