]> 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 13:16:14 +0000 (15:16 +0200)
commitf17ceada0a39933a7d41efa1fc0d81e48de3def4
tree13919ab582f13f1fab216c886bf3af5f86444f3e
parentb7fdfedb9294fc7ed458ef6cb0b5c81fbb3ff220
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
- RGWRados::Bucket::List::list_objects_ordered takes an additional argument
  (unrelated to this change) in master
src/rgw/rgw_rados.cc
src/rgw/rgw_rados.h