Skip to content
OpenAdvisories
Medium · 5.5 CVE-2022-50381 EUVD-2025-29984GHSA-qr3p-w2mh-mg9q

md: fix a crash in mempool_free

Published Sep 18, 2025 · Updated May 11, 2026 · Assigned by Linux

Vendor: Linux Product: Linux Package: linux Package: linux Package: linux-allwinner-5.19 Package: linux-aws Package: linux-aws-5.0 Package: linux-aws-5.11 Package: linux-aws-5.13 Package: linux-aws-5.15 Package: linux-aws-5.19 Package: linux-aws-5.3 Package: linux-aws-5.4 Package: linux-aws-5.8 Package: linux-aws-6.2 Package: linux-aws-6.5 Package: linux-aws-fips Package: linux-aws-hwe Package: linux-azure Package: linux-azure-4.15 Package: linux-azure-5.11 Package: linux-azure-5.13 Package: linux-azure-5.15 Package: linux-azure-5.19 Package: linux-azure-5.3 Package: linux-azure-5.4 Package: linux-azure-5.8 Package: linux-azure-6.11 Package: linux-azure-6.2 Package: linux-azure-6.5 Package: linux-azure-edge Package: linux-azure-fde Package: linux-azure-fde-5.19 Package: linux-azure-fde-6.2 Package: linux-azure-fips Package: linux-bluefield Package: linux-fips Package: linux-gcp Package: linux-gcp-4.15 Package: linux-gcp-5.11 Package: linux-gcp-5.13 Package: linux-gcp-5.15 Package: linux-gcp-5.19 Package: linux-gcp-5.3 Package: linux-gcp-5.4 Package: linux-gcp-5.8 Package: linux-gcp-6.11 Package: linux-gcp-6.2 Package: linux-gcp-6.5 Package: linux-gcp-fips Package: linux-gke Package: linux-gke-4.15 Package: linux-gke-5.15 Package: linux-gke-5.4 Package: linux-gkeop Package: linux-gkeop-5.15 Package: linux-gkeop-5.4 Package: linux-hwe Package: linux-hwe-5.11 Package: linux-hwe-5.13 Package: linux-hwe-5.15 Package: linux-hwe-5.19 Package: linux-hwe-5.4 Package: linux-hwe-5.8 Package: linux-hwe-6.11 Package: linux-hwe-6.2 Package: linux-hwe-6.5 Package: linux-hwe-edge Package: linux-ibm Package: linux-ibm-5.4 Package: linux-intel Package: linux-intel-5.13 Package: linux-intel-iot-realtime Package: linux-intel-iotg Package: linux-intel-iotg-5.15 Package: linux-iot Package: linux-kvm Package: linux-lowlatency Package: linux-lowlatency-hwe-5.15 Package: linux-lowlatency-hwe-5.19 Package: linux-lowlatency-hwe-6.11 Package: linux-lowlatency-hwe-6.2 Package: linux-lowlatency-hwe-6.5 Package: linux-lts-xenial Package: linux-nvidia Package: linux-nvidia-6.2 Package: linux-nvidia-6.5 Package: linux-nvidia-tegra-5.15 Package: linux-oem Package: linux-oem-5.10 Package: linux-oem-5.13 Package: linux-oem-5.14 Package: linux-oem-5.17 Package: linux-oem-5.6 Package: linux-oem-6.0 Package: linux-oem-6.1 Package: linux-oem-6.11 Package: linux-oem-6.5 Package: linux-oem-6.8 Package: linux-oracle Package: linux-oracle-5.0 Package: linux-oracle-5.11 Package: linux-oracle-5.13 Package: linux-oracle-5.15 Package: linux-oracle-5.3 Package: linux-oracle-5.4 Package: linux-oracle-5.8 Package: linux-oracle-6.5 Package: linux-raspi Package: linux-raspi-5.4 Package: linux-raspi-realtime Package: linux-raspi2 Package: linux-realtime Package: linux-riscv Package: linux-riscv-5.11 Package: linux-riscv-5.15 Package: linux-riscv-5.19 Package: linux-riscv-5.8 Package: linux-riscv-6.5 Package: linux-starfive-5.19 Package: linux-starfive-6.2 Package: linux-starfive-6.5 Package: linux-vmware Package: linux-xilinx-zynqmp Platform: Linux Ecosystem: Debian Ecosystem: Ubuntu

Description

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

md: fix a crash in mempool_free

There's a crash in mempool_free when running the lvm test
shell/lvchange-rebuild-raid.sh.

