KernelScan.io

HIGH Introduced in 6.18

dm-pcache SegId OOB

CVE-2026-93201

CVSS 7.8 / 10.0 NVD

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

KernelScan AI6.7MEDIUM

01

In the Linux kernel, the following vulnerability has been resolved: dm-pcache: validate seg_id fields from persistent memory cache_pos_decode(), cache_key_decode() and the last-kset branches of cache_replay(), the writeback worker and the GC worker take a cache segment id from the cache device metadata and index cache->segments[] with it without checking it against cache->n_segs. That metadata is only CRC-protected with a fixed public seed, so whoever supplies the cache device on a table load (CAP_SYS_ADMIN) controls the id; an out-of-range value forms a wild pcache_cache_segment pointer that is dereferenced and written through -- an out-of-bounds read and write driven by on-disk data. Add cache_seg_id_valid() and reject an out-of-range id at each decode site, failing the operation with -EIO instead of indexing past the array. Bound the id against the initialized-segment count (cache_info.n_segs) rather than the physical device total. A forged cache_info.n_segs below seg_num otherwise leaves segments[cache_info.n_segs..seg_num) as zeroed structs whose data pointer is NULL, so a forged id in that window would still be dereferenced. A later patch guarantees cache_info.n_segs <= seg_num, and a driver-created cache sets the two equal, so valid images are unaffected.

02

Engine v0.6.0

Risk summary

A privileged local attacker with CAP_SYS_ADMIN can supply a crafted persistent cache device whose metadata contains an out-of-range segment identifier, causing the kernel to read and write through a wild pointer. This results in kernel memory corruption that can crash the system or potentially escalate to arbitrary kernel code execution. The vulnerability is limited to systems using the dm-pcache target and requires init-namespace CAP_SYS_ADMIN to trigger.

Affecteddrivers/md/dm-pcache/cache.c, cache_key.c, cache_gc.c, cache_writeback.c (dm-pcache persistent cache target)

Vulnerability analysis

The dm-pcache persistent cache target reads segment identifiers from on-disk cache device metadata and uses them directly as array indices without checking whether they fall within the allocated segment range. Because the metadata is only integrity-protected by a CRC with a publicly known seed, anyone who can supply the cache device can craft metadata containing an out-of-range segment id, causing the kernel to dereference a pointer past the segment array — an out-of-bounds read and write in kernel memory. The fix validates every segment id read from the device before it is used to access the array, rejecting forged values and checking against the active segment count rather than the raw device size to close a secondary gap. The vulnerable path is reached when loading a device-mapper table with a crafted cache device, which requires CAP_SYS_ADMIN in the initial namespace.

03

BranchIntroducedFixed inPatch commit
6.186.186.18.5796d4b275281b
7.26.187.2.6b4bf8af5e7d7
mainline6.187.390c990a68460