From 039424284fb9e40d43cc60793ddff0e0f6bcf6f3 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 26 Feb 2019 13:30:33 -0600 Subject: [PATCH] mon: handle racing ms_handle_reset and handle_auth_request Signed-off-by: Sage Weil --- src/mon/Monitor.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index c4d8aaf4adba6..8592a4667ae43 100644 --- a/src/mon/Monitor.cc +++ b/src/mon/Monitor.cc @@ -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(priv.get()); r = s->auth_handler->handle_request( p, -- 2.39.5