]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/crypt: don't deref null manifest_bl 53448/head
authorCasey Bodley <cbodley@redhat.com>
Wed, 13 Sep 2023 20:30:03 +0000 (16:30 -0400)
committerCasey Bodley <cbodley@redhat.com>
Tue, 19 Sep 2023 18:59:19 +0000 (14:59 -0400)
with dbstore, the manifest_bl pointer was null; check for null before
dereferencing for read_manifest_parts()

Fixes: https://tracker.ceph.com/issues/62378
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_rest_s3.cc

index 76876faeaea26cc34fa48cf68f2d572ffec32254..edab12ec4275b71a8ba9f95c7a46b467ab26b1b9 100644 (file)
@@ -589,7 +589,7 @@ send_data:
 
 int RGWGetObj_ObjStore_S3::get_decrypt_filter(std::unique_ptr<RGWGetObj_Filter> *filter, RGWGetObj_Filter* cb, bufferlist* manifest_bl)
 {
-  if (skip_decrypt || !manifest_bl) { // bypass decryption for multisite sync requests
+  if (skip_decrypt) { // bypass decryption for multisite sync requests
     return 0;
   }
 
@@ -616,7 +616,7 @@ int RGWGetObj_ObjStore_S3::get_decrypt_filter(std::unique_ptr<RGWGetObj_Filter>
       ldpp_dout(this, 1) << "failed to decode RGW_ATTR_CRYPT_PARTS" << dendl;
       return -EIO;
     }
-  } else {
+  } else if (manifest_bl) {
     // otherwise, we read the part lengths from the manifest
     res = RGWGetObj_BlockDecrypt::read_manifest_parts(this, *manifest_bl,
                                                       parts_len);
@@ -2789,7 +2789,7 @@ int RGWPutObj_ObjStore_S3::get_decrypt_filter(
       ldpp_dout(this, 1) << "failed to decode RGW_ATTR_CRYPT_PARTS" << dendl;
       return -EIO;
     }
-  } else {
+  } else if (manifest_bl) {
     // otherwise, we read the part lengths from the manifest
     res = RGWGetObj_BlockDecrypt::read_manifest_parts(this, *manifest_bl,
                                                       parts_len);