KernelScan.io

CRITICAL Introduced in 2.6.34

ceph SnapTrace OOB

CVE-2026-68160

CVSS 9.8 / 10.0 NVD

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

KernelScan AI9.1CRITICAL

01

In the Linux kernel, the following vulnerability has been resolved: ceph: fix pre-auth out-of-bounds read on snaptrace in ceph_handle_caps() ceph_handle_caps() reads snap_trace_len from the wire-format ceph_mds_caps header and uses it unconditionally to build a fake end pointer (snaptrace + snaptrace_len) that is later handed to ceph_update_snap_trace() in the CEPH_CAP_OP_IMPORT case: snaptrace = h + 1; snaptrace_len = le32_to_cpu(h->snap_trace_len); p = snaptrace + snaptrace_len; ... case CEPH_CAP_OP_IMPORT: if (snaptrace_len) { ... if (ceph_update_snap_trace(mdsc, snaptrace, snaptrace + snaptrace_len, false, &realm)) { ... } ceph_update_snap_trace() then decodes a struct ceph_mds_snap_realm from snaptrace using ceph_decode_need(&p, e, sizeof(*ri), bad) with the attacker-supplied fake end e == snaptrace + snaptrace_len. With snaptrace_len == 0xFFFFFFFF the bound check is trivially satisfied, ri = p reads sizeof(struct ceph_mds_snap_realm) past the legitimate msg->front buffer, and ri->num_snaps / ri->num_prior_parent_snaps then drive further out-of-bounds reads of the encoded snap arrays. The eleven msg_version >= 2 .. msg_version >= 12 decoder blocks above the op switch each catch this OOB through their ceph_decode_*_safe() / ceph_decode_need() helpers, but they sit behind a hdr.version-gated if, so a malicious or compromised MDS that sets msg->hdr.version = 1 reaches the IMPORT path with no version-gated decoder having validated snap_trace_len. The shape has been present since ceph_handle_caps() was introduced. Validate snap_trace_len against the message front buffer before consuming it, using the canonical ceph_decode_need() / ceph_has_room() helper. The helper bounds the length with subtraction (n <= end - p, guarded by end >= p) rather than pointer addition, so it is wrap-safe for the attacker-controlled u32 length on 32-bit builds where p + snap_trace_len could overflow the address space. This matches the rest of the ceph decode path (e.g. the pool_ns_len check a few lines below), and the existing goto bad cleanup already covers this exit path.

02

Engine v0.6.0

Risk summary

A malicious or compromised Ceph metadata server (MDS) can send a crafted capability message that causes the Ceph client kernel to read far past the legitimate message buffer. Any Linux system acting as a Ceph client with an active connection to a malicious MDS is vulnerable, potentially leaking kernel memory or crashing the system.

Affectedfs/ceph/caps.c (ceph filesystem client)

Vulnerability analysis

The Ceph filesystem client's capability message handler reads a snap trace length field from the wire-format header and uses it to build a boundary pointer without first checking that the length fits within the actual message buffer. Version-gated decoder blocks that would normally validate this length are skipped when a malicious MDS sends a message with a low version number, allowing an attacker-controlled length value to reach the import path unvalidated. With an inflated length, the client kernel reads past the message buffer into adjacent memory, and the garbage values read from there drive further out-of-bounds reads. The fix adds a bounds check using the canonical Ceph decode helper immediately after reading the length field, ensuring the snap trace length cannot exceed the available message data before it is used. Any Ceph client connected to a malicious or compromised MDS is vulnerable; no special client-side privileges are needed beyond having a Ceph filesystem mounted.

03

BranchIntroducedFixed inPatch commit
5.152.6.345.15.2160c0111371940
6.122.6.346.12.10103b417afce19
7.12.6.347.1.671893c342a26
mainline2.6.347.24dbc71bcaf9a
6.62.6.346.6.1489081c7179672
6.12.6.346.1.183cc93f68a31c9
6.182.6.346.18.42a4228b93706f
5.102.6.345.10.265f913192fc782