Skip to content

ipc4: handler-user: check TLV header fits before reading it - #11607

Open
tmleman wants to merge 1 commit into
thesofproject:mainfrom
tmleman:topic/upstream/pr/ipc4/fix/tlv_overflow
Open

tmleman wants to merge 1 commit into
thesofproject:mainfrom
tmleman:topic/upstream/pr/ipc4/fix/tlv_overflow

Conversation

@tmleman

@tmleman tmleman commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

ipc4_set_vendor_config_module_instance() reads tlv->length to reject zero-length TLVs before checking that a whole struct sof_tlv is left in the payload. With data_off_size = MAILBOX_HOSTBOX_SIZE and TLVs chained so the last header starts 4 bytes before the end, the length read lands just past the hostbox.

Found by the IPC4 fuzzer (ASan): global-buffer-overflow READ of size 4 right after posix_hostbox.

Move the header size check ahead of the first header field access.

ipc4_set_vendor_config_module_instance() reads tlv->length to reject
zero-length TLVs before checking that a whole struct sof_tlv is left in
the payload. With data_off_size = MAILBOX_HOSTBOX_SIZE and TLVs chained
so the last header starts 4 bytes before the end, the length read
lands just past the hostbox.

Found by the IPC4 fuzzer (ASan): global-buffer-overflow READ of size 4
right after posix_hostbox.

Move the header size check ahead of the first header field access.

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

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

No actionable issues were found in the reviewed changes to IPC4 vendor-configuration parsing.

No open issues 🎉

What changed in this PR

Fixes an out-of-bounds read in IPC4 vendor-configuration parsing reported by the fuzzer.

Changes:

  • Validates that each TLV header fits before reading its fields.
  • Preserves separate value-length validation and clarifies bounds-check comments.
File Description
src/​ipc/​ipc4/​handler-user.c Moves the header-size check ahead of the first TLV field access.

Review effort: Balanced

@intel-sofci

Copy link
Copy Markdown

PR 11607: test results

Run date: 2026-12-03 17:20 UTC

Tested commit: 056e4a31834cb9e13f099f17131fe4451b714972

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

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.

4 participants