Repository navigation
Harden untrusted input remoteproc pt2 - #704
Merged
arnopo merged 2 commits intoOct 19, 2026
Merged
Conversation
arnopo
approved these changes
Sep 21, 2026
arnopo
left a comment
Collaborator
There was a problem hiding this comment.
Same remark concerning AI verbosity but code LGTM
bentheredonethat
force-pushed
the
Harden-untrusted-input-remoteproc-pt2
branch
from
September 21, 2026 14:20
358c7fe to
c622bc0
Compare
Collaborator
|
@bentheredonethat please rebase to resolve conflict |
The vring alignment comes from the resource table, which the peer core can write. The existing checks only reject a zero alignment, so any other value is stored and forwarded. vring_init() rounds the used ring address with a ~(align - 1) mask, which clears only low order bits when the alignment is a power of two. A value such as 0x80000001 makes the mask clear high order bits of the address instead, placing the used ring outside the vring memory. Require a power of two alignment before computing the vring size and before storing the vring metadata. Check the alignment in the virtqueue constructor as well, where it sizes the region cleared for the driver role. Signed-off-by: Ben Levinsky <ben.levinsky@amd.com> Assisted-by: Codex:GPT-5
The peer resource table can supply a power of two alignment such as 0x80000000. This passes alignment validation but cannot be represented by the signed int used in vring_size(). Converting the truncated result to size_t can request an enormous mapping before metadata validation. Calculate the size with bounded size_t arithmetic and reject descriptor counts, rounding expressions and final sizes that vring_size() cannot represent. Apply the check before mapping, storing vring metadata and clearing the driver ring memory. Signed-off-by: Ben Levinsky <ben.levinsky@amd.com> Assisted-by: Codex:GPT-6
bentheredonethat
force-pushed
the
Harden-untrusted-input-remoteproc-pt2
branch
from
October 5, 2026 22:24
3bde3a1 to
e389bf7
Compare
tnmysh
approved these changes
Oct 16, 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.
note first 4 commits are acked on prev PR #703 top commit is new