Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PSA drivers: the setup entry point can receive an operation that isn't all zero #9975

Open
gilles-peskine-arm opened this issue Feb 12, 2025 · 1 comment
Assignees
Labels
bug component-psa PSA keystore/dispatch layer (storage, drivers, …) size-s Estimated task size: small (~2d)

Comments

@gilles-peskine-arm
Copy link
Contributor

According to the PSA crypto driver interface specification, in multipart operations, the driver's setup entry point should receive an operation object that is initialized to 0. As of Mbed TLS 2.28.9 and 3.6.2, there are several operations where this is not always the case:

  • When the operation object is reused after finishing or aborting another operation. The core may leave whatever content was left there by the driver's finish/abort entry point.
  • With compilers that do not initialize all the members of a union to zero when doing union myunion x = {0} or the like. Such compilers also break the built-in implementation, and this case is tracked separately at HMAC-SHA-256 test failures on upcoming gcc-15 (after partial union initialization changes) #9814.

Workaround: if your driver needs to work with Mbed TLS versions where this issue is present, make sure that the setup entry point does not make any assumption on the content of the operation on entry.

@gilles-peskine-arm gilles-peskine-arm added bug component-psa PSA keystore/dispatch layer (storage, drivers, …) size-s Estimated task size: small (~2d) labels Feb 12, 2025
@gilles-peskine-arm gilles-peskine-arm self-assigned this Feb 12, 2025
@gilles-peskine-arm
Copy link
Contributor Author

I'm fixing this at the same time as #9814, since non-regression tests for 9814 trip on this bug as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug component-psa PSA keystore/dispatch layer (storage, drivers, …) size-s Estimated task size: small (~2d)
Projects
None yet
Development

No branches or pull requests

1 participant