CVE-2026-22995

Source
https://cve.org/CVERecord?id=CVE-2026-22995
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-22995.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2026-22995
Downstream
Published
2026-01-23T15:24:15.684Z
Modified
2026-03-13T04:06:42.437739Z
Summary
ublk: fix use-after-free in ublk_partition_scan_work
Details

In the Linux kernel, the following vulnerability has been resolved:

ublk: fix use-after-free in ublkpartitionscan_work

A race condition exists between the async partition scan work and device teardown that can lead to a use-after-free of ub->ub_disk:

  1. ublkctrlstartdev() schedules partitionscanwork after adddisk()
  2. ublkstopdev() calls ublkstopdevunlocked() which does:
    • delgendisk(ub->ubdisk)
    • ublkdetachdisk() sets ub->ubdisk = NULL
    • put_disk() which may free the disk
  3. The worker ublkpartitionscanwork() then dereferences ub->ubdisk leading to UAF

Fix this by using ublkgetdisk()/ublkputdisk() in the worker to hold a reference to the disk during the partition scan. The spinlock in ublkgetdisk() synchronizes with ublkdetachdisk() ensuring the worker either gets a valid reference or sees NULL and exits early.

Also change flushwork() to cancelwork_sync() to avoid running the partition scan work unnecessarily when the disk is already detached.

Database specific
{
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/22xxx/CVE-2026-22995.json",
    "cna_assigner": "Linux"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
63dfbcd59b4b823eac4441efff10b1c303c8f49f
Fixed
72e28774e9644c2bdbb4920842fbf77103a15a85
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
7fc4da6a304bdcd3de14fc946dc2c19437a9cc5a
Fixed
f0d385f6689f37a2828c686fb279121df006b4cb

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-22995.json"