fix(accounts): Prevent stale slot reuse during account creation#162
Draft
nvlitagaki wants to merge 2 commits into
Draft
fix(accounts): Prevent stale slot reuse during account creation#162nvlitagaki wants to merge 2 commits into
nvlitagaki wants to merge 2 commits into
Conversation
Signed-off-by: Leah Itagaki <litagaki@nvidia.com>
yoks
reviewed
Jul 16, 2026
yoks
reviewed
Jul 16, 2026
Signed-off-by: Leah Itagaki <litagaki@nvidia.com>
Contributor
|
@nvlitagaki PR open as a draft, do you expect to work on it or is it finished? |
Author
|
This is staying in draft until I can get real hardware to verify on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
If-Match: *for slot creation.Why
Concurrent creators could select the same disabled slot from the collection snapshot. If the snapshot did not carry an ETag, the second update became unconditional and could overwrite the first account's credentials.
The fresh read plus conditional update closes that race: a slot already claimed is skipped, while concurrent updates against the same fresh ETag let the BMC reject the stale writer.
Validation
create_account_slot_defined_rechecks_stale_candidatefailed because the code issued an update for slot 3 before the expected fresh GET.cargo test -p nv-redfish-tests --test tests-account-service(15 passed)cargo test -p nv-redfish-tests --tests(all integration and trybuild targets passed)cargo test -p nv-redfish --features accountscargo test -p nv-redfish-bmc-http --test reqwest_client_tests --features reqwest test_patch_update_requestcargo fmt --all -- --checkcargo clippy -p nv-redfish --features accounts -- -D warningscargo clippy -p nv-redfish-tests --test tests-account-service -- -D warningsThe checks ran with Rust 1.90.0 in a Linux arm64 container. A physical Dell BMC was not available, so this remains a draft pending maintainer review or hardware-backed verification.
Resolves #141