Repository navigation
Conversation
The conditional headers compare the object's ETag as a prefix of the header's value, with if_match_str.compare(0, etag.length(), etag), in check_preconditions for writes and deletes, and in the read path for GET, HEAD and a copy's source. So any value that starts with the ETag matches it: an If-Match of the ETag with more characters after it is accepted, and an If-None-Match refuses it. A list of entity tags matches only when the first is the object's, and a weak tag never matches. Add rgw_etag_matches(), which reads the header as RFC 7232 does: a comma-separated list of entity tags, each quoted or not, compared whole. If-Match compares strongly, so a weak tag (W/"...") does not match it; If-None-Match compares weakly. The caller still handles "*". Use it in the four places, and for the If-Match of a delete by version, which compared the unquoted value whole but did not take a list. Fixes: https://tracker.ceph.com/issues/80924 Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Kyle Bader <[email protected]>
|
This commit has been added to https://tracker.ceph.com/issues/81363 |
|
jenkins test make check |
|
jenkins test make check arm64 |
|
@cbodley ok to merge? |
|
as in #72101 (comment), this needs to run through qa for validation, which needs to include any test cases you added for it |
|
jenkins test api |
|
Confirmed on main (5ab2b0d) on vstart: The same prefix comparison is in the other SAL drivers, which this PR does not touch:
Would you like to cover them with the new helper here, or should they go to a follow-up? Probe script: https://gist.github.com/RaminNietzsche/818ad8dd6b8d8093560183cd09d2b169 (cases |
RFC 9110 RGW audit — series contextThis PR is one focused change from an RFC 9110 conformance review of RGW (S3, Swift, Admin, STS). Each PR is meant to review and merge on its own; there is no batch dependency unless called out below.
Same audit, already tracked on other PRs (not part of this series authorship):
Follow-ups from the audit not opened yet: T4d Shared repro script and sample output: https://gist.github.com/RaminNietzsche/818ad8dd6b8d8093560183cd09d2b169 ( Audit cross-link (T3): Whole-tag comparison for §13.1.1–13.1.2. From the same audit: precondition order for |
The conditional headers compare the object's ETag as a prefix of the header value (if_match_str.compare(0, etag.length(), etag)): in check_preconditions for writes and deletes, and in the read path for GET, HEAD and a copy's source. So any value that starts with the ETag matches it - an If-Match of the ETag with more characters after it is accepted, and an If-None-Match refuses it - a list of entity tags matches only when the first is the object's, and a weak tag never matches.
This adds rgw_etag_matches(), which reads the header as RFC 7232 does: a comma-separated list of entity tags, each quoted or not, compared whole; If-Match compares strongly, so W/"..." does not match it, and If-None-Match weakly. The callers still handle "*". It is used in the four places, and for the If-Match of a delete by version. unittest_rgw_etag covers it.
Related: https://tracker.ceph.com/issues/64439 (If-Match not unquoted).
Fixes: https://tracker.ceph.com/issues/80924
Validated on a single-host vstart cluster: test_put_object_if_match_etag_with_suffix (ceph/s3-tests#763) fails on main and passes with this change, unittest_rgw_etag passes, and test_s3.py as the rgw suite runs it shows no new failures.
Versioned buckets
Every conditional path for a version, and for a delete marker, compares entity tags through
rgw_etag_matches(). s3-teststest_versioned_if_match_whole_etagand_suspendedcheck GET, HEAD, PUT and DELETE with a version id. Other storage backends (d4n, posix, dbstore, motr) still compare by prefix.Checklist