Vulnerability · Published Jul 5, 2024 · Assigned by Linux
CVE-2024-39476md/raid5: fix deadlock that raid5d() wait for itself to clear MD_SB_CHANGE_PENDING
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 7% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
In the Linux kernel, the following vulnerability has been resolved: md/raid5: fix deadlock that raid5d() wait for itself to clear MD_SB_CHANGE_PENDING Xiao reported that lvm2 test lvconvert-raid-takeover.sh can hang with small possibility, the root cause is exactly the same as commit bed9e27baf52 ("Revert "md/raid5: Wait for MD_SB_CHANGE_PENDING in raid5d"") However, Dan reported another hang after that, and junxiao investigated the problem and found out that this is caused by plugged bio can't issue from raid5d(). Current implementation in raid5d() has a weird dependence: 1) md_check_recovery() from raid5d() must hold 'reconfig_mutex' to clear MD_SB_CHANGE_PENDING; 2) raid5d() handles IO in a deadloop, until all IO are issued; 3) IO from raid5d() must wait for MD_SB_CHANGE_PENDING to be cleared; This behaviour is introduce before v2.6, and for consequence, if other context hold 'reconfig_mutex', and md_check_recovery() can't update super_block, then raid5d() will waste one cpu 100% by the deadloop, until 'reconfig_mutex' is released. Refer to the implementation from raid1 and raid10, fix this problem by skipping issue IO if MD_SB_CHANGE_PENDING is still set after md_check_recovery(), daemon thread will be woken up when 'reconfig_mutex' is released. Meanwhile, the hang problem will be fixed as well.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| AlmaLinux:9 | bpftool | 7.3.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-64k | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-64k-core | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-64k-debug | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-64k-debug-core | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-64k-debug-devel | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-64k-debug-devel-matched | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-64k-debug-modules | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-64k-debug-modules-core | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-64k-debug-modules-extra | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-64k-devel | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-64k-devel-matched | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-64k-modules | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-64k-modules-core | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-64k-modules-extra | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-abi-stablelists | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-core | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-cross-headers | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-debug | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-debug-core | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-debug-devel | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-debug-devel-matched | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-debug-modules | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-debug-modules-core | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-debug-modules-extra | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-debug-uki-virt | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-devel | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-devel-matched | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-doc | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-headers | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-modules | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-modules-core | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-modules-extra | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-rt | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-rt-core | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-rt-debug | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-rt-debug-core | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-rt-debug-devel | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-rt-debug-modules | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-rt-debug-modules-core | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-rt-debug-modules-extra | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-rt-devel | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-rt-modules | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-rt-modules-core | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-rt-modules-extra | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-tools | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-tools-libs | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-tools-libs-devel | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-uki-virt | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-zfcpdump | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-zfcpdump-core | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-zfcpdump-devel | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-zfcpdump-devel-matched | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-zfcpdump-modules | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-zfcpdump-modules-core | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-zfcpdump-modules-extra | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | libperf | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | perf | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | python3-perf | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | rtla | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | rv | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| Debian:12 | linux | 6.1.94-1 | DEBIAN-CVE-2024-39476 |
| Debian:13 | linux | 6.9.7-1 | DEBIAN-CVE-2024-39476 |
| Debian:14 | linux | 6.9.7-1 | DEBIAN-CVE-2024-39476 |
| Ubuntu:22.04:LTS | linux | 5.15.0-102.112 | UBUNTU-CVE-2024-39476 |
| Ubuntu:22.04:LTS | linux-allwinner-5.19 | no fix listed | UBUNTU-CVE-2024-39476 |
| Ubuntu:22.04:LTS | linux-aws | 5.15.0-1057.63 | UBUNTU-CVE-2024-39476 |
| Ubuntu:22.04:LTS | linux-aws-5.19 | no fix listed | UBUNTU-CVE-2024-39476 |
| Ubuntu:22.04:LTS | linux-aws-6.2 | no fix listed | UBUNTU-CVE-2024-39476 |
| Ubuntu:22.04:LTS | linux-aws-6.5 | no fix listed | UBUNTU-CVE-2024-39476 |
| Ubuntu:22.04:LTS | linux-azure | 5.15.0-1060.69 | UBUNTU-CVE-2024-39476 |
| Ubuntu:22.04:LTS | linux-azure-5.19 | no fix listed | UBUNTU-CVE-2024-39476 |
| Ubuntu:22.04:LTS | linux-azure-6.2 | no fix listed | UBUNTU-CVE-2024-39476 |
| Ubuntu:22.04:LTS | linux-azure-6.5 | no fix listed | UBUNTU-CVE-2024-39476 |
| Ubuntu:22.04:LTS | linux-azure-fde | 5.15.0-1060.69.1 | UBUNTU-CVE-2024-39476 |
| Ubuntu:22.04:LTS | linux-azure-fde-5.19 | no fix listed | UBUNTU-CVE-2024-39476 |
| Ubuntu:22.04:LTS | linux-azure-fde-6.2 | no fix listed | UBUNTU-CVE-2024-39476 |
| Ubuntu:22.04:LTS | linux-gcp | 5.15.0-1055.63 | UBUNTU-CVE-2024-39476 |
| Ubuntu:22.04:LTS | linux-gcp-5.19 | no fix listed | UBUNTU-CVE-2024-39476 |
| Ubuntu:22.04:LTS | linux-gcp-6.2 | no fix listed | UBUNTU-CVE-2024-39476 |
| Ubuntu:22.04:LTS | linux-gcp-6.5 | no fix listed | UBUNTU-CVE-2024-39476 |
| Ubuntu:22.04:LTS | linux-gke | 5.15.0-1054.59 | UBUNTU-CVE-2024-39476 |
| Ubuntu:22.04:LTS | linux-gkeop | 5.15.0-1040.46 | UBUNTU-CVE-2024-39476 |
| Ubuntu:22.04:LTS | linux-hwe-5.19 | no fix listed | UBUNTU-CVE-2024-39476 |
| Ubuntu:22.04:LTS | linux-hwe-6.2 | no fix listed | UBUNTU-CVE-2024-39476 |
| Ubuntu:22.04:LTS | linux-hwe-6.5 | no fix listed | UBUNTU-CVE-2024-39476 |
| Ubuntu:22.04:LTS | linux-ibm | 5.15.0-1050.53 | UBUNTU-CVE-2024-39476 |
| Ubuntu:22.04:LTS | linux-intel-iotg | 5.15.0-1052.58 | UBUNTU-CVE-2024-39476 |
| Ubuntu:22.04:LTS | linux-kvm | 5.15.0-1054.59 | UBUNTU-CVE-2024-39476 |
| Ubuntu:22.04:LTS | linux-lowlatency | 5.15.0-102.112 | UBUNTU-CVE-2024-39476 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-5.19 | no fix listed | UBUNTU-CVE-2024-39476 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.2 | no fix listed | UBUNTU-CVE-2024-39476 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.5 | no fix listed | UBUNTU-CVE-2024-39476 |
| Ubuntu:22.04:LTS | linux-nvidia | 5.15.0-1048.48 | UBUNTU-CVE-2024-39476 |
| Ubuntu:22.04:LTS | linux-nvidia-6.2 | no fix listed | UBUNTU-CVE-2024-39476 |
| Ubuntu:22.04:LTS | linux-nvidia-6.5 | no fix listed | UBUNTU-CVE-2024-39476 |
| Ubuntu:22.04:LTS | linux-nvidia-tegra | 5.15.0-1025.25 | UBUNTU-CVE-2024-39476 |
| Ubuntu:22.04:LTS | linux-nvidia-tegra-igx | 5.15.0-1012.12 | UBUNTU-CVE-2024-39476 |
| Ubuntu:22.04:LTS | linux-oem-5.17 | no fix listed | UBUNTU-CVE-2024-39476 |
| Ubuntu:22.04:LTS | linux-oem-6.0 | no fix listed | UBUNTU-CVE-2024-39476 |
| Ubuntu:22.04:LTS | linux-oem-6.1 | no fix listed | UBUNTU-CVE-2024-39476 |
| Ubuntu:22.04:LTS | linux-oem-6.5 | no fix listed | UBUNTU-CVE-2024-39476 |
| Ubuntu:22.04:LTS | linux-oracle | 5.15.0-1055.61 | UBUNTU-CVE-2024-39476 |
| Ubuntu:22.04:LTS | linux-oracle-6.5 | no fix listed | UBUNTU-CVE-2024-39476 |
| Ubuntu:22.04:LTS | linux-raspi | 5.15.0-1050.53 | UBUNTU-CVE-2024-39476 |
| Ubuntu:22.04:LTS | linux-realtime | no fix listed | UBUNTU-CVE-2024-39476 |
| Ubuntu:22.04:LTS | linux-riscv | no fix listed | UBUNTU-CVE-2024-39476 |
| Ubuntu:22.04:LTS | linux-riscv-5.19 | no fix listed | UBUNTU-CVE-2024-39476 |
| Ubuntu:22.04:LTS | linux-riscv-6.5 | no fix listed | UBUNTU-CVE-2024-39476 |
| Ubuntu:22.04:LTS | linux-starfive-5.19 | no fix listed | UBUNTU-CVE-2024-39476 |
| Ubuntu:22.04:LTS | linux-starfive-6.2 | no fix listed | UBUNTU-CVE-2024-39476 |
| Ubuntu:22.04:LTS | linux-starfive-6.5 | no fix listed | UBUNTU-CVE-2024-39476 |
| Ubuntu:22.04:LTS | linux-xilinx-zynqmp | 5.15.0-1030.34 | UBUNTU-CVE-2024-39476 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| Linux | Linux | f3d55bd5b7b928ad82f8075d89c908702f3593ab – before b32aa95843cac6b12c2c014d40fca18aef24a3471c00bb624cd084e2006520ad0edacaff0fb941c4 – before 634ba3c97ec413cb10681c7b196db43ee461ecf4782b3e71c957991ac8ae53318bc369049d49bb53 – before aa64464c8f4d2ab92f6d0b959a1e0767b829d7879e86dffd0b02594d2e7c60c6db9e889c0395414b – before 098d54934814dd876963abfe751c3b1cf7fbe56a5e2cf333b7bd5d3e62595a44d598a254c697cd74 – before 3f8d5e802d4cedd445f9a89be8c3fd2d0e99024b5e2cf333b7bd5d3e62595a44d598a254c697cd74 – before cd2538e5af495b3c747e503db346470fc1ffc4475e2cf333b7bd5d3e62595a44d598a254c697cd74 – before e332a12f65d8fed8cf63bedb4e9317bb872b9ac75e2cf333b7bd5d3e62595a44d598a254c697cd74 – before 151f66bb618d1fd0eeb84acb61b4a9fa5d8bb0fa |
| Linux | Linux | 6.1 |
References
- https://git.kernel.org/stable/c/b32aa95843cac6b12c2c014d40fca18aef24a347
- https://git.kernel.org/stable/c/634ba3c97ec413cb10681c7b196db43ee461ecf4
- https://git.kernel.org/stable/c/aa64464c8f4d2ab92f6d0b959a1e0767b829d787
- https://git.kernel.org/stable/c/098d54934814dd876963abfe751c3b1cf7fbe56a
- https://git.kernel.org/stable/c/3f8d5e802d4cedd445f9a89be8c3fd2d0e99024b
- https://git.kernel.org/stable/c/cd2538e5af495b3c747e503db346470fc1ffc447
- https://git.kernel.org/stable/c/e332a12f65d8fed8cf63bedb4e9317bb872b9ac7
- https://git.kernel.org/stable/c/151f66bb618d1fd0eeb84acb61b4a9fa5d8bb0fa