From 7e961d3ebd6cc39b38691bf6b4b7074db175c37b Mon Sep 17 00:00:00 2001 From: wangyunqing Date: Mon, 23 Nov 2020 11:19:55 +0800 Subject: [PATCH] rgw : check the object size when copy obj Fixes: https://tracker.ceph.com/issues/48322 Signed-off-by: wangyunqing --- src/rgw/rgw_op.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index 64f4fc0e6403..def5c1dba1ff 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -5414,6 +5414,10 @@ void RGWCopyObj::execute(optional_yield y) obj_size = astate->size; if (!s->system_request) { // no quota enforcement for system requests + if (astate->accounted_size > static_cast(s->cct->_conf->rgw_max_put_size)) { + op_ret = -ERR_TOO_LARGE; + return; + } // enforce quota against the destination bucket owner op_ret = dest_bucket->check_quota(this, user_quota, bucket_quota, astate->accounted_size, y); -- 2.47.3