From d79f68a1e31f4bc917eec1b6bbc8e8446377dc6b Mon Sep 17 00:00:00 2001 From: "Robin H. Johnson" Date: Fri, 21 Sep 2018 14:49:34 -0700 Subject: [PATCH] rgw: enforce bounds on max-keys/max-uploads/max-parts RGW S3 listing operations provided a way for authenticated users to cause a denial of service against OMAPs holding bucket indices. Bound the min & max values that a user could pass into the max-X parameters, to keep the system safe. The default of 1000 is chosen to match AWS S3 behavior. Affected operations: - ListBucket, via max-keys - ListBucketVersions, via max-keys - ListBucketMultiPartUploads, via max-uploads - ListMultipartUploadParts, via max-parts The Swift bucket listing codepath already enforced a limit, so is unaffected by this issue. Prior to this commit, the effective limit is the lower of osd_max_omap_entries_per_request or osd_max_omap_bytes_per_request. Backport: luminous, mimic Fixes: http://tracker.ceph.com/issues/35994 Signed-off-by: Robin H. Johnson --- src/common/options.cc | 12 ++++++++++++ src/rgw/rgw_op.cc | 21 +++++---------------- src/rgw/rgw_op.h | 25 +++++++++++++++++++++++++ src/rgw/rgw_rest.cc | 11 +++++------ src/rgw/rgw_rest_swift.cc | 2 ++ 5 files changed, 49 insertions(+), 22 deletions(-) diff --git a/src/common/options.cc b/src/common/options.cc index 2ed6e83f71b0..cc98027cc5d7 100644 --- a/src/common/options.cc +++ b/src/common/options.cc @@ -6454,6 +6454,18 @@ std::vector