Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crush: validate bucket id before indexing buckets array #6246

Merged
merged 2 commits into from Oct 28, 2015

Conversation

liewegas
Copy link
Member

@ghost ghost self-assigned this Oct 13, 2015
@ghost
Copy link

ghost commented Oct 13, 2015

I'll add a test to make sure I get it in detail.

@liewegas
Copy link
Member Author

passed wip-sage-testing run

@ghost
Copy link

ghost commented Oct 27, 2015

I thought it was about

a malformed multistep rule could feed in CRUSH_ITEM_NONE

as well. But it looks like this is just a normal case of a ruleset that has not enough buckets and the multistep rule is valid. Assuming the commit message of a31dbe2 is updated to make that clear to the reader,

Reviewed-by: Loic Dachary <ldachary@redhat.com>

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: ceph#13477
Signed-off-by: Sage Weil <sage@redhat.com>
Ensure that the take argument is a valid bucket ID before indexing the
buckets array.

Signed-off-by: Sage Weil <sage@redhat.com>
liewegas added a commit that referenced this pull request Oct 28, 2015
crush: validate bucket id before indexing buckets array

Reviewed-by: Loic Dachary <ldachary@redhat.com>
@liewegas liewegas merged commit b54f9aa into ceph:master Oct 28, 2015
@liewegas liewegas deleted the wip-13477 branch October 28, 2015 00:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant