]> 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)
committerKen Dreyer <kdreyer@redhat.com>
Wed, 4 Nov 2015 21:42:40 +0000 (14:42 -0700)
commit3d217a3d1c413fc848058aaf957c94ff30a20c11
tree64cc70ad85f6754399119bc7179fa5a493837e61
parentad5aa13c2b0c3124cace770140040ac558e8b53c
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)
(cherry picked from commit 81d8aa14f3f2b7bf4bdd0b4e53e3a653a600ef38)
src/crush/mapper.c