Skip to content

Bug fixes on procbuf - #399

Open
Dhruv Menon (malto101) wants to merge 2 commits into
qualcomm:developmentfrom
malto101:bug-fix
Open

Dhruv Menon (malto101) wants to merge 2 commits into
qualcomm:developmentfrom
malto101:bug-fix

Conversation

@malto101

@malto101 Dhruv Menon (malto101) commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

This PR fixes 2 independently reachable bugs in FastRPC
The issues were noticed when ASan and UBSan were enabled

bug 1: #396

The bounds calculation now uses byte-accurate arithmetic, ensuring writes that would exceed the actual allocation are rejected with AEE_ERPC before reaching memcpy()

bug 2: #397

allocation has been changed to calloc ensuring the buffer is always NUL-terminated and safe to inspect even when no libraries are discovered

@github-actions

Copy link
Copy Markdown

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

@github-actions github-actions Bot added the Stale label Oct 16, 2026
@malto101

Copy link
Copy Markdown
Contributor Author

Comment thread src/fastrpc_procbuf.c Resolved
Comment thread src/dspqueue/dspqueue_cpu.c Resolved
Dhruv Menon (malto101) added a commit to malto101/fastrpc that referenced this pull request Oct 28, 2026
Run all externally testable PR qualcomm#399 diagnostics in isolated child processes with per-case watchdogs and consolidated reports.

Co-Authored-By: Claude Code <[email protected]>
Signed-off-by: Dhruv Menon <[email protected]>
Comment thread src/dspqueue/dspqueue_cpu.c Resolved
Comment thread src/dspqueue/dspqueue_cpu.c Resolved
Comment thread src/dspqueue/dspqueue_cpu.c Resolved
Comment thread src/dspqueue/dspqueue_cpu.c Resolved
@quic-vkatoch

Copy link
Copy Markdown
Contributor

Could you also update the commit messages as per changes?

@malto101

Copy link
Copy Markdown
Contributor Author

Could you also update the commit messages as per changes?

updated it!

Comment thread src/fastrpc_procbuf.c Resolved
Comment thread src/dspqueue/dspqueue_cpu.c Resolved
Comment thread src/dspqueue/dspqueue_cpu.c Resolved
@quic-vkatoch

Copy link
Copy Markdown
Contributor

This PR fixes three independently reachable bugs in FastRPC The issues were noticed when ASan and UBSan were enabled

there are only 2 fixes in this PR

The old check used a word offset as a byte limit, allowing an
oversized range.

Signed-off-by: Dhruv Menon <[email protected]>
fastrpc_process_pack_params() allocated lib_names with malloc(), leaving
it uninitialized. get_non_preload_lib_names() only writes to it via
strlcat() inside a conditional branch reached per matching file found
under DSP_LIBRARY_PATH; if no files match, the buffer is never written,
and the function's unconditional `strlen(*lib_names)` then reads past
the uninitialized (and possibly unterminated) allocation.

Reproduced by libFuzzer+ASan: DSP_LIBRARY_PATH set to a directory with no
matching .so files triggers a heap-buffer-overflow read on the 2048-byte
MAX_NON_PRELOAD_LIBS_LEN allocation. Switch to calloc() so the buffer is
always NUL-terminated even when strlcat() is never called.

Signed-off-by: Dhruv Menon <[email protected]>
@anankulk

Copy link
Copy Markdown
Contributor
🤖 FastRPC AI Code Review — ✅ No issues found · patch 1dc36a6a84bf

No issues found by the FastRPC AI code reviewer.

To suppress a false positive: add an entry to .qvigor/review_feedback.json on the development branch with "decision": "denied".

@anankulk

Copy link
Copy Markdown
Contributor

Pre-merge CI results — patch 1dc36a6a84bf

Validated On

  • fastrpc baseline (development): 89508eaeed55
  • kernel baseline (qcom-next (reference)): 17bbb4b37bbc

Kernel: 7.3.0-g17bbb4b37bbc

Test Matrix

Targets Domain PD Type Tests Result
kaanapali-mtpADSPSigned3/3✅ Pass
kaanapali-mtpCDSPSigned3/3✅ Pass
kaanapali-mtpCDSPUnsigned3/3✅ Pass
lemans-evkoverallN/A—❌ Fail
monaco-evkoverallN/A—❌ Fail
purwa-iot-evkADSPSigned3/3✅ Pass
purwa-iot-evkCDSPSigned0/3❌ Fail
purwa-iot-evkCDSPUnsigned0/3❌ Fail
qcs615-adp-airADSPSigned3/3✅ Pass
qcs615-adp-airCDSPSigned3/3✅ Pass
qcs615-adp-airCDSPUnsigned3/3✅ Pass
qcs615-rideoverallN/A—❌ Fail
qcs6490-rb3gen2ADSPSigned3/3✅ Pass
qcs6490-rb3gen2CDSPSigned3/3✅ Pass
qcs6490-rb3gen2CDSPUnsigned3/3✅ Pass
qcs8300-rideADSPSigned3/3✅ Pass
qcs8300-rideCDSPSigned3/3✅ Pass
qcs8300-rideCDSPUnsigned3/3✅ Pass
sm8750-mtpADSPSigned3/3✅ Pass
sm8750-mtpCDSPSigned3/3✅ Pass
sm8750-mtpCDSPUnsigned3/3✅ Pass

LAVA Jobs:

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