-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Crash in test suite x509write config full no seedfile #6109
Crash in test suite x509write config full no seedfile #6109
Conversation
4c68188
to
e607a74
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for figuring out the underlying problem!
Aw, this now has a conflict and will need to be rebased when you come back. |
Note: I think this should be backported to 2.28, but does not deserve a ChangeLog entry, as the bug is only in test code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Problem does exist.
This PR fixes it. 👍
This one needs to be rebased. |
…s_x509write_csr_free() will crash if uninitialized When USE_PSA_INIT() failed because lack of seedfile, mbedtls_x509write_csr_free() crashed when called on an unitialized mbedtls_x509write_csr struct. This moves mbedtls_x509write_csr_init before calling USE_PSA_INIT(), which could probably fail, and uses the same flow in x509_csr_check() and x509_csr_check_opaque(). Signed-off-by: Neil Armstrong <[email protected]>
e607a74
to
a97f1ac
Compare
Rebased on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
@superna9999 Please create a backport to 2.28 so that we can merge this. |
Description
Steps to reproduce:
Observed behaviour: the first few tests fail, then eventually there's a bus error and a core dump is produced. If we just add the seedfile again (
dd if=/dev/urandom of=./tests/seedfile bs=64 count=1
) everything passes and there is no crash.Cause:
When USE_PSA_INIT() failed because lack of seedfile,
mbedtls_x509write_csr_free()
crashed when called on an unitialized
mbedtls_x509write_csr
struct.This moves
mbedtls_x509write_csr_init
before calling USE_PSA_INIT(),which could probably fail, and use the same flow in
x509_csr_check()
and
x509_csr_check_opaque()
.Resolves #6100
Gatekeeping note: I (mpg) think this should be backported to 2.28, but does not deserve a ChangeLog entry, as the bug is only in test code.
Status
READY
Requires Backporting
Yes 2.28 #6246
Migrations
NO
Additional comments
N/A
Todos
Steps to test or reproduce
test_suite_x509write must not crash without a seedfile