Bug 2252336

Summary: rgw: object lock retainUntilDate can overflow (32bit seconds)
Product: [Red Hat Storage] Red Hat Ceph Storage Reporter: Matt Benjamin (redhat) <mbenjamin>
Component: RGWAssignee: Casey Bodley <cbodley>
Status: CLOSED ERRATA QA Contact: Madhavi Kasturi <mkasturi>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.1CC: cbodley, ceph-eng-bugs, cephqe-warriors, rmandyam, rpollack, tchandra, tserlin
Target Milestone: ---   
Target Release: 7.0z1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ceph-18.2.0-150.el9cp Doc Type: Bug Fix
Doc Text:
Previously, `PutObjectRetention` requests specifying a `RetainUntilDate` after the year 2106 would truncate, resulting in an earlier date used for object lock enforcement. This did not affect ` PutBucketObjectLockConfiguration` requests, where the duration is specified in days. With this fix, the `RetainUntilDate` now saves and works as expected for new `PutObjectRetention` requests. Requests previously existing are not automatically repaired. To fix existing requests, identify the requests by using the `HeadObject` request based on the `x-amz-object-lock-retain-until-date` and save again with the `RetainUntilDate`. For more information, see Ceph Object Gateway and the S3 API > S3 object operations > S3 put object retention, in the Red Hat Ceph Storage Developer Guide.
Story Points: ---
Clone Of:
: 2252337 (view as bug list) Environment:
Last Closed: 2024-03-07 11:40:28 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2252337, 2260311    

Description Matt Benjamin (redhat) 2023-11-30 22:12:21 UTC
a RetainUntilDate with year >= 2107 will parse correctly, but the binary encoding will truncate it to 32-bit seconds. s3 object lock is then enforced using the wrong date

use new round_trip_encode/decode() functions for the RetainUntilDate encoding to preserve these large values

because the bug was in encode(), this fix does not repair existing objects with the incorrect date

Fixes: https://tracker.ceph.com/issues/63537

Comment 1 RHEL Program Management 2023-11-30 22:12:32 UTC
Please specify the severity of this bug. Severity is defined here:
https://bugzilla.redhat.com/page.cgi?id=fields.html#bug_severity.

Comment 7 errata-xmlrpc 2024-03-07 11:40:28 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Red Hat Ceph Storage 7.0 bug fix update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2024:1214