Skip to content
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

Fix unsafe access to perf standby status from systemview #17186

Merged
merged 4 commits into from Oct 5, 2022

Conversation

ncabatoff
Copy link
Collaborator

@ncabatoff ncabatoff commented Sep 19, 2022

Ensure that we don't try to access Core.perfStandby or Core.PerfStandby() from dynamicSystemView, which might be accessed with or without stateLock held.

…by() from dynamicSystemView, which might be accessed with or without stateLock held.
@ncabatoff ncabatoff changed the title Ensure that we don't try to access Core.perfStandby or Core.PerfStand… Fix unsafe access to perf standby status from systemview Sep 19, 2022
mountEntry: entry,
core: c,
mountEntry: entry,
perfStandby: c.perfStandby,
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the enclosing function here called with whatever lock is appropriate to access c.perfStandby?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes. During a mount request, it's a request, so we hold the read stateLock as with most regular requests. During a post-unseal setupMounts, the write stateLock is held.

@mpalmi mpalmi added core Issues and Pull-Requests specific to Vault Core core/replication labels Sep 19, 2022
@ncabatoff ncabatoff merged commit 53d45c6 into main Oct 5, 2022
@ncabatoff ncabatoff deleted the avoid-racing-on-dynsystemview-perfstandby branch October 5, 2022 12:56
jayant07-yb pushed a commit to jayant07-yb/hashicorp-vault-integrations that referenced this pull request Mar 15, 2023
…7186)

Ensure that we don't try to access Core.perfStandby or Core.PerfStandby() from dynamicSystemView, which might be accessed with or without stateLock held.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core/replication core Issues and Pull-Requests specific to Vault Core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants