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

Projects
None yet
1 participant
@liewegas
Copy link
Member

liewegas commented Oct 13, 2015

@ghost ghost self-assigned this Oct 13, 2015

@ghost

This comment has been minimized.

Copy link

ghost commented Oct 13, 2015

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

@liewegas

This comment has been minimized.

Copy link
Member Author

liewegas commented Oct 20, 2015

passed wip-sage-testing run

@ghost

This comment has been minimized.

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>

liewegas added some commits Oct 28, 2015

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>
crush/mapper: ensure take bucket value is valid
Ensure that the take argument is a valid bucket ID before indexing the
buckets array.

Signed-off-by: Sage Weil <sage@redhat.com>

@liewegas liewegas force-pushed the liewegas:wip-13477 branch from 1520610 to 93ec538 Oct 28, 2015

liewegas added a commit that referenced this pull request Oct 28, 2015

Merge pull request #6246 from liewegas/wip-13477
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 liewegas:wip-13477 branch Oct 28, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.