]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
crush/mapper: ensure bucket id is valid before indexing buckets array
authorSage Weil <sage@redhat.com>
Wed, 28 Oct 2015 00:55:26 +0000 (20:55 -0400)
committerAbhishek Varshney <abhishek.varshney@flipkart.com>
Wed, 18 Nov 2015 07:11:12 +0000 (12:41 +0530)
commitecb6aa232180e3226d56bc8fe0cb643c90f5101b
tree183105259a27994492ae8e6bff2761ff1f4da58a
parentbb2ecea240f3a1d525bcb35670cb07bd1f0ca299
crush/mapper: ensure bucket id is valid before indexing buckets array

We were indexing the buckets array without verifying the index was within
the [0,max_buckets) range.  This could happen because a multistep rule
does not have enough buckets and has CRUSH_ITEM_NONE
for an intermediate result, which would feed in CRUSH_ITEM_NONE and
make us crash.

Fixes: #13477
Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit 976a24a326da8931e689ee22fce35feab5b67b76)
src/crush/mapper.c