Skip to content

test: cover the DMA allow list upper boundary - #500

Open
sameehj wants to merge 1 commit into
wolfSSL:mainfrom
sameehj:test/dma-allowlist-upper-boundary
Open

test: cover the DMA allow list upper boundary#500
sameehj wants to merge 1 commit into
wolfSSL:mainfrom
sameehj:test/dma-allowlist-upper-boundary

Conversation

@sameehj

@sameehj sameehj commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

_checkAddrAgainstAllowList accepts a request when endAddr <= 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 it
would make the server reject every client that maps one full allowed region.

Adds two cases to the basic allow list test in both 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 fixes both sides of the bound. The first catches a tightened
comparison (<= to <); the second catches a loosened one (+ 1), which the
existing out-of-range case at 0x30000 does not.

No production code changes. Both test/ and test-refactor/ are updated
because each runs in its own CI workflow and the migration compares their
coverage.

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 wolfSSL-Fenrir-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fenrir Automated Review — PR #500

No scan targets match the changed files in this PR. Review skipped.

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.

3 participants