CVE-2026-99296: libceph: bound mon_command ack decode to front len
In the Linux kernel, the following vulnerability has been resolved:
libceph: bound moncommand ack decode to front len
handlecommandack() bounds the decode with msg->frontalloclen, the size of the reply buffer, instead of msg->front.iovlen, the number of bytes the monitor sent. monallocmsg() routes every CEPHMSGMONCOMMANDACK to getgenericreply(), which returns the preallocated ->reply of whichever generic request carries the same tid, so the buffer keeps its fixed size however short the reply is. An ack with hdr.frontlen below sizeof(struct cephmonrequestheader) + sizeof(u32), including 0, still passes cephdecodeneed(), and cephdecode32() returns four bytes that were never received: uninitialized slab memory, stale bytes of an earlier message, or bytes the peer planted by sending a reply that lands in the same buffer and is then rejected. The read stays within the allocation, so KASAN does not flag it.
req->result reaches userspace through cephmoncdostatfs(), cephmoncgetversion() and cephmoncblocklistadd(); rbd hands it back from write() on /sys/bus/rbd/addsinglemajor, and rbdgetclient() passes it to ERRPTR() unchecked, which faults:
rbd: failed to get latest osdmap: -186318427 BUG: unable to handle page fault for address: fffffbfffe9ca034 Oops: Oops: 0000 [#1] SMP KASAN NOPTI RIP: 0010:dorbdadd (drivers/block/rbd.c:7105) Call Trace: ... kernfsfopwriteiter (fs/kernfs/file.c:345) vfswrite (fs/readwrite.c:595 fs/readwrite.c:687) ksyswrite (fs/readwrite.c:739) dosyscall64 (arch/x86/entry/syscall64.c:61 arch/x86/entry/syscall64.c:84) entrySYSCALL64afterhwframe (arch/x86/entry/entry64.S:121) Kernel panic - not syncing: Fatal exception
Use msg->front.iovlen, matching handlesubscribeack(), handlestatfsreply(), handlegetversionreply() and handleauthreply(). A well-formed ack has front.iovlen >= 22 and is unaffected; a short one takes the existing bad: path. This applies commit d3c32939fa0e ("libceph: bound getversion reply decode to front len") to the last decode-side use of frontalloclen in this file.