Skip to content
OpenAdvisories
Unscored CVE-2021-47435 EUVD-2021-34440GHSA-3c5v-hp3x-r94q

dm: fix mempool NULL pointer race when completing IO

Published May 22, 2024 · 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.19 Package: linux-aws-5.3 Package: linux-aws-5.4 Package: linux-aws-5.8 Package: linux-aws-6.2 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.19 Package: linux-azure-5.3 Package: linux-azure-5.4 Package: linux-azure-5.8 Package: linux-azure-6.2 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.19 Package: linux-gcp-5.3 Package: linux-gcp-5.4 Package: linux-gcp-5.8 Package: linux-gcp-6.2 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.4 Package: linux-hwe Package: linux-hwe-5.11 Package: linux-hwe-5.13 Package: linux-hwe-5.19 Package: linux-hwe-5.4 Package: linux-hwe-5.8 Package: linux-hwe-6.2 Package: linux-hwe-edge Package: linux-ibm Package: linux-ibm-5.4 Package: linux-intel-5.13 Package: linux-intel-iot-realtime Package: linux-iot Package: linux-kvm Package: linux-lowlatency-hwe-5.19 Package: linux-lowlatency-hwe-6.2 Package: linux-lts-xenial Package: linux-nvidia-6.2 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-oracle Package: linux-oracle-5.0 Package: linux-oracle-5.11 Package: linux-oracle-5.13 Package: linux-oracle-5.3 Package: linux-oracle-5.4 Package: linux-oracle-5.8 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.19 Package: linux-riscv-5.8 Package: linux-starfive-5.19 Package: linux-starfive-6.2 Package: linux-vmware Platform: Linux Ecosystem: Debian Ecosystem: Ubuntu

Description

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

dm: fix mempool NULL pointer race when completing IO

dm_io_dec_pending() calls end_io_acct() first and will then dec md
in-flight pending count. But if a task is swapping DM table at same
time this can result in a crash due to mempool->elements being NULL:

task1 task2
do_resume
->do_suspend
->dm_wait_for_completion
bio_endio
->clone_endio
->dm_io_dec_pending
->end_io_acct
->wakeup task1
->dm_swap_table
->__bind
->__bind_mempools
->bioset_exit
->mempool_exit
->free_io

[ 67.330330] Unable to handle kernel NULL pointer dereference at
virtual address 0000000000000000
......
[ 67.330494] pstate: 80400085 (Nzcv daIf +PAN -UAO)
[ 67.330510] pc : mempool_free+0x70/0xa0
[ 67.330515] lr : mempool_free+0x4c/0xa0
[ 67.330520] sp : ffffff8008013b20
[ 67.330524] x29: ffffff8008013b20 x28: 0000000000000004
[ 67.330530] x27: ffffffa8c2ff40a0 x26: 00000000ffff1cc8
[ 67.330535] x25: 0000000000000000 x24: ffffffdada34c800
[ 67.330541] x23: 0000000000000000 x22: ffffffdada34c800
[ 67.330547] x21: 00000000ffff1cc8 x20: ffffffd9a1304d80
[ 67.330552] x19: ffffffdada34c970 x18: 000000b312625d9c
[ 67.330558] x17: 00000000002dcfbf x16: 00000000000006dd
[ 67.330563] x15: 000000000093b41e x14: 0000000000000010
[ 67.330569] x13: 0000000000007f7a x12: 0000000034155555
[ 67.330574] x11: 0000000000000001 x10: 0000000000000001
[ 67.330579] x9 : 0000000000000000 x8 : 0000000000000000
[ 67.330585] x7 : 0000000000000000 x6 : ffffff80148b5c1a
[ 67.330590] x5 : ffffff8008013ae0 x4 : 0000000000000001
[ 67.330596] x3 : ffffff80080139c8 x2 : ffffff801083bab8
[ 67.330601] x1 : 0000000000000000 x0 : ffffffdada34c970
[ 67.330609] Call trace:
[ 67.330616] mempool_free+0x70/0xa0
[ 67.330627] bio_put+0xf8/0x110
[ 67.330638] dec_pending+0x13c/0x230
[ 67.330644] clone_endio+0x90/0x180
[ 67.330649] bio_endio+0x198/0x1b8
[ 67.330655] dec_pending+0x190/0x230
[ 67.330660] clone_endio+0x90/0x180
[ 67.330665] bio_endio+0x198/0x1b8
[ 67.330673] blk_update_request+0x214/0x428
[ 67.330683] scsi_end_request+0x2c/0x300
[ 67.330688] scsi_io_completion+0xa0/0x710
[ 67.330695] scsi_finish_command+0xd8/0x110
[ 67.330700] scsi_softirq_done+0x114/0x148
[ 67.330708] blk_done_softirq+0x74/0xd0
[ 67.330716] __do_softirq+0x18c/0x374
[ 67.330724] irq_exit+0xb4/0xb8
[ 67.330732] __handle_domain_irq+0x84/0xc0
[ 67.330737] gic_handle_irq+0x148/0x1b0
[ 67.330744] el1_irq+0xe8/0x190
[ 67.330753] lpm_cpuidle_enter+0x4f8/0x538
[ 67.330759] cpuidle_enter_state+0x1fc/0x398
[ 67.330764] cpuidle_enter+0x18/0x20
[ 67.330772] do_idle+0x1b4/0x290
[ 67.330778] cpu_startup_entry+0x20/0x28
[ 67.330786] secondary_start_kernel+0x160/0x170

