Skip to content
OpenAdvisories
High · 7.8 CVE-2024-27012 EUVD-2024-24274GHSA-9r2w-3mr4-v6gq

netfilter: nf_tables: restore set elements when delete set fails

Published May 1, 2024 · Updated Aug 5, 2026 · Assigned by Linux

Vendor: Linux Product: Linux Package: kernel 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-6.8 Package: linux-aws-fips Package: linux-azure 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.2 Package: linux-azure-6.5 Package: linux-azure-6.8 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-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.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.2 Package: linux-hwe-6.5 Package: linux-hwe-edge Package: linux-ibm Package: linux-ibm-5.15 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.2 Package: linux-lowlatency-hwe-6.5 Package: linux-nvidia Package: linux-nvidia-6.2 Package: linux-nvidia-6.5 Package: linux-nvidia-6.8 Package: linux-nvidia-tegra Package: linux-nvidia-tegra-5.15 Package: linux-nvidia-tegra-igx 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.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-oracle-6.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.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: Azure Linux Ecosystem: Debian Ecosystem: Ubuntu

Description

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

netfilter: nf_tables: restore set elements when delete set fails

From abort path, nft_mapelem_activate() needs to restore refcounters to
the original state. Currently, it uses the set->ops->walk() to iterate
over these set elements. The existing set iterator skips inactive
elements in the next generation, this does not work from the abort path
to restore the original state since it has to skip active elements
instead (not inactive ones).

This patch moves the check for inactive elements to the set iterator
callback, then it reverses the logic for the .activate case which
needs to skip active elements.

Toggle next generation bit for elements when delete set command is
invoked and call nft_clear() from .activate (abort) path to restore the
next generation bit.

The splat below shows an object in mappings memleak:

[43929.457523] ------------[ cut here ]------------
[43929.457532] WARNING: CPU: 0 PID: 1139 at include/net/netfilter/nf_tables.h:1237 nft_setelem_data_deactivate+0xe4/0xf0 [nf_tables]
[...]
[43929.458014] RIP: 0010:nft_setelem_data_deactivate+0xe4/0xf0 [nf_tables]
[43929.458076] Code: 83 f8 01 77 ab 49 8d 7c 24 08 e8 37 5e d0 de 49 8b 6c 24 08 48 8d 7d 50 e8 e9 5c d0 de 8b 45 50 8d 50 ff 89 55 50 85 c0 75 86 <0f> 0b eb 82 0f 0b eb b3 0f 1f 40 00 90 90 90 90 90 90 90 90 90 90
[43929.458081] RSP: 0018:ffff888140f9f4b0 EFLAGS: 00010246
[43929.458086] RAX: 0000000000000000 RBX: ffff8881434f5288 RCX: dffffc0000000000
[43929.458090] RDX: 00000000ffffffff RSI: ffffffffa26d28a7 RDI: ffff88810ecc9550
[43929.458093] RBP: ffff88810ecc9500 R08: 0000000000000001 R09: ffffed10281f3e8f
[43929.458096] R10: 0000000000000003 R11: ffff0000ffff0000 R12: ffff8881434f52a0
[43929.458100] R13: ffff888140f9f5f4 R14: ffff888151c7a800 R15: 0000000000000002
[43929.458103] FS: 00007f0c687c4740(0000) GS:ffff888390800000(0000) knlGS:0000000000000000
[43929.458107] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[43929.458111] CR2: 00007f58dbe5b008 CR3: 0000000123602005 CR4: 00000000001706f0
[43929.458114] Call Trace:
[43929.458118] <TASK>
[43929.458121] ? __warn+0x9f/0x1a0
[43929.458127] ? nft_setelem_data_deactivate+0xe4/0xf0 [nf_tables]
[43929.458188] ? report_bug+0x1b1/0x1e0
[43929.458196] ? handle_bug+0x3c/0x70
[43929.458200] ? exc_invalid_op+0x17/0x40
[43929.458211] ? nft_setelem_data_deactivate+0xd7/0xf0 [nf_tables]
[43929.458271] ? nft_setelem_data_deactivate+0xe4/0xf0 [nf_tables]
[43929.458332] nft_mapelem_deactivate+0x24/0x30 [nf_tables]
[43929.458392] nft_rhash_walk+0xdd/0x180 [nf_tables]
[43929.458453] ? __pfx_nft_rhash_walk+0x10/0x10 [nf_tables]
[43929.458512] ? rb_insert_color+0x2e/0x280
[43929.458520] nft_map_deactivate+0xdc/0x1e0 [nf_tables]
[43929.458582] ? __pfx_nft_map_deactivate+0x10/0x10 [nf_tables]
[43929.458642] ? __pfx_nft_mapelem_deactivate+0x10/0x10 [nf_tables]
[43929.458701] ? __rcu_read_unlock+0x46/0x70
[43929.458709] nft_delset+0xff/0x110 [nf_tables]
[43929.458769] nft_flush_table+0x16f/0x460 [nf_tables]
[43929.458830] nf_tables_deltable+0x501/0x580 [nf_tables]

