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

Skip to content

[release/8.0-staging] Back port logical equivalent of #102838 #113230

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 2 commits into from
Mar 10, 2025

Conversation

vcsjones
Copy link
Member

@vcsjones vcsjones commented Mar 6, 2025

This is a logical back port of #102838. The store providers went through a significant refactoring in .NET 9, so the changes would not back port cleanly to .NET 8.

/cc @bartonjs

Customer Impact

Reported by a customer in #113227 asking to apply the same fix in #102838. When the OpenSSL system and directory stores needed to be refreshed, a lock is taken. However, when the thread acquired the lock, the information about needing to refresh the store is stored in a local. This would lead to all threads that wait on the lock performing a store refresh because the locals were not updated after the lock was acquired.

The fix is to re-assign the locals with up-to-date information after the lock is taken.

Regression

No.

Testing

Existing tests ensure no functional changes are introduced.

Risk

Low. A similar fix was made for .NET 9. The change is isolated and simple to reason about.

@Copilot Copilot AI review requested due to automatic review settings March 6, 2025 20:12
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Overview

This PR backports a logical fix from .NET 9 to .NET 8 to ensure that store refreshes occur only when needed by reassigning local state after acquiring the lock.

  • In OpenSslCachedSystemStoreProvider.cs, the locals ret and elapsed are assigned immediately after acquiring the lock.
  • In OpenSslCachedDirectoryStoreProvider.cs, similar assignments ensure that the native collection and elapsed time reflect the most up-to-date information.

Reviewed Changes

File Description
OpenSslCachedSystemStoreProvider.cs Assigning s_nativeCollections and s_recheckStopwatch.Elapsed to local variables to avoid stale data during refresh logic.
OpenSslCachedDirectoryStoreProvider.cs Updates are applied to ensure that the store's native collection state and elapsed time are captured inside the lock.

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

Tip: If you use Visual Studio Code, you can request a review from Copilot before you push from the "Source Control" tab. Learn more

@vcsjones vcsjones added this to the 8.0.x milestone Mar 6, 2025
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 bartonjs added the Servicing-consider Issue for next servicing release review label Mar 6, 2025
@carlossanlop
Copy link
Member

@vcsjones @bartonjs Today is code complete for the April Release. If you want this fix included in this release, please get it approved by Tactics and merge it before 4pm PT.

@bartonjs bartonjs added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Mar 10, 2025
@bartonjs
Copy link
Member

/ba-g Failures were infrastructure, and not even on configurations that run this code.

@bartonjs bartonjs merged commit 165b4c9 into release/8.0-staging Mar 10, 2025
113 of 120 checks passed
@bartonjs bartonjs deleted the backport-102838 branch March 10, 2025 21:39
@leecow leecow modified the milestones: 8.0.x, 8.0.15 Mar 19, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Apr 19, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Security Servicing-approved Approved for servicing release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants