]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: Guard against malformed bucket URLs 47025/head
authorAdam C. Emerson <aemerson@redhat.com>
Fri, 8 Jul 2022 18:58:16 +0000 (14:58 -0400)
committerAdam C. Emerson <aemerson@redhat.com>
Fri, 15 Jul 2022 20:32:09 +0000 (16:32 -0400)
Misplaced colons can result in radosgw thinking is has a bucket URL
but with no bucket name, leading to a crash later on.

Fixes: https://tracker.ceph.com/issues/55765
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
src/rgw/rgw_common.cc

index 96eded1f56a93ab0cba8628ce5f8508b3e564d01..54869a0d7cf057d3078436b8e41fa1bb771fb191 100644 (file)
@@ -1349,6 +1349,11 @@ bool verify_bucket_permission_no_policy(const DoutPrefixProvider* dpp, req_state
 
 bool verify_bucket_permission(const DoutPrefixProvider* dpp, req_state * const s, const uint64_t op)
 {
+  if (rgw::sal::Bucket::empty(s->bucket)) {
+    // request is missing a bucket name
+    return false;
+  }
+
   perm_state_from_req_state ps(s);
 
   return verify_bucket_permission(dpp,