]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: handle racing ms_handle_reset and handle_auth_request 26678/head
authorSage Weil <sage@redhat.com>
Tue, 26 Feb 2019 19:30:33 +0000 (13:30 -0600)
committerSage Weil <sage@redhat.com>
Wed, 27 Feb 2019 16:50:54 +0000 (10:50 -0600)
Signed-off-by: Sage Weil <sage@redhat.com>
src/mon/Monitor.cc

index c4d8aaf4adba63eedede0635eb7f4ec358101d1b..8592a4667ae431e4fc97ec44802394a18e3f0cba 100644 (file)
@@ -6240,6 +6240,11 @@ int Monitor::handle_auth_request(
       &auth_meta->connection_secret);
   } else {
     priv = con->get_priv();
+    if (!priv) {
+      // this can happen if the async ms_handle_reset event races with
+      // the unlocked call into handle_auth_request
+      return -EACCES;
+    }
     s = static_cast<MonSession*>(priv.get());
     r = s->auth_handler->handle_request(
       p,