Skip to content

umbrella: rgw: fix AES-256-GCM key/IV reuse on multipart part re-upload - #69683

Merged
neha-ojha merged 2 commits into
ceph:umbrellafrom
mheler:wip-77614-umbrella
Jun 30, 2026
Merged

neha-ojha merged 2 commits into
ceph:umbrellafrom
mheler:wip-77614-umbrella

Conversation

@mheler

@mheler mheler commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

mheler added 2 commits June 23, 2026 12:11
Re-uploading the same part number in a GCM multipart upload encrypted the new
data under the same key and IV as the first upload, since the IV is
part_number||chunk_index and the part key came from the part number alone. GCM
requires a unique IV per key; reusing one to encrypt different data weakens its
confidentiality and integrity guarantees.

Generate a random 16-byte salt on each UploadPart and fold it into the part key,
HMAC(ObjectKey, BE32(part) || salt), so every upload gets a fresh key. The salt
rides RGWUploadPartInfo, and complete stores the selected part's salt in
RGW_ATTR_CRYPT_PART_NUMS, which now holds (part, salt) pairs. GET reads it back
to re-derive the key, and an empty salt reproduces the old derivation so unsalted
parts still decrypt.

Signed-off-by: Matthew N. Heler <[email protected]>
(cherry picked from commit 57e0250)
a8ed43b replaced ct_memeq with memcmp in the ISA-L GCM accelerator,
making tag verification and the key-cache compare non-constant-time.
Restore ct_memeq for both; the OpenSSL and EVP paths already compare in
constant time.

Signed-off-by: Matthew N. Heler <[email protected]>
(cherry picked from commit 3a81a12)
@mheler
mheler requested a review from a team as a code owner June 23, 2026 17:11
@mheler mheler added this to the umbrella milestone Jun 23, 2026
@mheler mheler added the rgw label Jun 23, 2026
@github-actions github-actions Bot added tests releng-audit-pass Release engineering: passed backport verification audit. labels Jun 23, 2026
@yuriw

yuriw commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

This PR has been added to wip-yuri8-testing-20260623.192704-umbrella.

@yuriw

yuriw commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

This PR has been added to wip-yuri13-testing-20260624.215042-umbrella.

@adamemerson

Copy link
Copy Markdown
Contributor

jenkins test make check

@neha-ojha

Copy link
Copy Markdown
Member

jenkins test make check

@neha-ojha
neha-ojha merged commit cc2d6b7 into ceph:umbrella Jun 30, 2026
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

releng-audit-pass Release engineering: passed backport verification audit. rgw tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants