Vulnerability · Published Aug 17, 2024 · Assigned by Linux

CVE-2024-43855md: fix deadlock between mddev_suspend and flush bio

Medium 5.5

In plain English

A medium-severity security flaw in Linux from Linux. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.2% (higher than 11% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS NVD)5.5Medium
Exploit odds (30 days)0.2%top 88.9% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

Official description

In the Linux kernel, the following vulnerability has been resolved: md: fix deadlock between mddev_suspend and flush bio Deadlock occurs when mddev is being suspended while some flush bio is in progress. It is a complex issue. T1. the first flush is at the ending stage, it clears 'mddev->flush_bio' and tries to submit data, but is blocked because mddev is suspended by T4. T2. the second flush sets 'mddev->flush_bio', and attempts to queue md_submit_flush_data(), which is already running (T1) and won't execute again if on the same CPU as T1. T3. the third flush inc active_io and tries to flush, but is blocked because 'mddev->flush_bio' is not NULL (set by T2). T4. mddev_suspend() is called and waits for active_io dec to 0 which is inc by T3. T1 T2 T3 T4 (flush 1) (flush 2) (third 3) (suspend) md_submit_flush_data mddev->flush_bio = NULL; . . md_flush_request . mddev->flush_bio = bio . queue submit_flushes . . . . md_handle_request . . active_io + 1 . . md_flush_request . . wait !mddev->flush_bio . . . . mddev_suspend . . wait !active_io . . . submit_flushes . queue_work md_submit_flush_data . //md_submit_flush_data is already running (T1) . md_handle_request wait resume The root issue is non-atomic inc/dec of active_io during flush process. active_io is dec before md_submit_flush_data is queued, and inc soon after md_submit_flush_data() run. md_flush_request active_io + 1 submit_flushes active_io - 1 md_submit_flush_data md_handle_request active_io + 1 make_request active_io - 1 If active_io is dec after md_handle_request() instead of within submit_flushes(), make_request() can be called directly intead of md_handle_request() in md_submit_flush_data(), and active_io will only inc and dec once in the whole flush process. Deadlock will be fixed. Additionally, the only difference between fixing the issue and before is that there is no return error handling of make_request(). But after previous patch cleaned md_write_start(), make_requst() only return error in raid5_make_request() by dm-raid, see commit 41425f96d7aa ("dm-raid456, md/raid456: fix a deadlock for dm-raid456 while io concurrent with reshape)". Since dm always splits data and flush operation into two separate io, io size of flush submitted by dm always is 0, make_request() will not be called in md_submit_flush_data(). To prevent future modifications from introducing issues, add WARN_ON to ensure make_request() no error is returned in this context.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
Debian:12linux6.1.106-1DEBIAN-CVE-2024-43855
Debian:13linux6.10.3-1DEBIAN-CVE-2024-43855
Debian:14linux6.10.3-1DEBIAN-CVE-2024-43855
Ubuntu:24.04:LTSlinux6.8.0-48.48UBUNTU-CVE-2024-43855
Ubuntu:22.04:LTSlinux-allwinner-5.19no fix listedUBUNTU-CVE-2024-43855
Ubuntu:24.04:LTSlinux-aws6.8.0-1018.20UBUNTU-CVE-2024-43855
Ubuntu:22.04:LTSlinux-aws-5.19no fix listedUBUNTU-CVE-2024-43855
Ubuntu:22.04:LTSlinux-aws-6.2no fix listedUBUNTU-CVE-2024-43855
Ubuntu:22.04:LTSlinux-aws-6.5no fix listedUBUNTU-CVE-2024-43855
Ubuntu:22.04:LTSlinux-aws-6.86.8.0-1018.19~22.04.1UBUNTU-CVE-2024-43855
Ubuntu:24.04:LTSlinux-azure6.8.0-1017.20UBUNTU-CVE-2024-43855
Ubuntu:22.04:LTSlinux-azure-5.19no fix listedUBUNTU-CVE-2024-43855
Ubuntu:22.04:LTSlinux-azure-6.2no fix listedUBUNTU-CVE-2024-43855
Ubuntu:22.04:LTSlinux-azure-6.5no fix listedUBUNTU-CVE-2024-43855
Ubuntu:22.04:LTSlinux-azure-6.86.8.0-1017.20~22.04.1UBUNTU-CVE-2024-43855
Ubuntu:22.04:LTSlinux-azure-fde-5.19no fix listedUBUNTU-CVE-2024-43855
Ubuntu:22.04:LTSlinux-azure-fde-6.2no fix listedUBUNTU-CVE-2024-43855
Ubuntu:24.04:LTSlinux-gcp6.8.0-1017.19UBUNTU-CVE-2024-43855
Ubuntu:22.04:LTSlinux-gcp-5.19no fix listedUBUNTU-CVE-2024-43855
Ubuntu:22.04:LTSlinux-gcp-6.2no fix listedUBUNTU-CVE-2024-43855
Ubuntu:22.04:LTSlinux-gcp-6.5no fix listedUBUNTU-CVE-2024-43855
Ubuntu:22.04:LTSlinux-gcp-6.86.8.0-1017.19~22.04.1UBUNTU-CVE-2024-43855
Ubuntu:24.04:LTSlinux-gke6.8.0-1013.17UBUNTU-CVE-2024-43855
Ubuntu:24.04:LTSlinux-gkeop6.8.0-1002.4UBUNTU-CVE-2024-43855
Ubuntu:22.04:LTSlinux-hwe-5.19no fix listedUBUNTU-CVE-2024-43855
Ubuntu:22.04:LTSlinux-hwe-6.2no fix listedUBUNTU-CVE-2024-43855
Ubuntu:22.04:LTSlinux-hwe-6.5no fix listedUBUNTU-CVE-2024-43855
Ubuntu:22.04:LTSlinux-hwe-6.86.8.0-48.48~22.04.1UBUNTU-CVE-2024-43855
Ubuntu:24.04:LTSlinux-ibm6.8.0-1015.15UBUNTU-CVE-2024-43855
Ubuntu:22.04:LTSlinux-intel-iot-realtimeno fix listedUBUNTU-CVE-2024-43855
Ubuntu:24.04:LTSlinux-lowlatency6.8.0-48.48.3UBUNTU-CVE-2024-43855
Ubuntu:22.04:LTSlinux-lowlatency-hwe-5.19no fix listedUBUNTU-CVE-2024-43855
Ubuntu:22.04:LTSlinux-lowlatency-hwe-6.2no fix listedUBUNTU-CVE-2024-43855
Ubuntu:22.04:LTSlinux-lowlatency-hwe-6.5no fix listedUBUNTU-CVE-2024-43855
Ubuntu:22.04:LTSlinux-lowlatency-hwe-6.86.8.0-48.48.3~22.04.1UBUNTU-CVE-2024-43855
Ubuntu:24.04:LTSlinux-nvidia6.8.0-1017.19UBUNTU-CVE-2024-43855
Ubuntu:22.04:LTSlinux-nvidia-6.2no fix listedUBUNTU-CVE-2024-43855
Ubuntu:22.04:LTSlinux-nvidia-6.5no fix listedUBUNTU-CVE-2024-43855
Ubuntu:22.04:LTSlinux-nvidia-6.86.8.0-1017.19~22.04.1UBUNTU-CVE-2024-43855
Ubuntu:24.04:LTSlinux-nvidia-lowlatency6.8.0-1017.19.1UBUNTU-CVE-2024-43855
Ubuntu:22.04:LTSlinux-oem-5.17no fix listedUBUNTU-CVE-2024-43855
Ubuntu:22.04:LTSlinux-oem-6.0no fix listedUBUNTU-CVE-2024-43855
Ubuntu:22.04:LTSlinux-oem-6.1no fix listedUBUNTU-CVE-2024-43855
Ubuntu:22.04:LTSlinux-oem-6.5no fix listedUBUNTU-CVE-2024-43855
Ubuntu:24.04:LTSlinux-oem-6.86.8.0-1016.16UBUNTU-CVE-2024-43855
Ubuntu:24.04:LTSlinux-oracle6.8.0-1015.16UBUNTU-CVE-2024-43855
Ubuntu:22.04:LTSlinux-oracle-6.5no fix listedUBUNTU-CVE-2024-43855
Ubuntu:22.04:LTSlinux-oracle-6.86.8.0-1015.15~22.04.1UBUNTU-CVE-2024-43855
Ubuntu:24.04:LTSlinux-raspi6.8.0-1014.16UBUNTU-CVE-2024-43855
Ubuntu:22.04:LTSlinux-realtimeno fix listedUBUNTU-CVE-2024-43855
Ubuntu:22.04:LTSlinux-riscvno fix listedUBUNTU-CVE-2024-43855
Ubuntu:24.04:LTSlinux-riscv6.8.0-48.48.1UBUNTU-CVE-2024-43855
Ubuntu:22.04:LTSlinux-riscv-5.19no fix listedUBUNTU-CVE-2024-43855
Ubuntu:22.04:LTSlinux-riscv-6.5no fix listedUBUNTU-CVE-2024-43855
Ubuntu:22.04:LTSlinux-riscv-6.86.8.0-48.48.1~22.04.2UBUNTU-CVE-2024-43855
Ubuntu:22.04:LTSlinux-starfive-5.19no fix listedUBUNTU-CVE-2024-43855
Ubuntu:22.04:LTSlinux-starfive-6.2no fix listedUBUNTU-CVE-2024-43855
Ubuntu:22.04:LTSlinux-starfive-6.5no fix listedUBUNTU-CVE-2024-43855

Affected products (as reported)

VendorProductVersions
Linux Linux f9f2d957a8ea93c73182aebf7de30935a58c027d – before 32226070813140234b6c507084738e8e8385c5c6530cec617f5a8ba6f26bcbf0d64d75c951d17730 – before 2d0738a8322bf4e5bfe693d16b3111928a9ccfbffa2bbff7b0b4e211fec5e5686ef96350690597b5 – before ca963eefbc3331222b6121baa696d49ba2008811fa2bbff7b0b4e211fec5e5686ef96350690597b5 – before 611d5cbc0b35a752e657a83eebadf40d814d006bc4c2345214b66e2505a26fd2ea58839dd7a1d48d6.1.75 – before 6.1.1036.6.14 – before 6.6.446.7.2 – before 6.8
Linux Linux 6.8

References