Skip to content

ipc4: handler-user: bound data_off_size in vendor config get - #11298

Open
Shrusti-pk wants to merge 1 commit into
thesofproject:mainfrom
Shrusti-pk:ipc4-vendor-config-bound
Open

Shrusti-pk wants to merge 1 commit into
thesofproject:mainfrom
Shrusti-pk:ipc4-vendor-config-bound

Conversation

@Shrusti-pk

Copy link
Copy Markdown
Contributor

the userspace large-config get path trusts the host data_off_size for a vendor config:

  • data_off_size is a 20-bit host field, so it can claim ~1 MiB while the hostbox is only MAILBOX_HOSTBOX_SIZE (4 KiB on Intel platforms)
  • ipc4_get_vendor_config_module_instance divides it by sizeof(struct sof_tl) and walks that many entries straight out of the hostbox, reading ~1 MiB past the end (confirmed with an asan model of the loop: heap-buffer-overflow read 0 bytes after the 4096-byte region)
  • the sibling ipc4_get_large_config_module_instance and the vendor set path both already reject data_off_size > MAILBOX_HOSTBOX_SIZE, so only this path was missed

bound it before the cache invalidate and the read, matching the two siblings.

The userspace large-config get path reads data_off_size straight from
the host message and, for a vendor config, hands it to the vendor
reader which divides it by sizeof(struct sof_tl) and walks that many
entries out of the hostbox. data_off_size is a 20-bit host field so it
can claim far more than the 4 KiB hostbox, over-reading roughly 1 MiB
past it.

The sibling get path and the vendor set path both already reject a
data_off_size larger than the mailbox; this one was missed. Add the
same bound before the cache invalidate and the read.

Signed-off-by: Shrushti P K <shrusthi@labs.digiscrypt.com>
@sofci

sofci commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator

Can one of the admins verify this patch?

reply test this please to run this test once

@lgirdwood

Copy link
Copy Markdown
Member

test this please

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.

3 participants