Add missing locks in X509_check_issued#6161
Closed
richsalz wants to merge 1 commit intoopenssl:masterfrom
richsalz:gh6121
Closed
Add missing locks in X509_check_issued#6161richsalz wants to merge 1 commit intoopenssl:masterfrom richsalz:gh6121
richsalz wants to merge 1 commit intoopenssl:masterfrom
richsalz:gh6121
Conversation
Thanks to Mingtao Yang for reporting this bug.
mspncp
suggested changes
May 2, 2018
| CRYPTO_THREAD_unlock(issuer->lock); | ||
| CRYPTO_THREAD_write_lock(subject->lock); | ||
| x509v3_cache_extensions(subject); | ||
| CRYPTO_THREAD_unlock(subject->lock); |
Contributor
There was a problem hiding this comment.
If one looks at the other locations where x509v3_cache_extensions() is called, one sees that the EXFLAG_SET flag is used to ensure that the values are cached only once. So either the guards should be added here, too
if (!(issuer->ex_flags & EXFLAG_SET)) {
CRYPTO_THREAD_write_lock(issuer->lock);
x509v3_cache_extensions(issuer);
CRYPTO_THREAD_unlock(issuer->lock);
}
if (!(subject->ex_flags & EXFLAG_SET)) {
CRYPTO_THREAD_write_lock(subject->lock);
x509v3_cache_extensions(subject);
CRYPTO_THREAD_write_lock(subject->lock);
}
or even better the check could be moved entirely into x509v3_cache_extensions(). See upcoming pull request...
Contributor
|
See #6162. |
Contributor
Author
|
Closing this in favor of #6162 |
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.
Thanks to Mingtao Yang for reporting this bug.
Fixes #6121.
Not going to backport if it doesn't cherry-pick cleanly.