CVE-2026-99899: libceph: reject an initial monmap with no monitors
In the Linux kernel, the following vulnerability has been resolved:
libceph: reject an initial monmap with no monitors
buildinitialmonmap() takes the monitor count straight from cephoptions::nummon and builds a monmap with that many entries without checking that there is at least one. cephparseips() writes count only after it has parsed an address successfully, so a cephoptions that went through a failed parse still has nummon == 0 and the resulting monmap has no monitors in it at all.
The first thing the client does with that monmap is open a session, and picknewmon() asserts the invariant that it is non-empty:
kernel BUG at net/ceph/monclient.c:211! RIP: 0010:picknewmon net/ceph/monclient.c:211 [inline] RIP: 0010:opensession+0x60f/0x740 net/ceph/monclient.c:245 Call Trace: cephmoncopensession+0x46/0x60 net/ceph/monclient.c:534 cephopensession+0x135/0x590 net/ceph/cephcommon.c:798 cephrealmount fs/ceph/super.c:1173 [inline] cephgettree+0xd98/0x1fd0 fs/ceph/super.c:1362 vfsgettree+0x92/0x320 fs/super.c:1947 vfscmdcreate+0xd7/0x2a0 fs/fsopen.c:231 dosysfsconfig+0x55a/0xcb0 fs/fsopen.c:463
The reproducer gets there through the new device syntax: an fsconfig() monaddr= that does not resolve ("libceph: resolve '127.0.0.' (ret=-3): failed") leaves fsopt->monaddr set but nummon at 0, so the "No monitor address" check in cephgettree() passes and the mount proceeds with an empty monmap. The next patch stops that string from being kept, but the assertion should not be reachable from a mount option in the first place.
Commit 40480eee361e ("libceph: Reject monmaps advertising zero monitors") made the same BUGON() unreachable from the wire by rejecting nummon == 0 in cephmonmapdecode(). Apply the same rule to the initial monmap, which is the only other way one gets built, and fail the mount with -EINVAL rather than assert afterwards.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Patch 40480eee361e