The reason for the crash is this:
* super_written calls atomic_dec_and_test(&mddev->pending_writes) and
wake_up(&mddev->sb_wait). Then it calls rdev_dec_pending(rdev, mddev)
and bio_put(bio).
* so, the process that waited on sb_wait and that is woken up is racing
with bio_put(bio).
* if the process wins the race, it calls bioset_exit before bio_put(bio)
is executed.
* bio_put(bio) attempts to free a bio into a destroyed bio set - causing
a crash in mempool_free.

We fix this bug by moving bio_put before atomic_dec_and_test.

We also move rdev_dec_pending before atomic_dec_and_test as suggested by
Neil Brown.

The function md_end_flush has a similar bug - we must call bio_put before
we decrement the number of in-progress bios.

BUG: kernel NULL pointer dereference, address: 0000000000000000
#PF: supervisor write access in kernel mode
#PF: error_code(0x0002) - not-present page
PGD 11557f0067 P4D 11557f0067 PUD 0
Oops: 0002 [#1] PREEMPT SMP
CPU: 0 PID: 73 Comm: kworker/0:1 Not tainted 6.1.0-rc3 #5
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.14.0-2 04/01/2014
Workqueue: kdelayd flush_expired_bios [dm_delay]
RIP: 0010:mempool_free+0x47/0x80
Code: 48 89 ef 5b 5d ff e0 f3 c3 48 89 f7 e8 32 45 3f 00 48 63 53 08 48 89 c6 3b 53 04 7d 2d 48 8b 43 10 8d 4a 01 48 89 df 89 4b 08 <48> 89 2c d0 e8 b0 45 3f 00 48 8d 7b 30 5b 5d 31 c9 ba 01 00 00 00
RSP: 0018:ffff88910036bda8 EFLAGS: 00010093
RAX: 0000000000000000 RBX: ffff8891037b65d8 RCX: 0000000000000001
RDX: 0000000000000000 RSI: 0000000000000202 RDI: ffff8891037b65d8
RBP: ffff8891447ba240 R08: 0000000000012908 R09: 00000000003d0900
R10: 0000000000000000 R11: 0000000000173544 R12: ffff889101a14000
R13: ffff8891562ac300 R14: ffff889102b41440 R15: ffffe8ffffa00d05
FS: 0000000000000000(0000) GS:ffff88942fa00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 0000001102e99000 CR4: 00000000000006b0
Call Trace:
<TASK>
clone_endio+0xf4/0x1c0 [dm_mod]
clone_endio+0xf4/0x1c0 [dm_mod]
__submit_bio+0x76/0x120
submit_bio_noacct_nocheck+0xb6/0x2a0
flush_expired_bios+0x28/0x2f [dm_delay]
process_one_work+0x1b4/0x300
worker_thread+0x45/0x3e0
? rescuer_thread+0x380/0x380
kthread+0xc2/0x100
? kthread_complete_and_exit+0x20/0x20
ret_from_fork+0x1f/0x30
</TASK>
Modules linked in: brd dm_delay dm_raid dm_mod af_packet uvesafb cfbfillrect cfbimgblt cn cfbcopyarea fb font fbdev tun autofs4 binfmt_misc configfs ipv6 virtio_rng virtio_balloon rng_core virtio_net pcspkr net_failover failover qemu_fw_cfg button mousedev raid10 raid456 libcrc32c async_raid6_recov async_memcpy async_pq raid6_pq async_xor xor async_tx raid1 raid0 md_mod sd_mod t10_pi crc64_rocksoft crc64 virtio_scsi scsi_mod evdev psmouse bsg scsi_common [last unloaded: brd]
CR2: 0000000000000000
---[ end trace 0000000000000000 ]---

Affected products

VendorProductAffectedFixed
Linux Linux 2.6.13 4.9.337

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Debian 14 linux 6.1.4-1 —
Debian 13 linux 6.1.4-1 —
Debian 12 linux 6.1.4-1 —
ReleasePackageFixed inAdvisory
Ubuntu Nvidia-BlueField 22.04 LTS linux-bluefield 5.15.0-1015.17 —
Ubuntu 24.04 LTS linux-intel +9 No fix yet —
Ubuntu 22.04 LTS linux +1 5.15.0-69.76 —
Ubuntu 22.04 LTS linux-aws 5.15.0-1033.37 —
Ubuntu 22.04 LTS linux-azure 5.15.0-1035.42 —
Ubuntu 22.04 LTS linux-azure-fde 5.15.0-1035.42.1 —
Ubuntu 22.04 LTS linux-gcp 5.15.0-1031.38 —
Ubuntu 22.04 LTS linux-gke +1 5.15.0-1030.35 —
Ubuntu 22.04 LTS linux-gkeop 5.15.0-1017.22 —
Ubuntu 22.04 LTS linux-ibm 5.15.0-1027.30 —
Ubuntu 22.04 LTS linux-intel-iotg 5.15.0-1027.32 —
Ubuntu 22.04 LTS linux-nvidia 5.15.0-1023.23 —
Ubuntu 22.04 LTS linux-oracle 5.15.0-1032.38 —
Ubuntu 22.04 LTS linux-raspi 5.15.0-1026.28 —
Ubuntu 22.04 LTS linux-riscv +32 No fix yet —
Ubuntu 20.04 LTS linux 5.4.0-144.161 —
Ubuntu 20.04 LTS linux-aws 5.4.0-1097.105 —
Ubuntu 20.04 LTS linux-aws-5.15 5.15.0-1033.37~20.04.1 —
Ubuntu 20.04 LTS linux-azure 5.4.0-1104.110 —
Ubuntu 20.04 LTS linux-azure-5.15 5.15.0-1035.42~20.04.1 —
Ubuntu 20.04 LTS linux-bluefield 5.4.0-1059.65 —
Ubuntu 20.04 LTS linux-gcp 5.4.0-1101.110 —
Ubuntu 20.04 LTS linux-gcp-5.15 5.15.0-1031.38~20.04.1 —
Ubuntu 20.04 LTS linux-gke +28 No fix yet —
Ubuntu 20.04 LTS linux-hwe-5.15 +1 5.15.0-69.76~20.04.1 —
Ubuntu 20.04 LTS linux-ibm 5.4.0-1045.50 —
Ubuntu 20.04 LTS linux-intel-iotg-5.15 5.15.0-1027.32~20.04.1 —
Ubuntu 20.04 LTS linux-iot 5.4.0-1013.15 —
Ubuntu 20.04 LTS linux-kvm 5.4.0-1087.93 —
Ubuntu 20.04 LTS linux-nvidia-tegra-5.15 5.15.0-1014.14~20.04.1 —
Ubuntu 20.04 LTS linux-oracle 5.4.0-1094.103 —
Ubuntu 20.04 LTS linux-oracle-5.15 5.15.0-1032.38~20.04.1 —
Ubuntu 20.04 LTS linux-raspi 5.4.0-1081.92 —
Ubuntu 20.04 LTS linux-riscv-5.15 5.15.0-1030.34~20.04.1 —
Ubuntu 20.04 LTS linux-xilinx-zynqmp 5.4.0-1022.26 —
Ubuntu 18.04 LTS linux 4.15.0-208.220 —
Ubuntu 18.04 LTS linux-aws 4.15.0-1153.166 —
Ubuntu 18.04 LTS linux-aws-5.4 5.4.0-1097.105~18.04.1 —
Ubuntu 18.04 LTS linux-azure-4.15 4.15.0-1162.177 —
Ubuntu 18.04 LTS linux-azure-5.4 5.4.0-1104.110~18.04.1 —
Ubuntu 18.04 LTS linux-gcp +14 No fix yet —
Ubuntu 18.04 LTS linux-gcp-4.15 4.15.0-1147.163 —
Ubuntu 18.04 LTS linux-gcp-5.4 5.4.0-1101.110~18.04.1 —
Ubuntu 18.04 LTS linux-hwe-5.4 5.4.0-144.161~18.04.1 —
Ubuntu 18.04 LTS linux-ibm-5.4 5.4.0-1045.50~18.04.1 —
Ubuntu 18.04 LTS linux-kvm 4.15.0-1137.142 —
Ubuntu 18.04 LTS linux-oracle 4.15.0-1116.127 —
Ubuntu 18.04 LTS linux-oracle-5.4 5.4.0-1094.103~18.04.1 —
Ubuntu 18.04 LTS linux-raspi-5.4 5.4.0-1081.92~18.04.1 —
Show 10 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Ubuntu 16.04 LTS linux-hwe-edge No fix yet —
Ubuntu Pro Realtime 22.04 LTS linux-intel-iot-realtime 5.15.0-1023.28 —
Ubuntu Pro Realtime 22.04 LTS linux-realtime 5.15.0-1034.37 —
Ubuntu Pro FIPS 20.04 LTS linux-fips +3 No fix yet —
Ubuntu Pro FIPS 18.04 LTS linux-fips +3 No fix yet —
Ubuntu Pro FIPS 16.04 LTS linux-fips No fix yet —
Ubuntu Pro FIPS-updates 20.04 LTS linux-aws-fips 5.4.0-1099.107+fips1 —
Ubuntu Pro FIPS-updates 20.04 LTS linux-azure-fips 5.4.0-1104.110+fips1 —
Ubuntu Pro FIPS-updates 20.04 LTS linux-fips 5.4.0-1073.82 —
Ubuntu Pro FIPS-updates 20.04 LTS linux-gcp-fips 5.4.0-1101.110+fips1 —
Ubuntu Pro FIPS-updates 18.04 LTS linux-aws-fips 4.15.0-2092.98 —
Ubuntu Pro FIPS-updates 18.04 LTS linux-azure-fips 4.15.0-2071.77 —
Ubuntu Pro FIPS-updates 18.04 LTS linux-fips 4.15.0-1108.119 —
Ubuntu Pro FIPS-updates 18.04 LTS linux-gcp-fips 4.15.0-2055.60 —
Ubuntu Pro FIPS-updates 16.04 LTS linux-fips No fix yet —
Ubuntu Pro 16.04 LTS linux +2 No fix yet —
Ubuntu Pro 16.04 LTS linux-aws-hwe 4.15.0-1153.166~16.04.1 —
Ubuntu Pro 16.04 LTS linux-azure 4.15.0-1162.177~16.04.1 —
Ubuntu Pro 16.04 LTS linux-gcp 4.15.0-1147.163~16.04.1 —
Ubuntu Pro 16.04 LTS linux-hwe 4.15.0-208.219~16.04.1 —
Ubuntu Pro 16.04 LTS linux-oracle 4.15.0-1116.127~16.04.1 —
Ubuntu Pro 14.04 LTS linux +2 No fix yet —
Ubuntu Pro 14.04 LTS linux-azure 4.15.0-1162.177~14.04.1 —
ReleasePackageFixed inAdvisory
RHEL 9 bpftool 7.0.0-284.11.1.el9_2 RHSA-2023:2458
RHEL 9 perf +48 5.14.0-284.11.1.el9_2 RHSA-2023:2458
RHEL 8 perf +26 4.18.0-477.10.1.el8_8 RHSA-2023:2951
ReleasePackageFixed inAdvisory
SLES 15 SP5 kernel-64kb +6 5.14.21-150500.55.124.1 SUSE-SU-2025:03615-1
SLES 15 SP5 kernel-default-base 5.14.21-150500.55.124.1.150500.6.59.1 SUSE-SU-2025:03615-1
SLES 15 SP4 kernel-64kb +6 5.14.21-150400.24.179.1 SUSE-SU-2025:03628-1
SLES 15 SP4 kernel-default-base 5.14.21-150400.24.179.1.150400.24.92.1 SUSE-SU-2025:03628-1
SLES 15 SP3 kernel-64kb +7 5.3.18-150300.59.221.1 SUSE-SU-2025:03626-1
SLES 15 SP3 kernel-default-base 5.3.18-150300.59.221.1.150300.18.132.1 SUSE-SU-2025:03626-1
SLES 12 SP5 kernel-syms +2 4.12.14-122.275.1 SUSE-SU-2025:03614-1
SLES 11 SP4 kernel-ec2 +6 3.0.101-108.192.1 SUSE-SU-2025:4315-1
Show 18 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
SLES for SAP 15 SP5 kernel-default-base 5.14.21-150500.55.124.1.150500.6.59.1 SUSE-SU-2025:03615-1
SLES for SAP 15 SP5 kernel-docs +4 5.14.21-150500.55.124.1 SUSE-SU-2025:03615-1
SLES for SAP 15 SP4 kernel-default-base 5.14.21-150400.24.179.1.150400.24.92.1 SUSE-SU-2025:03628-1
SLES for SAP 15 SP4 kernel-docs +4 5.14.21-150400.24.179.1 SUSE-SU-2025:03628-1
SLES for SAP 15 SP3 kernel-default-base 5.3.18-150300.59.221.1.150300.18.132.1 SUSE-SU-2025:03626-1
SLES for SAP 15 SP3 kernel-docs +5 5.3.18-150300.59.221.1 SUSE-SU-2025:03626-1
SLE Micro 5.5 kernel-default-base 5.14.21-150500.55.124.1.150500.6.59.1 SUSE-SU-2025:03615-1
SLE Micro 5.5 kernel-rt +1 5.14.21-150500.13.109.1 SUSE-SU-2025:3761-1
SLE Micro 5.5 kernel-source +1 5.14.21-150500.55.124.1 SUSE-SU-2025:03615-1
SLE Micro 5.4 kernel-default 5.14.21-150400.24.179.1 SUSE-SU-2025:03628-1
SLE Micro 5.4 kernel-default-base 5.14.21-150400.24.179.1.150400.24.92.1 SUSE-SU-2025:03628-1
SLE Micro 5.4 kernel-rt +1 5.14.21-150400.15.133.1 SUSE-SU-2025:3716-1
SLE Micro 5.3 kernel-default 5.14.21-150400.24.179.1 SUSE-SU-2025:03628-1
SLE Micro 5.3 kernel-default-base 5.14.21-150400.24.179.1.150400.24.92.1 SUSE-SU-2025:03628-1
SLE Micro 5.3 kernel-rt +1 5.14.21-150400.15.133.1 SUSE-SU-2025:3716-1
SLE Micro 5.2 kernel-default 5.3.18-150300.59.221.1 SUSE-SU-2025:03626-1
SLE Micro 5.2 kernel-default-base 5.3.18-150300.59.221.1.150300.18.132.1 SUSE-SU-2025:03626-1
SLE Micro 5.2 kernel-rt +1 5.3.18-150300.223.1 SUSE-SU-2025:03613-1
SLE Micro 5.1 kernel-default 5.3.18-150300.59.221.1 SUSE-SU-2025:03626-1
SLE Micro 5.1 kernel-default-base 5.3.18-150300.59.221.1.150300.18.132.1 SUSE-SU-2025:03626-1
SLE Micro 5.1 kernel-rt +1 5.3.18-150300.223.1 SUSE-SU-2025:03613-1
SLE Live Patching 15 SP5 kernel-default 5.14.21-150500.55.124.1 SUSE-SU-2025:03615-1
SLE Live Patching 15 SP5 kernel-livepatch-SLE15-SP5_Update_31 1-150500.11.3.1 SUSE-SU-2025:03615-1
SLE Live Patching 15 SP4 kernel-default 5.14.21-150400.24.179.1 SUSE-SU-2025:03628-1
SLE Live Patching 15 SP4 kernel-livepatch-SLE15-SP4_Update_45 1-150400.9.3.1 SUSE-SU-2025:03628-1
SLE Live Patching 15 SP3 kernel-default 5.3.18-150300.59.221.1 SUSE-SU-2025:03626-1
SLE Live Patching 15 SP3 kernel-livepatch-SLE15-SP3_Update_62 1-150300.7.3.1 SUSE-SU-2025:03626-1
SLE Live Patching 12 SP5 kernel-default 4.12.14-122.275.1 SUSE-SU-2025:03614-1
SLE Live Patching 12 SP5 kgraft-patch-SLE12-SP5_Update_73 1-8.3.1 SUSE-SU-2025:03614-1
SLE HPC 15 SP5 kernel-64kb +5 5.14.21-150500.55.124.1 SUSE-SU-2025:03615-1
SLE HPC 15 SP5 kernel-default-base 5.14.21-150500.55.124.1.150500.6.59.1 SUSE-SU-2025:03615-1
SLE HPC 15 SP4 kernel-64kb +5 5.14.21-150400.24.179.1 SUSE-SU-2025:03628-1
SLE HPC 15 SP4 kernel-default-base 5.14.21-150400.24.179.1.150400.24.92.1 SUSE-SU-2025:03628-1
SLE HPC 15 SP3 kernel-64kb +6 5.3.18-150300.59.221.1 SUSE-SU-2025:03626-1
SLE HPC 15 SP3 kernel-default-base 5.3.18-150300.59.221.1.150300.18.132.1 SUSE-SU-2025:03626-1
SUSE Manager Server LTS 4.3 kernel-default-base 5.14.21-150400.24.179.1.150400.24.92.1 SUSE-SU-2025:03628-1
SUSE Manager Server LTS 4.3 kernel-syms +3 5.14.21-150400.24.179.1 SUSE-SU-2025:03628-1
SUSE Manager Proxy LTS 4.3 kernel-default-base 5.14.21-150400.24.179.1.150400.24.92.1 SUSE-SU-2025:03628-1
SUSE Manager Proxy LTS 4.3 kernel-syms +2 5.14.21-150400.24.179.1 SUSE-SU-2025:03628-1
SUSE Enterprise Storage 7.1 kernel-64kb +6 5.3.18-150300.59.221.1 SUSE-SU-2025:03626-1
SUSE Enterprise Storage 7.1 kernel-default-base 5.3.18-150300.59.221.1.150300.18.132.1 SUSE-SU-2025:03626-1

Amazon Linux

ReleasePackageFixed inAdvisory
Amazon Linux 2 kernel-livepatch-4.14.304-226.531 1.0-0.amzn2 ALAS2-2023-1932
Amazon Linux 2 perf +8 4.14.304-226.531.amzn2 ALAS2-2023-1932

Advisories 13

References