Skip to content

Incorrect proc-shared buffer bounds validation allows writes beyond allocation #396

Open

Description

@malto101

FastRPC version

v1.0.7

DSP firmware version

QC_IMAGE_VERSION_STRING=DSP.AT.1.0.1-00201-LEMANS-2

SoC and device name

IQ-9075

Kernel version

6.18.37-02225-g3167b1238438-dirty

What happened?

pack_proc_shared_buf_params() performs bounds validation using incorrect pointer arithmetic, causing the effective upper boundary of the process shared buffer to be interpreted as 16 KB instead of its actual 4 KB allocation.

As a result, writes that exceed the real buffer size may pass validation and later overflow the allocated region.
The buffer end address is calculated as:

buf_last_addr = buf_start_addr + PROC_SHAREDBUF_SIZE

where buf_start_addr is a uint32_t *.
Because pointer arithmetic is scaled by sizeof(uint32_t), the resulting limit is effectively: 4 KB × 4 = 16 KB
while the actual allocation created by proc_sharedbuf_init() remains 4 KB

Steps to reproduce

  1. Configure a custom DSP_LIBRARY_PATH containing enough libraries to generate a large packed payload
  2. Invoke an API, such as dspqueue_create()
  3. Allow the total packed parameter size to exceed 4096 bytes.

the expected behavior would be Packing should fail with AEE_ERPC once the allocation limit is reached.
but the actual behavior makes Validation incorrectly allows writes beyond the real allocation boundary, potentially resulting in memory corruption

Relevant log output

Activity

  1. github-actions commented on Oct 16, 2026

    @github-actions

    qualcomm/fastrpc.triage This issue has been marked as stale due to 30 days of inactivity.

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

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions