Repository navigation
Conversation
tmleman
requested review from
dbaluta,
kv2019i,
lbetlej,
lgirdwood,
mmaka1 and
plbossart
as code owners
October 8, 2026 10:09
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The guard prevents invalid indexing, preserves valid-manifest behavior, and uses existing error propagation.
0 open findings
What changed in this PR
Prevents out-of-bounds indexing in the loadable-library manager when a manifest contains no distinct module segments.
Changes:
- Rejects zero-module manifests with
-EINVALbefore accessing module storage. - Logs the rejected manifest’s entry count and documents the guard.
| File | Description |
|---|---|
src/library_manager/llext_manager.c |
Adds a guard against zero-module manifests. |
🧠 Review effort: Balanced
Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.
PR 11286: test resultsRun date: 2026-10-14 11:27 UTC Tested commit: aa2341659cced0d1ecf66eed6100d942b30c3ab3 |
softwarecki
approved these changes
Oct 12, 2026
softwarecki
left a comment
Collaborator
There was a problem hiding this comment.
I agree that inline comment is superfluous.
tmleman
force-pushed
the
topic/upstream/pr/llext/fix/reject_manifests_with_no_modules
branch
3 times, most recently
from
October 14, 2026 09:38
9607d0a to
aa23416
Compare
Treat zero modules as an invalid manifest. While SOF rmalloc() returns NULL for a zero-size allocation, causing the old code to return -ENOMEM, this validation returns the appropriate -EINVAL error before allocating and prevents later n_mod - 1 indexes from depending on allocator behavior. Found by clang-analyzer-security.ArrayBound. Assisted-by: Copilot:claude-opus-5 clang-tidy Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
lgirdwood
approved these changes
Oct 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The existing overflow check only rejects a module entry array that runs past the image, so a manifest describing zero distinct text segments passes it and leaves n_mod == 0. The subsequent ctx->mod[n_mod - 1].n_mod store then writes immediately before the allocation.
Bail out with -EINVAL once the modules have been counted and none were found.
Found by clang-analyzer-security.ArrayBound.
Assisted-by: Copilot:claude-opus-5 clang-tidy