Vulnerability · Published Apr 18, 2024 · Assigned by Linux

CVE-2024-26921inet: inet_defrag: prevent sk release while still in use

High 7.8

In plain English

A high-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.4% (higher than 34% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)7.8High
Exploit odds (30 days)0.4%top 65.7% 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: inet: inet_defrag: prevent sk release while still in use ip_local_out() and other functions can pass skb->sk as function argument. If the skb is a fragment and reassembly happens before such function call returns, the sk must not be released. This affects skb fragments reassembled via netfilter or similar modules, e.g. openvswitch or ct_act.c, when run as part of tx pipeline. Eric Dumazet made an initial analysis of this bug. Quoting Eric: Calling ip_defrag() in output path is also implying skb_orphan(), which is buggy because output path relies on sk not disappearing. A relevant old patch about the issue was : 8282f27449bf ("inet: frag: Always orphan skbs inside ip_defrag()") [..] net/ipv4/ip_output.c depends on skb->sk being set, and probably to an inet socket, not an arbitrary one. If we orphan the packet in ipvlan, then downstream things like FQ packet scheduler will not work properly. We need to change ip_defrag() to only use skb_orphan() when really needed, ie whenever frag_list is going to be used. Eric suggested to stash sk in fragment queue and made an initial patch. However there is a problem with this: If skb is refragmented again right after, ip_do_fragment() will copy head->sk to the new fragments, and sets up destructor to sock_wfree. IOW, we have no choice but to fix up sk_wmem accouting to reflect the fully reassembled skb, else wmem will underflow. This change moves the orphan down into the core, to last possible moment. As ip_defrag_offset is aliased with sk_buff->sk member, we must move the offset into the FRAG_CB, else skb->sk gets clobbered. This allows to delay the orphaning long enough to learn if the skb has to be queued or if the skb is completing the reasm queue. In the former case, things work as before, skb is orphaned. This is safe because skb gets queued/stolen and won't continue past reasm engine. In the latter case, we will steal the skb->sk reference, reattach it to the head skb, and fix up wmem accouting when inet_frag inflates truesize.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
Debian:12linux6.1.85-1DEBIAN-CVE-2024-26921
Debian:13linux6.8.9-1DEBIAN-CVE-2024-26921
Debian:14linux6.8.9-1DEBIAN-CVE-2024-26921
Ubuntu:22.04:LTSlinux5.15.0-119.129USN-6974-1
Ubuntu:22.04:LTSlinux5.15.0-119.129UBUNTU-CVE-2024-26921
Ubuntu:24.04:LTSlinux6.8.0-38.38UBUNTU-CVE-2024-26921
Ubuntu:24.04:LTSlinux6.8.0-38.38USN-6893-1
Ubuntu:22.04:LTSlinux-allwinner-5.19no fix listedUBUNTU-CVE-2024-26921
Ubuntu:22.04:LTSlinux-aws5.15.0-1068.74UBUNTU-CVE-2024-26921
Ubuntu:22.04:LTSlinux-aws5.15.0-1068.74USN-6974-1
Ubuntu:24.04:LTSlinux-aws6.8.0-1011.12UBUNTU-CVE-2024-26921
Ubuntu:24.04:LTSlinux-aws6.8.0-1011.12USN-6893-3
Ubuntu:22.04:LTSlinux-aws-5.19no fix listedUBUNTU-CVE-2024-26921
Ubuntu:22.04:LTSlinux-aws-6.2no fix listedUBUNTU-CVE-2024-26921
Ubuntu:22.04:LTSlinux-aws-6.5no fix listedUBUNTU-CVE-2024-26921
Ubuntu:22.04:LTSlinux-aws-6.86.8.0-1011.12~22.04.1UBUNTU-CVE-2024-26921
Ubuntu:22.04:LTSlinux-azure5.15.0-1071.80USN-6974-1
Ubuntu:22.04:LTSlinux-azure5.15.0-1071.80UBUNTU-CVE-2024-26921
Ubuntu:24.04:LTSlinux-azure6.8.0-1010.10UBUNTU-CVE-2024-26921
Ubuntu:24.04:LTSlinux-azure6.8.0-1010.10USN-6893-1
Ubuntu:22.04:LTSlinux-azure-5.19no fix listedUBUNTU-CVE-2024-26921
Ubuntu:22.04:LTSlinux-azure-6.2no fix listedUBUNTU-CVE-2024-26921
Ubuntu:22.04:LTSlinux-azure-6.5no fix listedUBUNTU-CVE-2024-26921
Ubuntu:22.04:LTSlinux-azure-6.86.8.0-1010.10~22.04.1UBUNTU-CVE-2024-26921
Ubuntu:22.04:LTSlinux-azure-fde5.15.0-1071.80.1USN-6974-1
Ubuntu:22.04:LTSlinux-azure-fde5.15.0-1071.80.1UBUNTU-CVE-2024-26921
Ubuntu:22.04:LTSlinux-azure-fde-5.19no fix listedUBUNTU-CVE-2024-26921
Ubuntu:22.04:LTSlinux-azure-fde-6.2no fix listedUBUNTU-CVE-2024-26921
Ubuntu:22.04:LTSlinux-gcp5.15.0-1067.75USN-6974-1
Ubuntu:22.04:LTSlinux-gcp5.15.0-1067.75UBUNTU-CVE-2024-26921
Ubuntu:24.04:LTSlinux-gcp6.8.0-1010.11UBUNTU-CVE-2024-26921
Ubuntu:24.04:LTSlinux-gcp6.8.0-1010.11USN-6893-1
Ubuntu:22.04:LTSlinux-gcp-5.19no fix listedUBUNTU-CVE-2024-26921
Ubuntu:22.04:LTSlinux-gcp-6.2no fix listedUBUNTU-CVE-2024-26921
Ubuntu:22.04:LTSlinux-gcp-6.5no fix listedUBUNTU-CVE-2024-26921
Ubuntu:22.04:LTSlinux-gke5.15.0-1065.71UBUNTU-CVE-2024-26921
Ubuntu:22.04:LTSlinux-gke5.15.0-1065.71USN-6974-1
Ubuntu:24.04:LTSlinux-gke6.8.0-1006.9UBUNTU-CVE-2024-26921
Ubuntu:24.04:LTSlinux-gke6.8.0-1006.9USN-6893-2
Ubuntu:22.04:LTSlinux-gkeop5.15.0-1051.58USN-6974-1
Ubuntu:22.04:LTSlinux-gkeop5.15.0-1051.58UBUNTU-CVE-2024-26921
Ubuntu:22.04:LTSlinux-hwe-5.19no fix listedUBUNTU-CVE-2024-26921
Ubuntu:22.04:LTSlinux-hwe-6.2no fix listedUBUNTU-CVE-2024-26921
Ubuntu:22.04:LTSlinux-hwe-6.5no fix listedUBUNTU-CVE-2024-26921
Ubuntu:22.04:LTSlinux-ibm5.15.0-1061.64USN-6974-1
Ubuntu:22.04:LTSlinux-ibm5.15.0-1061.64UBUNTU-CVE-2024-26921
Ubuntu:24.04:LTSlinux-ibm6.8.0-1008.8UBUNTU-CVE-2024-26921
Ubuntu:24.04:LTSlinux-ibm6.8.0-1008.8USN-6893-1
Ubuntu:24.04:LTSlinux-intel6.8.0-1007.14USN-6893-1
Ubuntu:24.04:LTSlinux-intel6.8.0-1007.14UBUNTU-CVE-2024-26921
Ubuntu:22.04:LTSlinux-intel-iotg5.15.0-1063.69USN-6974-1
Ubuntu:22.04:LTSlinux-intel-iotg5.15.0-1063.69UBUNTU-CVE-2024-26921
Ubuntu:22.04:LTSlinux-kvm5.15.0-1065.70UBUNTU-CVE-2024-26921
Ubuntu:22.04:LTSlinux-kvm5.15.0-1065.70USN-6974-1
Ubuntu:22.04:LTSlinux-lowlatency5.15.0-119.129UBUNTU-CVE-2024-26921
Ubuntu:22.04:LTSlinux-lowlatency5.15.0-119.129USN-6974-1
Ubuntu:24.04:LTSlinux-lowlatency6.8.0-38.38.1UBUNTU-CVE-2024-26921
Ubuntu:24.04:LTSlinux-lowlatency6.8.0-38.38.1USN-6893-1
Ubuntu:22.04:LTSlinux-lowlatency-hwe-5.19no fix listedUBUNTU-CVE-2024-26921
Ubuntu:22.04:LTSlinux-lowlatency-hwe-6.2no fix listedUBUNTU-CVE-2024-26921
Ubuntu:22.04:LTSlinux-lowlatency-hwe-6.5no fix listedUBUNTU-CVE-2024-26921
Ubuntu:22.04:LTSlinux-nvidia5.15.0-1063.64UBUNTU-CVE-2024-26921
Ubuntu:22.04:LTSlinux-nvidia5.15.0-1063.64USN-6974-1
Ubuntu:24.04:LTSlinux-nvidia6.8.0-1009.9USN-6893-2
Ubuntu:24.04:LTSlinux-nvidia6.8.0-1009.9UBUNTU-CVE-2024-26921
Ubuntu:22.04:LTSlinux-nvidia-6.2no fix listedUBUNTU-CVE-2024-26921
Ubuntu:22.04:LTSlinux-nvidia-6.5no fix listedUBUNTU-CVE-2024-26921
Ubuntu:22.04:LTSlinux-nvidia-6.86.8.0-1009.9~22.04.1UBUNTU-CVE-2024-26921
Ubuntu:22.04:LTSlinux-nvidia-tegra5.15.0-1028.28UBUNTU-CVE-2024-26921
Ubuntu:22.04:LTSlinux-nvidia-tegra-igx5.15.0-1016.16UBUNTU-CVE-2024-26921
Ubuntu:22.04:LTSlinux-oem-5.17no fix listedUBUNTU-CVE-2024-26921
Ubuntu:22.04:LTSlinux-oem-6.0no fix listedUBUNTU-CVE-2024-26921
Ubuntu:22.04:LTSlinux-oem-6.1no fix listedUBUNTU-CVE-2024-26921
Ubuntu:22.04:LTSlinux-oem-6.5no fix listedUBUNTU-CVE-2024-26921
Ubuntu:24.04:LTSlinux-oem-6.86.8.0-1008.8USN-6893-1
Ubuntu:24.04:LTSlinux-oem-6.86.8.0-1008.8UBUNTU-CVE-2024-26921
Ubuntu:22.04:LTSlinux-oracle5.15.0-1066.72USN-6974-1
Ubuntu:22.04:LTSlinux-oracle5.15.0-1066.72UBUNTU-CVE-2024-26921
Ubuntu:24.04:LTSlinux-oracle6.8.0-1008.8USN-6918-1
Ubuntu:24.04:LTSlinux-oracle6.8.0-1008.8UBUNTU-CVE-2024-26921
Ubuntu:22.04:LTSlinux-oracle-6.5no fix listedUBUNTU-CVE-2024-26921
Ubuntu:22.04:LTSlinux-oracle-6.86.8.0-1008.8~22.04.1UBUNTU-CVE-2024-26921
Ubuntu:22.04:LTSlinux-raspi5.15.0-1061.64USN-6974-1
Ubuntu:22.04:LTSlinux-raspi5.15.0-1061.64UBUNTU-CVE-2024-26921
Ubuntu:24.04:LTSlinux-raspi6.8.0-1007.7UBUNTU-CVE-2024-26921
Ubuntu:24.04:LTSlinux-raspi6.8.0-1007.7USN-6893-1
Ubuntu:22.04:LTSlinux-realtimeno fix listedUBUNTU-CVE-2024-26921
Ubuntu:22.04:LTSlinux-riscvno fix listedUBUNTU-CVE-2024-26921
Ubuntu:24.04:LTSlinux-riscv6.8.0-38.38.1UBUNTU-CVE-2024-26921
Ubuntu:22.04:LTSlinux-riscv-5.19no fix listedUBUNTU-CVE-2024-26921
Ubuntu:22.04:LTSlinux-riscv-6.5no fix listedUBUNTU-CVE-2024-26921
Ubuntu:22.04:LTSlinux-starfive-5.19no fix listedUBUNTU-CVE-2024-26921
Ubuntu:22.04:LTSlinux-starfive-6.2no fix listedUBUNTU-CVE-2024-26921
Ubuntu:22.04:LTSlinux-starfive-6.5no fix listedUBUNTU-CVE-2024-26921
Ubuntu:22.04:LTSlinux-xilinx-zynqmp5.15.0-1035.39USN-7019-1
Ubuntu:22.04:LTSlinux-xilinx-zynqmp5.15.0-1035.39UBUNTU-CVE-2024-26921

Affected products (as reported)

VendorProductVersions
Linux Linux 7026b1ddb6b8d4e6ee33dc2bd06c0ca8746fa7ab – before 1b6de5e6575b56502665c65cf93b0ae6aa0f51ab7026b1ddb6b8d4e6ee33dc2bd06c0ca8746fa7ab – before 9705f447bf9a6cd088300ad2c407b5e1c65910917026b1ddb6b8d4e6ee33dc2bd06c0ca8746fa7ab – before 4318608dc28ef184158b4045896740716bea23f07026b1ddb6b8d4e6ee33dc2bd06c0ca8746fa7ab – before 7d0567842b78390dd9b60f00f1d8f838d540e3257026b1ddb6b8d4e6ee33dc2bd06c0ca8746fa7ab – before f4877225313d474659ee53150ccc3d553a9787277026b1ddb6b8d4e6ee33dc2bd06c0ca8746fa7ab – before e09cbe017311508c21e0739e97198a8388b989817026b1ddb6b8d4e6ee33dc2bd06c0ca8746fa7ab – before 18685451fc4e546fc0e718580d32df3c0e5c8272
Linux Linux 4.1

References