-
Notifications
You must be signed in to change notification settings - Fork 27
Fix union initialization in PSA operations for GCC 15 (test helpers) #135
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
Closed
gilles-peskine-arm
wants to merge
7
commits into
Mbed-TLS:main
from
gilles-peskine-arm:union-initialization-gcc15-framework
Closed
Fix union initialization in PSA operations for GCC 15 (test helpers) #135
gilles-peskine-arm
wants to merge
7
commits into
Mbed-TLS:main
from
gilles-peskine-arm:union-initialization-gcc15-framework
Conversation
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
This was referenced Feb 5, 2025
For each multipart or interruptible operation, define an initializer function that simulates the minimum that `my_op_t op = {0}` guarantees in C. That is, initialize most fields to 0, but set the fields that are unions to a nonzero value. This simulates platforms where initializing a union to `{0}` only initializes the first member, and thus reading from another member can yield a nonzero value. In our operation structures, the union's first member is an unused `dummy`, and the other members are driver-specific, so we just make the whole union nonzero and this has to be good enough for the setup functions in the core to cope. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This fixes -Wmissing-field-initializers complaints from Clang <=3.x. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Fix the build against development. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
In every existing test driver entry point that is the setup for a multipart operation, check that the driver operation structure is all-bits-zero on entry, as guaranteed by the driver specification. There is a risk that this isn't the case, mostly, on platforms where initializing a union to `{0}` initializes only the default member and not all members. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
bd33fb4
to
680e1b0
Compare
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
3 tasks
5 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
needs-ci
Needs to pass CI tests
needs-preceding-pr
Requires another PR to be merged first
priority-high
High priority - will be reviewed soon
size-s
Estimated task size: small (~2d)
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.
Test helpers and additional checks for the fix to Mbed-TLS/mbedtls#9814.
Continues #136. Will not pass the CI without some bug fixes from Mbed-TLS/mbedtls#9955.
PR checklist