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 panic when unlocking unlocked user #23611

Merged
merged 2 commits into from
Oct 11, 2023

Conversation

davidadeleon
Copy link
Contributor

This PR fixes a panic when attempting to unlock an already unlocked user.

Example Panic:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x380c80a]

goroutine 147274 [running]:
github.com/hashicorp/vault/vault.unlockUser({0xa434c80, 0xc00fa6aeb0}, 0xc00ef26900, {0xc00e8cfb11, 0x16}, {0xc00e8cfb2f, 0x6})
	/home/runner/actions-runner/_work/vault-enterprise/vault-enterprise/vault/logical_system_user_lockout.go:61 +0x28a
github.com/hashicorp/vault/vault.(*SystemBackend).handleUnlockUser(0xc005b7e740, {0xa434c80, 0xc00fa6aeb0}, 0x0?, 0xffffffffffffffff?)
	/home/runner/actions-runner/_work/vault-enterprise/vault-enterprise/vault/logical_system.go:2492 +0x27b
github.com/hashicorp/vault/sdk/framework.(*Backend).HandleRequest(0xc011fbd770, {0xa434c80, 0xc00fa6aeb0}, 0xc023034fc0)
	/home/runner/actions-runner/_work/vault-enterprise/vault-enterprise/sdk/framework/backend.go:310 +0xa88

@davidadeleon davidadeleon requested a review from a team October 11, 2023 16:31
@github-actions github-actions bot added the hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed label Oct 11, 2023
Copy link
Contributor

@victorr victorr left a comment

Choose a reason for hiding this comment

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

👍

Copy link
Contributor

@raskchanky raskchanky left a comment

Choose a reason for hiding this comment

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

@raskchanky
Copy link
Contributor

Probably worth adding a changelog

@github-actions
Copy link

Build Results:
All builds succeeded! ✅

@davidadeleon davidadeleon merged commit 2f8e59c into main Oct 11, 2023
102 of 104 checks passed
@davidadeleon davidadeleon deleted the davidadeleon/fix-lockout-log-panic branch October 11, 2023 16:59
@github-actions
Copy link

CI Results:
All Go tests succeeded! ✅

marcboudreau pushed a commit that referenced this pull request Oct 11, 2023
…guration (#23547)

* CI: Pre-emptively delete logs dir after cache restore in test-collect-reports (#23600)

* Fix OktaNumberChallenge (#23565)

* remove arg

* changelog

* exclude changelog in verifying doc/ui PRs (#23601)

* Audit: eventlogger sink node reopen on SIGHUP (#23598)

* ensure nodes are asked to reload audit files on SIGHUP

* added changelog

* Capture errors emitted from all nodes during proccessing of audit pipelines (#23582)

* Update security-scan.yml

* Listeners: Redaction only for TCP (#23592)

* redaction should only work for TCP listeners, also fix bug that allowed custom response headers for unix listeners

* fix failing test

* updates from PR feedback

* fix panic when unlocking unlocked user (#23611)

* VAULT-18307: update rotation period for aws static roles on update (#23528)

* add disable_replication_status_endpoints tcp listener config parameter

* add wrapping handler for disabled replication status endpoints setting

* adapt disable_replication_status_endpoints configuration parsing code to refactored parsing code

* refactor configuration parsing code to facilitate testing

* fix a panic when parsing configuration

* update refactored configuration parsing code

* fix merge corruption

* add changelog file

* document new TCP listener configuration parameter

* make sure disable_replication_status_endpoints only has effect on TCP listeners

* use active voice for explanation of disable_replication_status_endpoints

* fix minor merge issue

---------

Co-authored-by: Kuba Wieczorek <kuba.wieczorek@hashicorp.com>
Co-authored-by: Angel Garbarino <Monkeychip@users.noreply.github.com>
Co-authored-by: Hamid Ghaf <83242695+hghaf099@users.noreply.github.com>
Co-authored-by: Peter Wilson <peter.wilson@hashicorp.com>
Co-authored-by: Mark Collao <106274486+mcollao-hc@users.noreply.github.com>
Co-authored-by: davidadeleon <56207066+davidadeleon@users.noreply.github.com>
Co-authored-by: kpcraig <3031348+kpcraig@users.noreply.github.com>
davidadeleon added a commit that referenced this pull request Oct 12, 2023
* Implement user lockout log (#23140)

* implement user lockout logger

* formatting

* make user lockout log interval configurable

* create func to get locked user count, and fix potential deadlock

* fix test

* fix test

* add changelog

* fix panic when unlocking unlocked user (#23611)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants