Skip to content

Additional sanity checks for QNX + CAAM resource manager - #11263

Open
JacobBarthelmeh wants to merge 2 commits into
wolfSSL:masterfrom
JacobBarthelmeh:qnx
Open

Additional sanity checks for QNX + CAAM resource manager#11263
JacobBarthelmeh wants to merge 2 commits into
wolfSSL:masterfrom
JacobBarthelmeh:qnx

Conversation

@JacobBarthelmeh

Copy link
Copy Markdown
Contributor

For internal reports f-11224 and f-8236

@JacobBarthelmeh JacobBarthelmeh self-assigned this Aug 25, 2026
@JacobBarthelmeh
JacobBarthelmeh requested review from wolfSSL-Fenrir-bot and a lite review from Copilot August 25, 2026 16:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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_SZ and WOLFSSL_CAAM_QNX_DEV_MODE configuration 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), returning EOVERFLOW conflates an I/O error with a short-read/undersized message, and hides the underlying failure mode. Handle ret < 0 separately (e.g., return ECANCELED or the appropriate errno from the resmgr layer), and reserve EOVERFLOW (or EBADMSG) for the ret < expSz short-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.

Comment thread wolfcrypt/src/port/caam/caam_qnx.c
Comment thread wolfcrypt/src/port/caam/caam_qnx.c Outdated
Comment thread wolfcrypt/src/port/caam/caam_qnx.c
@wolfSSL-Bot

Copy link
Copy Markdown

Can one of the admins verify this patch?

@JacobBarthelmeh

Copy link
Copy Markdown
Contributor Author

Retest this please Jenkins Opps not found

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