HIGH Introduced in 2.6.29
dm-crypt DecPending Race
CVE-2026-99136
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
KernelScan AI7.0HIGH
01Description
In the Linux kernel, the following vulnerability has been resolved: dm-crypt: fix a tiny race condition in crypt_dec_pending crypt_dec_pending reads io->error before calling atomic_dec_and_test. Another context, for example crypt_endio called from an interrupt, may set io->error and drop its reference between the read and the decrement. crypt_dec_pending then drops the last reference and completes the bio with the stale status - so a read that failed and was never decrypted, or a write that failed, is reported as successful. The read was placed before the decrement by commit b35f8caa0890 ("dm crypt: wait for endio to complete before destruction"), because that commit freed dm_crypt_io before calling bio_endio. This is no longer the case, dm_crypt_io lives in the per-bio data now. Read io->error after atomic_dec_and_test instead. atomic_dec_and_test is fully ordered, so no additional barrier is needed.
02KernelScan AI Analysis
Risk summary
A race condition in dm-crypt's completion path can cause failed encrypted I/O operations to be reported as successful. Any local user with read or write access to a file on an existing dm-crypt volume can trigger this by issuing I/O that fails at the lower layer, potentially leaking prior page contents on reads or silently corrupting filesystem metadata and data on writes. The bug affects all kernels since 2.6.29 where dm-crypt is in use.
Vulnerability analysis
The dm-crypt completion function crypt_dec_pending() reads the I/O error status before atomically decrementing a pending counter. An interrupt-context completion handler (crypt_endio) can update that error status and drop its reference in the tiny window between the read and the decrement. When crypt_dec_pending then sees the counter reach zero, it completes the bio with the stale error value it read earlier — turning a genuine failure into a false success. The fix reorders the operations so the error is read after the atomic decrement, which is fully ordered and guarantees visibility of any prior error store. The vulnerable path is reached through ordinary file read/write syscalls on a dm-crypt mapped device; no special privileges are needed beyond filesystem permissions on the encrypted volume, though creating the mapping initially requires root.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 2.6 | 2.6.28.9 | 2.6.29 | 445a6883f46d |
| 5.10 | 2.6.29 | 5.10.273 | 6f82e86471c9 |
| 5.15 | 2.6.29 | 5.15.224 | 6ac8546df1f8 |
| 6.1 | 2.6.29 | 6.1.191 | 056bf8322e39 |
| 6.12 | 2.6.29 | 6.12.115 | ac5d887ab935 |
| 6.18 | 2.6.29 | 6.18.59 | 4f16bb982b27 |
| 6.6 | 2.6.29 | 6.6.161 | d9d7069bb791 |
| 7.2 | 2.6.29 | 7.2.13 | 148845aa1921 |
| mainline | 2.6.29 | 7.3 | — |
04CIP Kernels
State of the newest release of each Civil Infrastructure Platform SLTS tree, from CIP's own fix records.
| CIP tree | State |
|---|---|
| cip/6.12 | Affected — no CIP fix yet (latest 6.12.114-cip34) |
| cip/6.1 | Affected — no CIP fix yet (latest 6.1.190-cip62) |
| cip/6.1-rt | Affected — no CIP fix yet (latest 6.1.189-cip61-rt32) |
| cip/5.10 | Affected — no CIP fix yet (latest 5.10.272-cip79) |
| cip/5.10-rt | Affected — no CIP fix yet (latest 5.10.272-cip79-rt35) |
| cip/4.19 | Affected — no CIP fix yet (latest 4.19.325-cip136) |
| cip/4.19-rt | Affected — no CIP fix yet (latest 4.19.325-cip136-rt50) |
| cip/4.4 | Affected — no CIP fix yet (latest 4.4.302-cip115) |
| cip/4.4-rt | Affected — no CIP fix yet (latest 4.4.302-cip115-rt63) |