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

common/TrackedOp: make TrackedOp::reset_desc() safe #13702

Merged
merged 1 commit into from Mar 1, 2017

Conversation

Projects
None yet
2 participants
@liewegas
Member

liewegas commented Feb 28, 2017

It is possible for a reset_desc() call to clear the desc char* while
get_desc() is executing such that it will return a nullptr to the caller.
This can lead to bad results, like a crash in std::string() (which does
not like to take null).

Fix this by not clearing desc. Instead, set a separate flag to indicate
that desc should be (safely) rebuilt on the next get_desc() call.

Fixes: http://tracker.ceph.com/issues/19110
Signed-off-by: Sage Weil sage@redhat.com

common/TrackedOp: make TrackedOp::reset_desc() safe
It is possible for a reset_desc() call to clear the desc char* while
get_desc() is executing such that it will return a nullptr to the caller.
This can lead to bad results, like a crash in std::string() (which does
not like to take null).

Fix this by not clearing desc.  Instead, set a separate flag to indicate
that desc should be (safely) rebuilt on the next get_desc() call.

Fixes: http://tracker.ceph.com/issues/19110
Signed-off-by: Sage Weil <sage@redhat.com>
@liewegas

This comment has been minimized.

Member

liewegas commented Mar 1, 2017

retest this please

@liewegas liewegas merged commit f85cec8 into ceph:master Mar 1, 2017

2 of 3 checks passed

default Build finished.
Details
Signed-off-by all commits in this PR are signed
Details
Unmodifed Submodules submodules for project are unmodified
Details

@liewegas liewegas deleted the liewegas:wip-trackedop-desc branch Mar 1, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment