Skip to content

fix/security build warnings - #423

Merged
Ekansh Gupta (ekanshibu) merged 2 commits into
qualcomm:developmentfrom
lool:fix/security-build-warnings
Nov 25, 2026
Merged

Ekansh Gupta (ekanshibu) merged 2 commits into
qualcomm:developmentfrom
lool:fix/security-build-warnings

Conversation

@lool

Copy link
Copy Markdown
Contributor

A couple of issues discovered through Debian build warnings:

  • fastrpc-healthcheck: don't use truncated paths
  • fastrpc: fix const and inline warnings in fastrpc_apps_user.c

Building with -D_FORTIFY_SOURCE=2 triggers -Wformat-truncation warnings
for most of the snprintf() calls that build paths from directory entry
names, YAML values and sysfs contents. When such a path doesn't fit, the
truncated result names a different file or directory, which the tool
would then stat, open or parse.

Make join2() report truncation and use it for all "%s/%s" path
construction, skipping the entry (or failing the lookup) when the path
doesn't fit. Likewise, check the result of building the remoteproc
firmware path, and don't record a remoteproc whose name doesn't fit in
dsp_t.rproc rather than keeping a truncated name.

Signed-off-by: Loïc Minier <[email protected]>
get_domain_from_name() stored the result of strstr() on a const URI in a
non-const pointer, dropping the qualifier (-Wdiscarded-qualifiers).
Declare session_uri as const char *; it is only read.

is_smmu_enabled() was a non-static inline function calling the static
hlist_lookup(), which C99 does not allow. It also dereferenced the
result of hlist_lookup() without checking for NULL. It has no callers
and, being an inline definition without an extern declaration, was
never exported from the libraries, so remove it.

Signed-off-by: Loïc Minier <[email protected]>
@anankulk

Copy link
Copy Markdown
Contributor
🤖 FastRPC AI Code Review — ⚠️ 2 finding(s): 1 HIGH, 1 MEDIUM · patch 202632308333
Severity Location Rule Issue Suggested Fix
🟡 MEDIUM src/fastrpc_apps_user.c:1061 fn-001 Removed inline function is_smmu_enabled() without checking if it's used elsewhere Verify the function is not called anywhere in the codebase before removal, or if it's defined elsewhere, ensure no duplicate definition error
🔴 HIGH test/fastrpc_healthcheck.c:713 err-001 snprintf return value checked but no error handling when truncation occurs Add error handling: if (n < 0

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 202632308333

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
glymur-crdADSPSigned3/3✅ Pass
glymur-crdCDSPSigned3/3✅ Pass
glymur-crdCDSPUnsigned3/3✅ Pass
hamoa-iot-evkADSPSigned3/3✅ Pass
hamoa-iot-evkCDSPSigned3/3✅ Pass
hamoa-iot-evkCDSPUnsigned3/3✅ Pass
kaanapali-mtpADSPSigned3/3✅ Pass
kaanapali-mtpCDSPSigned3/3✅ Pass
kaanapali-mtpCDSPUnsigned3/3✅ Pass
lemans-evkADSPSigned3/3✅ Pass
lemans-evkCDSPSigned3/3✅ Pass
lemans-evkCDSPUnsigned3/3✅ Pass
lemans-evkCDSP1Signed3/3✅ Pass
lemans-evkCDSP1Unsigned3/3✅ Pass
lemans-evkGDSP0Signed3/3✅ Pass
lemans-evkGDSP0Unsigned3/3✅ Pass
lemans-evkGDSP1Signed3/3✅ Pass
lemans-evkGDSP1Unsigned3/3✅ Pass
monaco-evkADSPSigned3/3✅ Pass
monaco-evkCDSPSigned3/3✅ Pass
monaco-evkCDSPUnsigned3/3✅ Pass
monaco-evkGDSP0Signed3/3✅ Pass
monaco-evkGDSP0Unsigned3/3✅ Pass
purwa-iot-evkADSPSigned3/3✅ Pass
purwa-iot-evkCDSPSigned3/3✅ Pass
purwa-iot-evkCDSPUnsigned3/3✅ Pass
qcs615-adp-airADSPSigned3/3✅ Pass
qcs615-adp-airCDSPSigned3/3✅ Pass
qcs615-adp-airCDSPUnsigned3/3✅ Pass
qcs615-rideADSPSigned3/3✅ Pass
qcs615-rideCDSPSigned3/3✅ Pass
qcs615-rideCDSPUnsigned3/3✅ Pass
qcs6490-rb3gen2ADSPSigned3/3✅ Pass
qcs6490-rb3gen2CDSPSigned3/3✅ Pass
qcs6490-rb3gen2CDSPUnsigned3/3✅ Pass
qcs8300-rideADSPSigned3/3✅ Pass
qcs8300-rideCDSPSigned3/3✅ Pass
qcs8300-rideCDSPUnsigned3/3✅ Pass
qcs8300-rideGDSP0Signed3/3✅ Pass
qcs8300-rideGDSP0Unsigned3/3✅ Pass
qcs9100-ride-r3ADSPSigned3/3✅ Pass
qcs9100-ride-r3CDSPSigned3/3✅ Pass
qcs9100-ride-r3CDSPUnsigned3/3✅ Pass
qcs9100-ride-r3CDSP1Signed3/3✅ Pass
qcs9100-ride-r3CDSP1Unsigned3/3✅ Pass
qcs9100-ride-r3GDSP0Signed3/3✅ Pass
qcs9100-ride-r3GDSP0Unsigned3/3✅ Pass
qcs9100-ride-r3GDSP1Signed3/3✅ Pass
qcs9100-ride-r3GDSP1Unsigned3/3✅ Pass
shikra-evkCDSPSigned3/3✅ Pass
shikra-evkCDSPUnsigned3/3✅ Pass
sm8750-mtpADSPSigned3/3✅ Pass
sm8750-mtpCDSPSigned3/3✅ Pass
sm8750-mtpCDSPUnsigned3/3✅ Pass

LAVA Jobs:

@ekanshibu
Ekansh Gupta (ekanshibu) merged commit 5c0a10d into qualcomm:development Nov 25, 2026
22 of 24 checks passed
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.

8 participants