[PATCH 0/2] libceph: fix NULL ac->ops dereference and hunting state on auth failure
From: Yiming Zhu
Date: Fri Dec 04 2026 - 03:25:34 EST
This series fixes a NULL pointer dereference in ceph_build_auth() and a
related hunting state bug in the msgr1 monitor auth reply path when
authentication fails before a protocol handler is initialized.
When auth protocol initialization fails (for example, the monitor
requires cephx while no secret is configured), ac->ops remains NULL.
In the msgr1 path, handle_auth_reply() still calls finish_hunting(monc)
unconditionally on error, clearing monc->hunting and scheduling
delayed_work() on the ping interval. When delayed_work() runs and
invokes __validate_auth() -> ceph_build_auth(),
ac->ops->should_authenticate(ac) dereferences a NULL pointer.
Patch 1 guards ac->ops against NULL in ceph_build_auth().
Patch 2 fixes msgr1 handle_auth_reply() so finish_hunting(monc) is only
called on authentication success (!ret), matching msgr2
mon_handle_auth_done().
Yiming Zhu (2):
libceph: check ac->ops in ceph_build_auth()
libceph: don't finish hunting on auth failure in handle_auth_reply()
net/ceph/auth.c | 2 +-
net/ceph/mon_client.c | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
base-commit: 7be4bc52fd9e0e55dc9a2e0232b89427d2c4b614
--
2.56.0