CVE-2026-80561: libceph: fix multiple unsafe decodes in decode_locker()
In the Linux kernel, the following vulnerability has been resolved:
libceph: fix multiple unsafe decodes in decodelocker()
decodelocker() in clslockclient.c contains three unsafe decode operations that allow a malicious or compromised OSD to trigger slab-out-of-bounds reads:
1. cephdecodecopy() at the lockeridt name field has no preceding bounds check. With p == end after cephstartdecoding() accepts structlen=0, this reads sizeof(cephentityname) = 9 bytes past the validated buffer boundary.
2. p += sizeof(struct cephtimespec) after the lockerinfot header is an unchecked pointer advance. A malicious OSD can position p past end, causing all subsequent safe checks to pass against a bogus boundary.
3. len = cephdecode32(p) has no preceding bounds check, and the immediately following p += len is uncapped. A malicious OSD can send len=0xffffffff, advancing p gigabytes past end and escaping the decode window entirely.
Fix all three by replacing bare operations with their safe variants: cephdecodecopy -> cephdecodecopysafe p += sizeof(...) -> cephdecodeskipn cephdecode32(p) -> cephdecode32safe p += len -> cephdecodeskipn
A new label is added to return -EINVAL on any bounds violation. -EINVAL is appropriate here: the data received from the OSD is structurally malformed, which is an invalid argument to the decode contract regardless of whether the caller or the wire is at fault.
Attacker model: a malicious or compromised OSD in a multi-tenant Ceph deployment can trigger this against any kernel client that issues the lock.getinfo class method (e.g. during RBD exclusive lock acquisition) without any further privileges beyond OSD session establishment.
[ idryomov: use cephdecodeskipstring() to skip description, trim changelog ]
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Configuration
In decode_locker() replace bare/unsafe decode operations with their safe variants so every skip/copy/32-bit decode is bounds-checked: use ceph_decode_skip_n_safe, ceph_decode_32_safe, and ceph_decode_copy_safe, including for the locker_id_t name field, where ceph_decode_copy() previously had no preceding bounds check.
libceph (decode_locker / cls_lock_client.c) use safe decode helpers = ceph_decode_skip_n -> ceph_decode_skip_n_safe; ceph_decode_32 -> ceph_decode_32_safe; ceph_decode_copy -> ceph_decode_copy_safe; ceph_decode_copy() -> ceph_decode_copy_safe for locker_id_t name field - Compensating control
Assume attacker model includes a malicious or compromised OSD in multi-tenant Ceph; restrict network/OSD session access such that only trusted OSDs can establish OSD sessions for the relevant clients (to reduce exposure while the kernel fix is rolled out).
Event History
Frequently Asked Questions
Which systems are exposed to this issue?
Systems using the Linux kernel's libceph client code and communicating with an OSD are exposed if that OSD is malicious or compromised. The vulnerability is triggered by crafted OSD-provided locker data.
What does an attacker need to exploit it?
An attacker needs control of, or the ability to compromise, an OSD so it can send malformed data to the affected client decoder. The malformed fields can cause pointer movement and reads beyond the validated message buffer.