]> 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)
commit8162dd9e4827ea28675fff3c08140a30fd59f541
tree01ec95389acdeba3651745a1a9457d976c011152
parent026f22a0f9e6086da103ff4d6f900f16d71cddce
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