test: cover the DMA allow list upper boundary - #500
Open
sameehj wants to merge 1 commit into
Open
Conversation
An allow list entry covers the half-open range [addr, addr + size), so _checkAddrAgainstAllowList accepts a request when endAddr is less than or equal to allowListEndAddr. A request that fills an entry exactly is therefore legal. No test sent such a request. The basic test used a 0x1000 request against a 0x10000 entry, and the overflow tests stop at the earlier wrap guard. A change of <= to < at that comparison broke no test, but it would make the server reject every client that maps one full allowed region. Add two cases to the basic allow list test in both test suites. A request that fills the entry exactly must return WH_ERROR_OK. A request of one more byte must return WH_ERROR_ACCESS. The pair pins both sides of the upper bound. Signed-off-by: Sameeh Jubran <sameeh@wolfssl.com>
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #500
No scan targets match the changed files in this PR. Review skipped.
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.
Summary
_checkAddrAgainstAllowListaccepts a request whenendAddr <= allowListEndAddr(
src/wh_dma.c:82). An allow list entry covers the half-open range[addr, addr + size), so a request that fills an entry exactly is legal.No test sent such a request. The basic test used a 0x1000 request against a
0x10000 entry, and the overflow tests stop at the earlier wrap guard, so the
upper bound was never exercised. Changing
<=to<broke no test, yet itwould make the server reject every client that maps one full allowed region.
Adds two cases to the basic allow list test in both suites:
WH_ERROR_OKWH_ERROR_ACCESSThe pair fixes both sides of the bound. The first catches a tightened
comparison (
<=to<); the second catches a loosened one (+ 1), which theexisting out-of-range case at 0x30000 does not.
No production code changes. Both
test/andtest-refactor/are updatedbecause each runs in its own CI workflow and the migration compares their
coverage.