XGameSave: an unreadable legacy blob can be dropped during migration #242

Open
opened 2026-11-24 22:59:23 +00:00 by Bennet0k · 0 comments
Bennet0k commented 2026-11-24 22:59:23 +00:00 (Migrated from github.com)
Contributor

Imported from fxceless/victory-fork. Originally posted by Bennet0k on 2026-11-24T22:59:23Z.


Source

Reproduction. In a writable temporary legacy save directory, create two regular blobs with valid encoded names, Data and Header. Make Header unreadable to the test process and confirm that reading it returns PermissionDenied. Calling the migration code commits v1 with only Data and removes the old directory. This was reproduced by executing the migration helpers from 2119b0e with synthetic files on Linux. No retail save was used.

Proposed fix. Replace the lossy iterator chain with a loop that propagates directory-entry errors and read errors for recognized blob names before committing. Keep skipping unrelated names and preserve the optional display metadata behavior. Leave the legacy directory intact on failure so a later call can retry. With this change in the standalone Rust harness, the failed attempt leaves both files in place, and restoring read permission migrates both blobs on retry.

Found in an AI-assisted audit of 2119b0e.

<!-- greyfinch-sync:fxceless/victory-fork:issue:6593117625 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/issues/242). Originally posted by [Bennet0k](https://github.com/Bennet0k) on 2026-11-24T22:59:23Z. --- [Source](https://github.com/fxceless/victory-fork/blob/2119b0e44c53aa9648307b0c5c73590290305b1f/crates/victory-hle/src/modules/xgamesave.rs#L300-L322) **Reproduction.** In a writable temporary legacy save directory, create two regular blobs with valid encoded names, `Data` and `Header`. Make `Header` unreadable to the test process and confirm that reading it returns `PermissionDenied`. Calling the migration code commits v1 with only `Data` and removes the old directory. This was reproduced by executing the migration helpers from `2119b0e` with synthetic files on Linux. No retail save was used. **Proposed fix.** Replace the lossy iterator chain with a loop that propagates directory-entry errors and read errors for recognized blob names before committing. Keep skipping unrelated names and preserve the optional display metadata behavior. Leave the legacy directory intact on failure so a later call can retry. With this change in the standalone Rust harness, the failed attempt leaves both files in place, and restoring read permission migrates both blobs on retry. Found in an AI-assisted audit of `2119b0e`.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
fxceless/victory-fork#242
No description provided.