Skip to content

Conversation

@gilles-peskine-arm
Copy link
Contributor

@gilles-peskine-arm gilles-peskine-arm commented Oct 3, 2025

In the PSA compliance tests, patch a memory error in psa-arch-tests that causes it to crash on environments such as our CI. This has been happening since #453; I realized the problem just after it was merged.

I have a patch to fix the fact that out script doesn't detect the crash, but before we can merge it in the framework, we need to fix crypto so that it doesn't crash. In the meantime, we can check visually that psa-arch-tests ran until the end: in the log, the output ends with “Crypto suite report” with pass/fail/skip counts and Entering standby.. .

To keep the patching minimal, I only fix one set of memory errors. There are other errors that cause crashes in JPAKE tests, and more that don't cause a crash on our CI environment or my machine. I will upstream my fixes (at least some of them are not patched upstream), but in the meantime, we'll have to live with patches.

Since JPAKE is crashing and is currently not compliant anyway, disable it for now. We'll reenable it later, when we start fixing the JPAKE compliance issues.

Needs preceding PR: for a bug fix when there are expected failures.

PR checklist

Without this patch, psa-arch-tests crashes on some platforms including our
CI environment because libc detects a buffer overflow on the stack.

This bug does not seem to be fixed upstream yet, so I will submit a fix. In
the meantime, we'll need to carry the patch here.

Signed-off-by: Gilles Peskine <[email protected]>
We don't implement `psa_key_derivation_verify_bytes()` and
`psa_key_derivation_verify_key()` yet (the functions exist but they always
return `PSA_ERROR_NOT_SUPPORTED`). Therefore, expect the tests for these
functions to fail.

These failures were previously undetected because psa-arch-tests was
crashing due to a stack buffer overflow in AEAD tests.

Signed-off-by: Gilles Peskine <[email protected]>
Partial backport of 232fb5801273dbc97789cb9079f1168499e34a2a,
first released in v25.08_API1.9_ADAC_1.0.2 .

Signed-off-by: Gilles Peskine <[email protected]>
There are memory errors in some PAKE tests that make psa-arch-tests crash.
I am preparing patches for them, but until then, disable PAKE.

Signed-off-by: Gilles Peskine <[email protected]>
@gilles-peskine-arm gilles-peskine-arm added priority-high High priority - will be reviewed soon size-xs Estimated task size: extra small (a few hours at most) labels Oct 3, 2025
@gilles-peskine-arm gilles-peskine-arm added needs-review Every commit must be reviewed by at least two team members needs-reviewer This PR needs someone to pick it up for review labels Oct 4, 2025
@gilles-peskine-arm gilles-peskine-arm added the needs-preceding-pr Requires another PR to be merged first label Oct 4, 2025
Copy link
Contributor

@mpg mpg left a comment

Choose a reason for hiding this comment

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

LGTM except for an issue in a docstring.

@gilles-peskine-arm gilles-peskine-arm requested a review from mpg October 6, 2025 10:07
Copy link
Contributor

@mpg mpg left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-preceding-pr Requires another PR to be merged first needs-review Every commit must be reviewed by at least two team members needs-reviewer This PR needs someone to pick it up for review priority-high High priority - will be reviewed soon size-xs Estimated task size: extra small (a few hours at most)

Projects

Development

Successfully merging this pull request may close these issues.

test_psa_compliance.py doesn't detect if psa-arch-tests crashes

2 participants