]> git.baikalelectronics.ru Git - kernel.git/commit
crush: ensure bucket id is valid before indexing buckets array
authorIlya Dryomov <idryomov@gmail.com>
Sun, 31 Jan 2016 13:35:59 +0000 (14:35 +0100)
committerIlya Dryomov <idryomov@gmail.com>
Thu, 4 Feb 2016 17:25:23 +0000 (18:25 +0100)
commit55870c9a56fa9fabdbb9d631ab826cede293747c
tree01ec95389acdeba3651745a1a9457d976c011152
parent5ad5fc66a5f692ddc919ef6e61e85af420f4ae25
crush: 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.

Reflects ceph.git commit 976a24a326da8931e689ee22fce35feab5b67b76.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: Sage Weil <sage@redhat.com>
net/ceph/crush/mapper.c