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

client: fix request reference leak #17545

Merged
merged 1 commit into from Sep 14, 2017
Merged

client: fix request reference leak #17545

merged 1 commit into from Sep 14, 2017

Conversation

ukernel
Copy link
Contributor

@ukernel ukernel commented Sep 7, 2017

if request gets aborted, its reference leaks.

Fixes: http://tracker.ceph.com/issues/21274
Signed-off-by: "Yan, Zheng" zyan@redhat.com

if request gets aborted, its reference leaks.

Fixes: http://tracker.ceph.com/issues/21274
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
@ukernel ukernel added bug-fix cephfs Ceph File System labels Sep 7, 2017
@@ -1731,6 +1731,7 @@ int Client::make_request(MetaRequest *request,
r = request->get_abort_code();
request->item.remove_myself();
unregister_request(request);
put_request(request);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't unregister_request also do put_request?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

both mds_requests map and caller of make_reuqets() hold a reference. unregister_request() releases reference hold by mds_requests map

Copy link
Contributor

@tchaikov tchaikov Sep 14, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, my bad =( introduced by 9cb7906. it's a "potential" use-after-free.

batrick added a commit to batrick/ceph that referenced this pull request Sep 13, 2017
* refs/remotes/upstream/pull/17545/head:
	client: fix request reference leak

Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
@batrick batrick merged commit bc7d02d into ceph:master Sep 14, 2017
batrick added a commit that referenced this pull request Sep 14, 2017
* refs/remotes/upstream/pull/17545/head:
	client: fix request reference leak

Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
@ukernel ukernel deleted the wip-21274 branch April 20, 2018 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants