From: Sage Weil Date: Mon, 1 Apr 2013 04:05:49 +0000 (-0700) Subject: client: fix use-after-free on session close and cond signals X-Git-Tag: v0.60~2^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=74c708367bb01ec5f80b31e239f8868e9b065800;p=ceph.git client: fix use-after-free on session close and cond signals Move the signal into the closed method, before we deallocate the MetaSession, so that other callers catch it too. Signed-off-by: Sage Weil --- diff --git a/src/client/Client.cc b/src/client/Client.cc index e81e60cca694..18fd7aae4f42 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -1512,6 +1512,7 @@ void Client::_closed_mds_session(MetaSession *s) { s->state = MetaSession::STATE_CLOSED; messenger->mark_down(s->con); + signal_cond_list(s->waiting_for_open); mount_cond.Signal(); remove_session_caps(s); kick_requests(s, true); @@ -1545,7 +1546,6 @@ void Client::handle_client_session(MClientSession *m) case CEPH_SESSION_CLOSE: _closed_mds_session(session); - signal_cond_list(session->waiting_for_open); break; case CEPH_SESSION_RENEWCAPS: