Repository navigation
Conversation
A self-copy uses it to read the source data and find the master key that decrypts it; the code is the same as on 9.4.
…rites it Until CLDSRV-910, a self-copy to another master key changed only the metadata and left the data encrypted under the old one; a self-copy that rewrites such data decrypts it with the wrong key and replaces the content with wrong bytes.
Contributor
Hello dvasilas,My role is to assist you with the merge of this Available options
Available commands
Status report is not available. |
Contributor
Incorrect fix versionThe
Considering where you are trying to merge, I ignored possible hotfix versions and I expected to find:
Please check the |
leif-scality
self-requested a review
November 5, 2026 22:53
This branch has not been deployed
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.
TLDR
#6346 fixed CLDSRV-910. But after the fix, a self-copy can corrupt objects already damaged by CLDSRV-910, with no way to recover them.
With this PR, a self-copy that cannot correctly decrypt the data fails with
InternalError.The original bug (CLDSRV-910)
Using a self-copy to re-encrypt an object under another master key changed only the master key in the object metadata and did not rewrite the data, which stayed encrypted under the old master key.
Reading such an object returned wrong content or an error.
The object could be repaired by a self-copy back to the old master key.
Problem
Since the CLDSRV-910 fix, a self-copy rewrites the data.
Here is what happens if a self-copy with another master key is done to an object damaged by CLDSRV-910.
The self-copy:
The object can no longer be repaired.
This affects only objects damaged by CLDSRV-910.
Self-copy for objects not affected by CLDSRV-910 works as expected.
Fix
With this PR, a self-copy tries to decrypt one part of the data with 3 master keys: the master key in the object metadata, the master key recorded on the locations, and the destination master key.
It compares the MD5 of the decrypted part with the MD5 recorded for that part.
The copy reads the data with the first key that matches. If no key matches, the copy fails with
InternalErrorand nothing is written.For example, the data is encrypted under
K1and the metadata namesK2.K2doesn't match;K1does:When the new check runs
This check runs only when
This covers any object updated by a self-copy that didn't rewrite the data (this includes objects damaged by CLDSRV-910)
Other objects are rewritten as before, without the extra read.
Notes
InternalError.x-amz-metadata-directive: REPLACEwithx-amz-meta-scal-location-constraint). That copy always rewrites the data, so it replaced damaged objects with the wrong content before CLDSRV-910 too.