Junglewise Threat Intelligence

CVE-2026-31580: Linux Kernel bcache use-after-free in cached_dev_free

CVE-2026-31580 · Severity: high · CVSS 7.8 · Published 2026-04-24

Technologies: Linux Kernel. Vendors: Linux.

Executive brief

A vulnerability in the Linux kernel's bcache component can cause a system crash or potential data corruption. bcache is a mechanism used to speed up hard drives by using faster SSDs as a cache. If a cached device is stopped while a background write operation is still in progress, the system may attempt to access memory that has already been freed, leading to instability.

Technical details

A use-after-free vulnerability exists in the Linux kernel bcache driver within the cached_dev_free function. The root cause is a race condition where the 'sb_bio' structure, which is embedded within 'struct cached_dev', is accessed after the parent structure has been freed. This occurs if a device is stopped while a superblock write ('sb_write') is still in progress; the 'endio' callback subsequently attempts to access the now-released memory address. The fix involves adding a 'closure_sync' call in 'cached_dev_free' to ensure all pending superblock writes are completed before the memory is reclaimed. This issue primarily affects systems using bcache for block-layer caching.

Affected products

  • Linux Linux Kernel versions up to 6.6.136, 6.12.83, 6.13 to 6.18.24, 6.19 to 6.19.14, 7.0 to 7.0.1

Timeline

  • 2026-04-24: disclosed
  • 2026-04-24: advisory
  • 2026-04-22: patched: Initial patches committed to stable trees.

References

Related threats