Skip to content

Don't set security descriptor if the mutex is not owned/new - #120075

Merged
ericstj merged 1 commit into
dotnet:mainfrom
jozkee:mutex_sec
Sep 25, 2025
Merged

Don't set security descriptor if the mutex is not owned/new#120075
ericstj merged 1 commit into
dotnet:mainfrom
jozkee:mutex_sec

Conversation

@jozkee

@jozkee jozkee commented Sep 24, 2025

Copy link
Copy Markdown
Member

Fixes #116014.
Fixes #110454.

Copilot AI review requested due to automatic review settings September 24, 2025 23:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a mutex access control issue by only setting security permissions when the mutex is newly created. The change prevents unnecessary access control modifications on existing mutexes.

  • Only sets mutex access control when createdNew is true
  • Adds conditional check around the existing security configuration code
  • Maintains the same security model but applies it more selectively

@github-actions github-actions Bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Sep 24, 2025
@jozkee
jozkee requested a review from ericstj September 24, 2025 23:04
@jkotas jkotas added area-System.Diagnostics.EventLog and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Sep 24, 2025
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @dotnet/area-system-diagnostics-performancecounter
See info in area-owners.md if you want to be subscribed.

Comment thread src/libraries/Common/src/System/Diagnostics/NetFrameworkUtils.cs
@jozkee jozkee changed the title Don't set access control if the mutex is not initially owned Don't set security descriptor if the mutex is not owned/new Sep 25, 2025

@ericstj ericstj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

As discussed - you've done manual testing involving multiple users to ensure this is fixed. I imagine we cannot cover this easily in CI.

@ericstj
ericstj merged commit bf486c8 into dotnet:main Sep 25, 2025
96 checks passed
@ericstj

ericstj commented Sep 25, 2025

Copy link
Copy Markdown
Member

/backport to release/10.0

@github-actions

Copy link
Copy Markdown
Contributor

Started backporting to release/10.0: https://github.com/dotnet/runtime/actions/runs/18021213909

@jozkee
jozkee deleted the mutex_sec branch September 25, 2025 22:58
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 26, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

4 participants