]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
libceph: return the handler error from mon_handle_auth_done()
authorIlya Dryomov <idryomov@gmail.com>
Mon, 29 Dec 2025 14:14:48 +0000 (15:14 +0100)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 5 Jan 2026 21:46:43 +0000 (22:46 +0100)
Currently any error from ceph_auth_handle_reply_done() is propagated
via finish_auth() but isn't returned from mon_handle_auth_done().  This
results in higher layers learning that (despite the monitor considering
us to be successfully authenticated) something went wrong in the
authentication phase and reacting accordingly, but msgr2 still trying
to proceed with establishing the session in the background.  In the
case of secure mode this can trigger a WARN in setup_crypto() and later
lead to a NULL pointer dereference inside of prepare_auth_signature().

Cc: stable@vger.kernel.org
Fixes: cd1a677cad99 ("libceph, ceph: implement msgr2.1 protocol (crc and secure modes)")
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: Viacheslav Dubeyko <Slava.Dubeyko@ibm.com>
net/ceph/mon_client.c

index c227ececa9254c631432a3c0e00e3bb4c311b8f2..fa8dd2a20f7d28bae143e0fc87774e5b7aaa3d39 100644 (file)
@@ -1417,7 +1417,7 @@ static int mon_handle_auth_done(struct ceph_connection *con,
        if (!ret)
                finish_hunting(monc);
        mutex_unlock(&monc->mutex);
-       return 0;
+       return ret;
 }
 
 static int mon_handle_auth_bad_method(struct ceph_connection *con,