Additional sanity checks for QNX + CAAM resource manager - #11263
Open
JacobBarthelmeh wants to merge 2 commits into
Open
Additional sanity checks for QNX + CAAM resource manager#11263JacobBarthelmeh wants to merge 2 commits into
JacobBarthelmeh wants to merge 2 commits into
Conversation
JacobBarthelmeh
requested review from
wolfSSL-Fenrir-bot
and
a lite review from Copilot
August 25, 2026 16:44
Contributor
There was a problem hiding this comment.
Pull request overview
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Adds defensive validation around untrusted client-provided sizes/flags for CAAM QNX resmgr operations and makes the device node permissions configurable.
Changes:
- Introduces
WOLFSSL_CAAM_QNX_MAX_SZandWOLFSSL_CAAM_QNX_DEV_MODEconfiguration macros. - Adds size sanity checks and safer aggregate-size arithmetic in CMAC and AES paths.
- Tightens read-length validation to avoid partially-initialized buffers being used.
Suppressed comments (1)
wolfcrypt/src/port/caam/caam_qnx.c:428
- When
resmgr_msgreadv()fails (ret < 0), returningEOVERFLOWconflates an I/O error with a short-read/undersized message, and hides the underlying failure mode. Handleret < 0separately (e.g., returnECANCELEDor the appropriate errno from the resmgr layer), and reserveEOVERFLOW(orEBADMSG) for theret < expSzshort-read case.
expSz = msgSz + keySz + (int)sizeof(ctx);
ret = resmgr_msgreadv(ctp, in_iovs, numBuf, idx);
if (ret < 0 || ret < expSz) {
/* sanity check that the read worked and enough data was sent */
if (buf != NULL)
CAAM_ADR_UNMAP(buf, 0, msgSz, 0);
return EOVERFLOW;
}
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Can one of the admins verify this patch? |
Contributor
Author
|
Retest this please Jenkins |
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.
For internal reports f-11224 and f-8236