Fix this by:
1) Establishing pointers to 'struct dm_io' members in
dm_io_dec_pending() so that they may be passed into end_io_acct()
_after_ free_io() is called.
2) Moving end_io_acct() after free_io().

Affected products

VendorProductAffectedFixed
Linux Linux 2.6.37 4.9.313

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 5.14.16-1 —
Debian 13 linux 5.14.16-1 —
Debian 12 linux 5.14.16-1 —
ReleasePackageFixed inAdvisory
Ubuntu 24.04 LTS linux-raspi-realtime No fix yet —
Ubuntu 22.04 LTS linux-riscv +22 No fix yet —
Ubuntu 20.04 LTS linux 5.4.0-124.140 —
Ubuntu 20.04 LTS linux-aws 5.4.0-1083.90 —
Ubuntu 20.04 LTS linux-azure 5.4.0-1089.94 —
Ubuntu 20.04 LTS linux-bluefield 5.4.0-1044.49 —
Ubuntu 20.04 LTS linux-gcp 5.4.0-1086.94 —
Ubuntu 20.04 LTS linux-gke +26 No fix yet —
Ubuntu 20.04 LTS linux-gkeop 5.4.0-1051.54 —
Ubuntu 20.04 LTS linux-ibm 5.4.0-1031.35 —
Ubuntu 20.04 LTS linux-iot 5.4.0-1004.6 —
Ubuntu 20.04 LTS linux-kvm 5.4.0-1073.78 —
Ubuntu 20.04 LTS linux-oracle 5.4.0-1081.89 —
Ubuntu 20.04 LTS linux-raspi 5.4.0-1068.78 —
Ubuntu 18.04 LTS linux 4.15.0-191.202 —
Ubuntu 18.04 LTS linux-aws 4.15.0-1139.150 —
Ubuntu 18.04 LTS linux-aws-5.4 5.4.0-1083.90~18.04.1 —
Ubuntu 18.04 LTS linux-azure-4.15 4.15.0-1149.164 —
Ubuntu 18.04 LTS linux-azure-5.4 5.4.0-1089.94~18.04.1 —
Ubuntu 18.04 LTS linux-gcp +14 No fix yet —
Ubuntu 18.04 LTS linux-gcp-4.15 4.15.0-1134.150 —
Ubuntu 18.04 LTS linux-gcp-5.4 5.4.0-1086.94~18.04.1 —
Ubuntu 18.04 LTS linux-hwe-5.4 5.4.0-124.140~18.04.1 —
Ubuntu 18.04 LTS linux-ibm-5.4 5.4.0-1031.35~18.04.1 —
Ubuntu 18.04 LTS linux-kvm 4.15.0-1125.130 —
Ubuntu 18.04 LTS linux-oracle 4.15.0-1104.115 —
Ubuntu 18.04 LTS linux-oracle-5.4 5.4.0-1081.89~18.04.1 —
Ubuntu 18.04 LTS linux-raspi-5.4 5.4.0-1068.78~18.04.1 —
Ubuntu 16.04 LTS linux-hwe-edge No fix yet —
Show 8 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
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-1083.90+fips1 —
Ubuntu Pro FIPS-updates 20.04 LTS linux-azure-fips 5.4.0-1089.94+fips1 —
Ubuntu Pro FIPS-updates 20.04 LTS linux-fips 5.4.0-1059.67 —
Ubuntu Pro FIPS-updates 20.04 LTS linux-gcp-fips 5.4.0-1086.94+fips1 —
Ubuntu Pro FIPS-updates 18.04 LTS linux-aws-fips 4.15.0-2078.83 —
Ubuntu Pro FIPS-updates 18.04 LTS linux-azure-fips 4.15.0-2059.65 —
Ubuntu Pro FIPS-updates 18.04 LTS linux-fips 4.15.0-1096.107 —
Ubuntu Pro FIPS-updates 18.04 LTS linux-gcp-fips 4.15.0-2043.48 —
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-1139.150~16.04.1 —
Ubuntu Pro 16.04 LTS linux-azure 4.15.0-1149.164~16.04.1 —
Ubuntu Pro 16.04 LTS linux-gcp 4.15.0-1134.150~16.04.2 —
Ubuntu Pro 16.04 LTS linux-hwe 4.15.0-191.202~16.04.1 —
Ubuntu Pro 16.04 LTS linux-oracle 4.15.0-1104.115~16.04.1 —
Ubuntu Pro 14.04 LTS linux +2 No fix yet —
Ubuntu Pro 14.04 LTS linux-azure 4.15.0-1149.164~14.04.1 —
ReleasePackageFixed inAdvisory
RHEL 8 kernel-rt +12 4.18.0-372.9.1.rt7.166.el8 RHSA-2022:1975
RHEL 8 perf +26 4.18.0-372.9.1.el8 RHSA-2022:1988
Show 2 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
RHEL 8.4 EUS perf +26 4.18.0-305.57.1.el8_4 RHSA-2022:5626
RHEL 8.2 EUS perf +26 4.18.0-193.87.1.el8_2 RHSA-2022:5220
ReleasePackageFixed inAdvisory
SLES 15 SP5 kernel-64kb +6 5.14.21-150500.55.68.1 SUSE-SU-2024:2190-1
SLES 15 SP5 kernel-azure +2 5.14.21-150500.33.57.1 SUSE-SU-2024:2019-1
SLES 15 SP5 kernel-default-base 5.14.21-150500.55.68.1.150500.6.31.1 SUSE-SU-2024:2190-1
SLES 15 SP4 kernel-64kb +4 5.14.21-150400.24.122.2 SUSE-SU-2024:2189-1
SLES 15 SP4 kernel-default-base 5.14.21-150400.24.122.2.150400.24.58.2 SUSE-SU-2024:2189-1
SLES 15 SP4 kernel-syms +1 5.14.21-150400.24.122.1 SUSE-SU-2024:2189-1
SLES 15 SP3 kernel-64kb +7 5.3.18-150300.59.164.1 SUSE-SU-2024:2185-1
SLES 15 SP3 kernel-default-base 5.3.18-150300.59.164.1.150300.18.96.1 SUSE-SU-2024:2185-1
SLES 12 SP5 kernel-azure +2 4.12.14-16.188.1 SUSE-SU-2024:1979-1
SLES 12 SP5 kernel-docs +4 4.12.14-122.219.1 SUSE-SU-2024:2184-1
Show 19 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
SLES for SAP 15 SP4 kernel-default-base 5.14.21-150400.24.122.2.150400.24.58.2 SUSE-SU-2024:2189-1
SLES for SAP 15 SP4 kernel-docs +2 5.14.21-150400.24.122.2 SUSE-SU-2024:2189-1
SLES for SAP 15 SP4 kernel-syms +1 5.14.21-150400.24.122.1 SUSE-SU-2024:2189-1
SLES for SAP 15 SP3 kernel-default-base 5.3.18-150300.59.164.1.150300.18.96.1 SUSE-SU-2024:2185-1
SLES for SAP 15 SP3 kernel-docs +5 5.3.18-150300.59.164.1 SUSE-SU-2024:2185-1
SLES for SAP 12 SP5 kernel-azure +2 4.12.14-16.188.1 SUSE-SU-2024:1979-1
SLES for SAP 12 SP5 kernel-syms +2 4.12.14-122.219.1 SUSE-SU-2024:2184-1
SLE Real Time 12 SP5 kernel-rt +3 4.12.14-10.188.1 SUSE-SU-2024:1983-1
SLE Micro 5.5 kernel-default 5.14.21-150500.55.68.1 SUSE-SU-2024:2190-1
SLE Micro 5.5 kernel-default-base 5.14.21-150500.55.68.1.150500.6.31.1 SUSE-SU-2024:2190-1
SLE Micro 5.5 kernel-rt +1 5.14.21-150500.13.58.1 SUSE-SU-2024:2008-1
SLE Micro 5.4 kernel-default 5.14.21-150400.24.122.2 SUSE-SU-2024:2189-1
SLE Micro 5.4 kernel-default-base 5.14.21-150400.24.122.2.150400.24.58.2 SUSE-SU-2024:2189-1
SLE Micro 5.4 kernel-rt +1 5.14.21-150400.15.82.1 SUSE-SU-2024:2011-1
SLE Micro 5.3 kernel-default 5.14.21-150400.24.122.2 SUSE-SU-2024:2189-1
SLE Micro 5.3 kernel-default-base 5.14.21-150400.24.122.2.150400.24.58.2 SUSE-SU-2024:2189-1
SLE Micro 5.3 kernel-rt +1 5.14.21-150400.15.82.1 SUSE-SU-2024:2011-1
SLE Micro 5.2 kernel-default 5.3.18-150300.59.164.1 SUSE-SU-2024:2185-1
SLE Micro 5.2 kernel-default-base 5.3.18-150300.59.164.1.150300.18.96.1 SUSE-SU-2024:2185-1
SLE Micro 5.2 kernel-rt +1 5.3.18-150300.172.1 SUSE-SU-2024:2010-1
SLE Micro 5.1 kernel-default 5.3.18-150300.59.164.1 SUSE-SU-2024:2185-1
SLE Micro 5.1 kernel-default-base 5.3.18-150300.59.164.1.150300.18.96.1 SUSE-SU-2024:2185-1
SLE Micro 5.1 kernel-rt +1 5.3.18-150300.172.1 SUSE-SU-2024:2010-1
SLE Live Patching 15 SP5 kernel-default 5.14.21-150500.55.68.1 SUSE-SU-2024:2190-1
SLE Live Patching 15 SP5 kernel-livepatch-SLE15-SP5_Update_15 +1 1-150500.11.3.1 SUSE-SU-2024:2190-1, SUSE-SU-2024:2008-1
SLE Live Patching 15 SP4 kernel-default 5.14.21-150400.24.122.2 SUSE-SU-2024:2189-1
SLE Live Patching 15 SP4 kernel-livepatch-SLE15-SP4_Update_27 1-150400.9.3.2 SUSE-SU-2024:2189-1
SLE Live Patching 15 SP3 kernel-default 5.3.18-150300.59.164.1 SUSE-SU-2024:2185-1
SLE Live Patching 15 SP3 kernel-livepatch-SLE15-SP3_Update_45 1-150300.7.3.1 SUSE-SU-2024:2185-1
SLE Live Patching 12 SP5 kernel-default 4.12.14-122.219.1 SUSE-SU-2024:2184-1
SLE Live Patching 12 SP5 kgraft-patch-SLE12-SP5_Update_57 1-8.3.1 SUSE-SU-2024:2184-1
SLE HPC 15 SP4 kernel-64kb +3 5.14.21-150400.24.122.2 SUSE-SU-2024:2189-1
SLE HPC 15 SP4 kernel-default-base 5.14.21-150400.24.122.2.150400.24.58.2 SUSE-SU-2024:2189-1
SLE HPC 15 SP4 kernel-syms +1 5.14.21-150400.24.122.1 SUSE-SU-2024:2189-1
SLE HPC 15 SP3 kernel-64kb +6 5.3.18-150300.59.164.1 SUSE-SU-2024:2185-1
SLE HPC 15 SP3 kernel-default-base 5.3.18-150300.59.164.1.150300.18.96.1 SUSE-SU-2024:2185-1
SUSE Real Time Module 15 SP5 kernel-rt +3 5.14.21-150500.13.58.1 SUSE-SU-2024:2008-1
SUSE Manager Server 4.3 kernel-default +1 5.14.21-150400.24.122.2 SUSE-SU-2024:2189-1
SUSE Manager Server 4.3 kernel-default-base 5.14.21-150400.24.122.2.150400.24.58.2 SUSE-SU-2024:2189-1
SUSE Manager Server 4.3 kernel-syms +1 5.14.21-150400.24.122.1 SUSE-SU-2024:2189-1
SUSE Manager Proxy 4.3 kernel-default 5.14.21-150400.24.122.2 SUSE-SU-2024:2189-1
SUSE Manager Proxy 4.3 kernel-default-base 5.14.21-150400.24.122.2.150400.24.58.2 SUSE-SU-2024:2189-1
SUSE Manager Proxy 4.3 kernel-syms +1 5.14.21-150400.24.122.1 SUSE-SU-2024:2189-1
SUSE Enterprise Storage 7.1 kernel-64kb +6 5.3.18-150300.59.164.1 SUSE-SU-2024:2185-1
SUSE Enterprise Storage 7.1 kernel-default-base 5.3.18-150300.59.164.1.150300.18.96.1 SUSE-SU-2024:2185-1
ReleasePackageFixed inAdvisory
openSUSE Leap 15.5 dtb-aarch64 +10 5.14.21-150500.55.68.1 SUSE-SU-2024:2190-1
openSUSE Leap 15.5 kernel-azure +2 5.14.21-150500.33.57.1 SUSE-SU-2024:2019-1
openSUSE Leap 15.5 kernel-default-base 5.14.21-150500.55.68.1.150500.6.31.1 SUSE-SU-2024:2190-1
openSUSE Leap 15.5 kernel-rt +3 5.14.21-150500.13.58.1 SUSE-SU-2024:2008-1
Show 2 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
openSUSE Leap Micro 5.4 kernel-default 5.14.21-150400.24.122.2 SUSE-SU-2024:2189-1
openSUSE Leap Micro 5.4 kernel-default-base 5.14.21-150400.24.122.2.150400.24.58.2 SUSE-SU-2024:2189-1
openSUSE Leap Micro 5.4 kernel-rt 5.14.21-150400.15.82.1 SUSE-SU-2024:2011-1
openSUSE Leap Micro 5.3 kernel-default 5.14.21-150400.24.122.2 SUSE-SU-2024:2189-1
openSUSE Leap Micro 5.3 kernel-default-base 5.14.21-150400.24.122.2.150400.24.58.2 SUSE-SU-2024:2189-1
openSUSE Leap Micro 5.3 kernel-rt 5.14.21-150400.15.82.1 SUSE-SU-2024:2011-1

Amazon Linux

ReleasePackageFixed inAdvisory
Amazon Linux 2 kernel-livepatch-4.14.281-212.502 1.0-0.amzn2 ALAS2-2022-1798
Amazon Linux 2 perf +8 4.14.281-212.502.amzn2 ALAS2-2022-1798

Advisories 16

References