]> git.apps.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)
committerSage Weil <sage@redhat.com>
Wed, 28 Oct 2015 00:55:26 +0000 (20:55 -0400)
commit976a24a326da8931e689ee22fce35feab5b67b76
tree4436be2721190be09893e011f4d4a7083ecfd79c
parenta375de1ba12a3982860eea21a0bcbeeb01fdb09c
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>
src/crush/mapper.c