Affected products

VendorProductAffectedFixed
Linux Linux 5.15.121 – < 5.15.212, 6.1.36 – < 6.1.176, 4.19.316 – < 4.20, 5.4.262 – < 5.5, 5.10.188 – < 5.11, 6.3.10 – < 6.4, 6.4 5.15.212

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.8.9-1 —
Debian 13 linux 6.8.9-1 —
Debian 12 linux 6.1.176-1 —
ReleasePackageFixed inAdvisory
Ubuntu Nvidia-BlueField 22.04 LTS linux-bluefield 5.15.0-1053.55 —
Ubuntu 24.04 LTS linux 6.8.0-38.38 USN-6893-1
Ubuntu 24.04 LTS linux-aws 6.8.0-1011.12 USN-6893-3
Ubuntu 24.04 LTS linux-azure 6.8.0-1010.10 USN-6893-1
Ubuntu 24.04 LTS linux-gcp 6.8.0-1010.11 USN-6893-1
Ubuntu 24.04 LTS linux-gke 6.8.0-1006.9 USN-6893-2
Ubuntu 24.04 LTS linux-ibm +2 6.8.0-1008.8 USN-6918-1, USN-6893-1
Ubuntu 24.04 LTS linux-intel 6.8.0-1007.14 USN-6893-1
Ubuntu 24.04 LTS linux-nvidia 6.8.0-1009.9 USN-6893-2
Ubuntu 24.04 LTS linux-raspi 6.8.0-1007.7 USN-6893-1
Ubuntu 24.04 LTS linux-riscv +1 6.8.0-38.38.1 USN-6893-1
Ubuntu 22.04 LTS linux +1 5.15.0-122.132 USN-7021-3, USN-7021-1
Ubuntu 22.04 LTS linux-aws 5.15.0-1070.76 USN-7021-1
Ubuntu 22.04 LTS linux-aws-6.8 6.8.0-1011.12~22.04.1 —
Ubuntu 22.04 LTS linux-azure 5.15.0-1073.82 USN-7021-1
Ubuntu 22.04 LTS linux-azure-6.8 6.8.0-1010.10~22.04.1 —
Ubuntu 22.04 LTS linux-azure-fde 5.15.0-1073.82.1 USN-7021-5
Ubuntu 22.04 LTS linux-gcp 5.15.0-1069.77 USN-7021-1
Ubuntu 22.04 LTS linux-gke 5.15.0-1067.73 USN-7021-1
Ubuntu 22.04 LTS linux-gkeop 5.15.0-1053.60 USN-7021-1
Ubuntu 22.04 LTS linux-ibm +1 5.15.0-1063.66 USN-7021-1
Ubuntu 22.04 LTS linux-intel-iotg 5.15.0-1065.71 USN-7021-1
Ubuntu 22.04 LTS linux-kvm 5.15.0-1067.72 USN-7021-1
Ubuntu 22.04 LTS linux-nvidia 5.15.0-1065.66 USN-7021-1
Ubuntu 22.04 LTS linux-nvidia-6.8 6.8.0-1009.9~22.04.1 —
Ubuntu 22.04 LTS linux-nvidia-tegra 5.15.0-1030.30 —
Ubuntu 22.04 LTS linux-nvidia-tegra-igx 5.15.0-1019.19 —
Ubuntu 22.04 LTS linux-oracle 5.15.0-1068.74 USN-7021-1
Ubuntu 22.04 LTS linux-oracle-6.8 6.8.0-1008.8~22.04.1 —
Ubuntu 22.04 LTS linux-riscv +31 No fix yet —
Ubuntu 22.04 LTS linux-xilinx-zynqmp 5.15.0-1036.40 USN-7021-2
Ubuntu 20.04 LTS linux 5.4.0-196.216 USN-7022-1
Ubuntu 20.04 LTS linux-aws 5.4.0-1133.143 USN-7022-1
Ubuntu 20.04 LTS linux-aws-5.15 5.15.0-1070.76~20.04.1 USN-7021-1
Ubuntu 20.04 LTS linux-azure 5.4.0-1138.145 USN-7022-1
Ubuntu 20.04 LTS linux-azure-5.15 5.15.0-1073.82~20.04.1 USN-7021-1
Ubuntu 20.04 LTS linux-azure-fde-5.15 5.15.0-1073.82~20.04.1.1 USN-7021-4
Ubuntu 20.04 LTS linux-bluefield 5.4.0-1093.100 USN-7022-1
Ubuntu 20.04 LTS linux-gcp 5.4.0-1137.146 USN-7022-1
Ubuntu 20.04 LTS linux-gcp-5.15 5.15.0-1069.77~20.04.1 USN-7021-1
Ubuntu 20.04 LTS linux-gke +26 No fix yet —
Ubuntu 20.04 LTS linux-gkeop 5.4.0-1100.104 USN-7022-1
Ubuntu 20.04 LTS linux-gkeop-5.15 5.15.0-1053.60~20.04.1 USN-7021-1
Ubuntu 20.04 LTS linux-hwe-5.15 +1 5.15.0-122.132~20.04.1 USN-7021-3, USN-7021-1
Ubuntu 20.04 LTS linux-ibm 5.4.0-1080.85 USN-7022-1
Ubuntu 20.04 LTS linux-ibm-5.15 5.15.0-1063.66~20.04.1 USN-7021-2
Ubuntu 20.04 LTS linux-intel-iotg-5.15 5.15.0-1065.71~20.04.1 USN-7021-1
Ubuntu 20.04 LTS linux-iot 5.4.0-1044.45 USN-7119-1
Ubuntu 20.04 LTS linux-kvm 5.4.0-1121.129 USN-7022-1
Ubuntu 20.04 LTS linux-nvidia-tegra-5.15 5.15.0-1030.30~20.04.1 —
Ubuntu 20.04 LTS linux-oracle 5.4.0-1132.141 USN-7022-1
Ubuntu 20.04 LTS linux-oracle-5.15 5.15.0-1068.74~20.04.1 USN-7021-2
Ubuntu 20.04 LTS linux-raspi 5.4.0-1117.129 USN-7022-2
Ubuntu 20.04 LTS linux-riscv-5.15 5.15.0-1066.70~20.04.1 —
Ubuntu 20.04 LTS linux-xilinx-zynqmp 5.4.0-1052.56 USN-7022-1
Ubuntu 18.04 LTS linux-gcp +13 No fix yet —
Show 7 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Ubuntu 16.04 LTS linux-hwe-edge No fix yet —
Ubuntu Pro Realtime 24.04 LTS linux-raspi-realtime 6.8.0-2006.6 —
Ubuntu Pro Realtime 24.04 LTS linux-realtime 6.8.1-1004.4 —
Ubuntu Pro Realtime 22.04 LTS linux-intel-iot-realtime 5.15.0-1063.65 —
Ubuntu Pro Realtime 22.04 LTS linux-realtime 5.15.0-1071.79 —
Ubuntu Pro FIPS-updates 22.04 LTS linux-aws-fips 5.15.0-1070.76+fips1 —
Ubuntu Pro FIPS-updates 22.04 LTS linux-azure-fips 5.15.0-1073.82+fips1 —
Ubuntu Pro FIPS-updates 22.04 LTS linux-fips 5.15.0-122.132+fips1 —
Ubuntu Pro FIPS-updates 22.04 LTS linux-gcp-fips 5.15.0-1069.77+fips1 —
Ubuntu Pro FIPS-updates 20.04 LTS linux-aws-fips 5.4.0-1133.143+fips1 —
Ubuntu Pro FIPS-updates 20.04 LTS linux-azure-fips 5.4.0-1138.145+fips1 —
Ubuntu Pro FIPS-updates 20.04 LTS linux-fips 5.4.0-1107.117 —
Ubuntu Pro FIPS-updates 20.04 LTS linux-gcp-fips 5.4.0-1137.146+fips1 —
Ubuntu Pro FIPS-preview 22.04 LTS linux-aws-fips +2 No fix yet —
Ubuntu Pro 18.04 LTS linux-aws-5.4 5.4.0-1133.143~18.04.1 USN-7022-1
Ubuntu Pro 18.04 LTS linux-azure-5.4 5.4.0-1138.145~18.04.1 USN-7022-1
Ubuntu Pro 18.04 LTS linux-gcp-5.4 5.4.0-1137.146~18.04.1 USN-7022-1
Ubuntu Pro 18.04 LTS linux-hwe-5.4 5.4.0-196.216~18.04.1 USN-7022-1
Ubuntu Pro 18.04 LTS linux-ibm-5.4 5.4.0-1080.85~18.04.1 USN-7022-1
Ubuntu Pro 18.04 LTS linux-oracle-5.4 5.4.0-1132.141~18.04.1 USN-7022-1
Ubuntu Pro 18.04 LTS linux-raspi-5.4 5.4.0-1117.129~18.04.1 USN-7022-3
ReleasePackageFixed inAdvisory
RHEL 9 bpftool 7.4.0-503.11.1.el9_5 RHSA-2024:9315
RHEL 9 rv +67 5.14.0-503.11.1.el9_5 RHSA-2024:9315
Show 1 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
RHEL 9.4 EUS bpftool 7.3.0-427.55.1.el9_4 RHSA-2025:1658
RHEL 9.4 EUS rv +64 5.14.0-427.55.1.el9_4 RHSA-2025:1658
ReleasePackageFixed inAdvisory
SLES 15 SP6 kernel-64kb +5 6.4.0-150600.23.17.1 SUSE-SU-2024:2802-1
SLES 15 SP6 kernel-azure +1 6.4.0-150600.8.8.2 SUSE-SU-2024:2896-1
SLES 15 SP6 kernel-default-base 6.4.0-150600.23.17.1.150600.12.6.2 SUSE-SU-2024:2802-1
SLES 15 SP6 kernel-docs 6.4.0-150600.23.17.3 SUSE-SU-2024:2802-1
SLES 15 SP6 kernel-syms-azure 6.4.0-150600.8.8.1 SUSE-SU-2024:2896-1
Show 3 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
SLE Micro 6.0 kernel-default-base 6.4.0-17.1.1.51 SUSE-SU-2025:20008-1
SLE Micro 6.0 kernel-rt +1 6.4.0-9.1 SUSE-SU-2025:20028-1
SLE Micro 6.0 kernel-source +2 6.4.0-18.1 SUSE-SU-2025:20008-1
SLE Live Patching 15 SP6 kernel-default 6.4.0-150600.23.17.1 SUSE-SU-2024:2802-1
SLE Live Patching 15 SP6 kernel-livepatch-SLE15-SP6-RT_Update_1 1-150600.1.5.1 SUSE-SU-2024:2973-1
SLE Live Patching 15 SP6 kernel-livepatch-SLE15-SP6_Update_3 1-150600.13.3.1 SUSE-SU-2024:2802-1
SUSE Real Time Module 15 SP6 kernel-rt +3 6.4.0-150600.10.5.1 SUSE-SU-2024:2973-1
ReleasePackageFixed inAdvisory
openSUSE Leap 15.6 dtb-aarch64 +9 6.4.0-150600.23.17.1 SUSE-SU-2024:2802-1
openSUSE Leap 15.6 kernel-azure +1 6.4.0-150600.8.8.2 SUSE-SU-2024:2896-1
openSUSE Leap 15.6 kernel-default-base 6.4.0-150600.23.17.1.150600.12.6.2 SUSE-SU-2024:2802-1
openSUSE Leap 15.6 kernel-docs 6.4.0-150600.23.17.3 SUSE-SU-2024:2802-1
openSUSE Leap 15.6 kernel-rt +3 6.4.0-150600.10.5.1 SUSE-SU-2024:2973-1
openSUSE Leap 15.6 kernel-syms-azure 6.4.0-150600.8.8.1 SUSE-SU-2024:2896-1

Azure Linux

ReleasePackageFixed inAdvisory
Azure Linux 3 kernel 6.6.57.1-1 —

Oracle Linux

ReleasePackageFixed inAdvisory
Oracle Linux 9 bpftool 7.4.0-503.11.1.el9_5 ELSA-2024-9315
Oracle Linux 9 rv +28 5.14.0-503.11.1.el9_5 ELSA-2024-9315
Oracle Linux 8 bpftool +18 5.15.0-324.217.5.2.el9uek ELSA-2026-500249

Advisories 24

References