CVE-2024-26899 block: fix deadlock between bd_link_disk_holder and partition scan
A deadlock in the Linux kernel block layer can cause a denial of service when adding a disk to a RAID array during partition scanning.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Local or same network only
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2024-26899?
CVE-2024-26899 is a medium-severity vulnerability in Linux kernel, published on 17 Apr 2024. It can only be exploited from the same machine or local network, with no action from the victim.
Official description
In the Linux kernel, the following vulnerability has been resolved:
block: fix deadlock between bd_link_disk_holder and partition scan
'open_mutex' of gendisk is used to protect open/close block devices. But in bd_link_disk_holder(), it is used to protect the creation of symlink between holding disk and slave bdev, which introduces some issues.
When bd_link_disk_holder() is called, the driver is usually in the process of initialization/modification and may suspend submitting io. At this time, any io hold 'open_mutex', such as scanning partitions, can cause deadlocks. For example, in raid:
T1 T2 bdev_open_by_dev lock open_mutex [1] ... efi_partition ... md_submit_bio md_ioctl mddev_syspend -> suspend all io md_add_new_disk bind_rdev_to_array bd_link_disk_holder try lock open_mutex [2] md_handle_request -> wait mddev_resume
T1 scan partition, T2 add a new device to raid. T1 waits for T2 to resume mddev, but T2 waits for open_mutex held by T1. Deadlock occurs.
Fix it by introducing a local mutex 'blk_holder_mutex' to replace 'open_mutex'.
Weakness: CWE-667
Which versions are affected by CVE-2024-26899?
It affects 1 product.
Products include Linux kernel.
How do I fix CVE-2024-26899?
Apply the vendor's patch.
Is CVE-2024-26899 being exploited?
There is no known exploitation of CVE-2024-26899 in the wild and no public exploit code.
Other vulnerabilities in Linux kernel
Sources
Also known as BELL-CVE-2024-26899, DEBIAN-CVE-2024-26899, GHSA-vw3m-pvf6-gxw8, UBUNTU-CVE-2024-26899.