Repository navigation
Conversation
Wrap a known key through PKCS11 with a shared output buffer. A concurrent normal-world thread checks whether the target key appears before wrapping finishes. Fail if plaintext key bytes are observed. Signed-off-by: Sungbae Yoo <sungbaey@nvidia.com>
Encrypt a known message with PKCS11 C_Encrypt while another thread observes its shared output. Fail if the PKCS#1 v1.5 encoded plaintext appears before RSA encryption finishes. Signed-off-by: Sungbae Yoo <sungbaey@nvidia.com>
Sign a known digest through the crypt test TA with shared output. A concurrent normal-world thread checks for the PKCS#1 v1.5 encoded digest before signing finishes. Signed-off-by: Sungbae Yoo <sungbaey@nvidia.com>
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.
A crypto operation may temporarily write intermediate data to an output buffer backed by REE shared memory. A concurrent normal-world thread can read it before the final result overwrites it.
This series adds three race tests:
pkcs11_1031wraps a known sensitive key with RSA-AES and watches the shared output for target-key bytes.pkcs11_1032encrypts known plaintext with RSA PKCS#1 v1.5 and watches for plaintext in the encoded output.regression_4025signs a known digest through the crypt test TA and watches for its RSASSA encoding.The first two tests cover the PKCS#11 and RSAES fixes in OP-TEE/optee_os#8284. The third guards the existing RSASSA fix in [14a6359a8](https://github.com/OP-TEE/optee_os/
commit/14a6359a8ce48ec8f9fd9e6af801bf97556f1727).
Each test starts an observer thread before one operation, reports the number of hits, and fails if it sees an intermediate value. Detection depends on thread scheduling, so a passing run does not prove that every race is absent.