CVE-2024-40954
Linux Kernel vulnerability analysis and mitigation

Overview

CVE-2024-40954 is a vulnerability in the Linux kernel that involves a use-after-free condition in the networking subsystem. The issue occurs when a socket creation fails, leaving a dangling socket pointer that can be exploited under specific conditions. This vulnerability was discovered in July 2024 and affects Linux kernel versions from 5.12 up to versions before 5.15.162, 6.1.96, 6.6.36, and 6.9.7 (NVD).

Technical details

The vulnerability can be triggered by attaching an fentry probe to __sock_release() and calling the bpf_get_socket_cookie() helper while running traceroute -I 1.1.1.1 on a freshly booted VM. The issue stems from a failure to properly clear the struct socket reference in sk_common_release(), which should cover all protocol families create functions that may have already attached the reference to the sk object with sock_init_data(). The vulnerability has been assigned a CVSS v3.1 base score of 7.8 (HIGH) with vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H (NVD).

Impact

When exploited, this vulnerability can lead to a use-after-free condition in the Linux kernel, potentially allowing an attacker to execute arbitrary code, cause denial of service, or gain elevated privileges. The vulnerability affects the kernel's networking stack and can be triggered through specific networking operations (NVD).

Exploitability

The vulnerability requires local access and can be triggered through a specific sequence of operations involving BPF programs and networking tools. A proof-of-concept exists that demonstrates the vulnerability using traceroute with ICMP packets and an fentry probe (Kernel Patch).

Mitigation and workarounds

The vulnerability has been fixed in the Linux kernel through a patch that clears the struct socket reference in sk_common_release(). The fix has been backported to multiple stable kernel versions. Users should update to Linux kernel versions 5.15.162, 6.1.96, 6.6.36, 6.9.7 or later to mitigate this vulnerability (Kernel Patch).

Additional resources


SourceThis report was generated using AI

Related Linux Kernel vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-80913NONEN/A
  • Linux Kernel logoLinux Kernel
  • linux
NoYesSep 04, 2026
CVE-2026-80905NONEN/A
  • Linux Kernel logoLinux Kernel
  • kernel
NoYesSep 04, 2026
CVE-2026-80898NONEN/A
  • Linux Kernel logoLinux Kernel
  • linux
NoYesSep 04, 2026
CVE-2026-80897NONEN/A
  • Linux Kernel logoLinux Kernel
  • linux
NoYesSep 04, 2026
CVE-2026-80892NONEN/A
  • Linux Kernel logoLinux Kernel
  • linux
NoYesSep 04, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management