]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
rgw: mitigate bucket list with max-entries excessively high
authorJ. Eric Ivancich <ivancich@redhat.com>
Fri, 19 Jul 2019 20:10:59 +0000 (16:10 -0400)
committerNathan Cutler <ncutler@suse.com>
Tue, 1 Oct 2019 15:09:24 +0000 (17:09 +0200)
commit9a02483277c9ef66c72e3decc973e4c70eb43a19
tree3bbd5339e439e3b8567ae0f35cef10c0bd0a1973
parent92fcc33c4311f8e0e8dd7661052e0b70ecbae10e
rgw: mitigate bucket list with max-entries excessively high

When listing a bucket with radosgw-admin, the user can specify the
maximum number of entries. That number can be unreasonably large, and
can affect the performance and memory availability. For example:

    radosgw-admin bucket list --bucket mybucket1 --max-entries=10000000

This has the potential for creating large data structures at multiple
levels in the the call stack of the radosgw(-admin) process,
potentially causing the process to run out of memory. This change
limits the maximum number of entries requested in all but the high
level code to help mitigate this issue.

Signed-off-by: J. Eric Ivancich <ivancich@redhat.com>
(cherry picked from commit 300429c9e98a27e17c2a20ade82c6c63ac276c20)

Conflicts:
src/rgw/rgw_rados.cc
- in luminous, RGWRados::Bucket::List::list_objects_ordered does not take
  optional_yield parameter
- no std::string_view in C++11
src/rgw/rgw_rados.cc
src/rgw/rgw_rados.h