Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix OpenSSL stores refreshing too frequently #102838

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

Merged
merged 1 commit into from
May 29, 2024

Conversation

vcsjones
Copy link
Member

Background: OpenSSL stores refresh themselves, either on-demand or periodically (assumed stale). The way it was written, a thread checks to see if the store needs to be refreshed. If it does, it takes a lock, and refreshes it.

If you have multiple threads waiting on the lock, then the lock is released, the next thread will proceed. However, the "does the store need to be refreshed?" information is stored in a local. So after a thread has acquired the lock, it appears that the store needs to be refreshed. So each thread that arrives at the lock patiently waits its turn, thinks the store needs to be refreshed, and refreshes it.

This refreshes the locals after the lock has been take to see if another thread updated the information after the thread got a hold of the lock.

Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-security, @bartonjs, @vcsjones
See info in area-owners.md if you want to be subscribed.

@vcsjones vcsjones merged commit 6c139df into dotnet:main May 29, 2024
83 checks passed
@vcsjones vcsjones deleted the fix-ossl-freshness branch May 29, 2024 21:51
@vcsjones vcsjones added this to the 9.0.0 milestone Jun 18, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Jul 19, 2024
@bartonjs
Copy link
Member

bartonjs commented Mar 6, 2025

/backport-to release/8.0-staging

@bartonjs
Copy link
Member

bartonjs commented Mar 6, 2025

/backport to release/8.0-staging

@github-actions github-actions bot unlocked this conversation Mar 6, 2025
Copy link
Contributor

github-actions bot commented Mar 6, 2025

Started backporting to release/8.0-staging: https://github.com/dotnet/runtime/actions/runs/13706777103

Copy link
Contributor

github-actions bot commented Mar 6, 2025

@bartonjs backporting to "release/8.0-staging" failed, the patch most likely resulted in conflicts:

$ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch

Applying: Fix OpenSSL store refreshing
Using index info to reconstruct a base tree...
M	src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X509Certificates/OpenSslCachedSystemStoreProvider.cs
Falling back to patching base and 3-way merge...
Auto-merging src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X509Certificates/OpenSslCachedSystemStoreProvider.cs
CONFLICT (content): Merge conflict in src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X509Certificates/OpenSslCachedSystemStoreProvider.cs
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0001 Fix OpenSSL store refreshing
Error: The process '/usr/bin/git' failed with exit code 128

Please backport manually!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 6, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants