]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
RGW - Don't move attrs before setting them 42320/head
authorDaniel Gryniewicz <dang@redhat.com>
Tue, 8 Jun 2021 16:59:56 +0000 (12:59 -0400)
committerCory Snyder <csnyder@iland.com>
Tue, 13 Jul 2021 19:51:34 +0000 (15:51 -0400)
Moving the attrs into s->bucket_attrs before setting them results in
setting empty attrs into the bucket.  This means that reading them back
later gets empty attrs, which can cause a segfault.

Signed-off-by: Daniel Gryniewicz <dang@redhat.com>
(cherry picked from commit 4d38154f5779b01ed93430ef7405417820214796)

Conflicts:
src/rgw/rgw_op.cc

src/rgw/rgw_op.cc

index 352d54e89116e792d6242f45c10a421b785cc2df..2ab4d6eefe9f6243f343db38d3a78faf8dff590b 100644 (file)
@@ -7375,9 +7375,6 @@ void RGWSetAttrs::execute(optional_yield y)
     rgw::sal::RGWAttrs a(attrs);
     op_ret = s->object->set_obj_attrs(this, s->obj_ctx, &a, nullptr, y);
   } else {
-    for (auto& iter : attrs) {
-      s->bucket_attrs[iter.first] = std::move(iter.second);
-    }
     op_ret = store->ctl()->bucket->set_bucket_instance_attrs(
       s->bucket->get_info(), attrs, &s->bucket->get_info().objv_tracker,
       s->yield, this);