Skip to content

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.

@dotnet-policy-service
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.

@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
@github-actions
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

@github-actions
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