crush: pass weight vector size to map function
authorIlya Dryomov <ilya.dryomov@inktank.com>
Tue, 24 Dec 2013 19:19:24 +0000 (21:19 +0200)
committerIlya Dryomov <ilya.dryomov@inktank.com>
Tue, 31 Dec 2013 18:32:10 +0000 (20:32 +0200)
commitb3b33b0e43323af4fb697f4378218d3c268d02cd
treea66facb833b060476439c9988b81311e827c35c6
parent2b3e0c905af43cfe402a2ef3f800be5dc1684005
crush: pass weight vector size to map function

Pass the size of the weight vector into crush_do_rule() to ensure that we
don't access values past the end.  This can happen if the caller misbehaves
and passes a weight vector that is smaller than max_devices.

Currently the monitor tries to prevent that from happening, but this will
gracefully tolerate previous bad osdmaps that got into this state.  It's
also a bit more defensive.

Reflects ceph.git commit 5922e2c2b8335b5e46c9504349c3a55b7434c01a.

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
include/linux/crush/mapper.h
net/ceph/crush/mapper.c
net/ceph/osdmap.c
This page took 0.040217 seconds and 5 git commands to generate.