From 04d9ea6dafb9ab0d71888b5ac9b1317c111e41ec Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Wed, 13 Sep 2023 16:30:03 -0400 Subject: [PATCH] rgw/crypt: don't deref null manifest_bl 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 --- src/rgw/rgw_rest_s3.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc index 76876faeaea26..edab12ec4275b 100644 --- a/src/rgw/rgw_rest_s3.cc +++ b/src/rgw/rgw_rest_s3.cc @@ -589,7 +589,7 @@ send_data: int RGWGetObj_ObjStore_S3::get_decrypt_filter(std::unique_ptr *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 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); -- 2.39.5