CVE-2024-40954: net: do not leave a dangling sk pointer, when socket creation fails
Noroxi assessment
Priority: Monitor (action score 31/100)
- The sources we track (CISA KEV, Exploit-DB, Metasploit, Nuclei, GitHub) show no public exploit code or exploitation in the wild.
- Probability of exploitation in the next 30 days: 0.25% (FIRST EPSS).
- Someone with local access to the system can trigger it. A low-privileged account is enough. No user action is required. No special conditions are required; it is repeatable.
- Fixed version: Linux Linux 454c454ed645fed051216b79622f7cb69c1638f5, 5dfe2408fd7dc4d2e7ac38a116ff0a37b1cfd3b9, 6cd4a78d962bebbaf8beb7d2ead3f34120e3f7b2.
- Mentioned 1 time in Turkish national cyber security advisories (siberguvenlik.gov.tr).
Low priority for now. Upgrade to Linux Linux 454c454ed645fed051216b79622f7cb69c1638f5, 5dfe2408fd7dc4d2e7ac38a116ff0a37b1cfd3b9, 6cd4a78d962bebbaf8beb7d2ead3f34120e3f7b2 or later.
Generated automatically from the record's data: CVSS (NVD and CNA), CISA KEV and SSVC, FIRST EPSS, exploit sources, fixed versions. How we calculate it
Primary sources: NVD · CVE.org · FIRST EPSS
In the Linux kernel, the following vulnerability has been resolved: net: do not leave a dangling sk pointer, when socket creation fails It is possible to trigger a use-after-free by: * attaching an fentry probe to __sock_release() and the probe calling the bpf_get_socket_cookie() helper * running traceroute -I 1.1.1.1 on a freshly booted VM A KASAN enabled kernel will log something like below (decoded and stripped): ================================================================== BUG: KASAN: slab-use-after-free in __sock_gen_cookie (./arch/x86/include/asm/atomic64_64.h:15 ./include/linux/atomic/atomic-arch-fallback.h:2583 ./include/linux/atomic/atomic-instrumented.h:1611 net/core/sock_diag.c:29) Read of size 8 at addr ffff888007110dd8 by task traceroute/299 CPU: 2 PID: 299 Comm: traceroute Tainted: G E 6.10.0-rc2+ #2 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 Call Trace: <TASK> dump_stack_lvl (lib/dump_stack.c:117 (discriminator 1)) print_report (mm/kasan/report.c:378 mm/kasan/report.c:488) ? __sock_gen_cookie (./arch/x86/include/asm/atomic64_64.h:15 ./include/linux/atomic/atomic-arch-fallback.h:2583 ./include/linux/atomic/atomic-instrumented.h:1611 net/core/sock_diag.c:29) kasan_report (mm/kasan/report.c:603) ? __sock_gen_cookie (./arch/x86/include/asm/atomic64_64.h:15 ./include/linux/atomic/atomic-arch-fallback.h:2583 ./include/linux/atomic/atomic-instrumented.h:1611 net/core/sock_diag.c:29) kasan_check_range (mm/kasan/generic.c:183 mm/kasan/generic.c:189) __sock_gen_cookie (./arch/x86/include/asm/atomic64_64.h:15 ./include/linux/atomic/atomic-arch-fallback.h:2583 ./include/linux/atomic/atomic-instrumented.h:1611 net/core/sock_diag.c:29) bpf_get_socket_ptr_cookie (./arch/x86/include/asm/preempt.h:94 ./include/linux/sock_diag.h:42 net/core/filter.c:5094 net/core/filter.c:5092) bpf_prog_875642cf11f1d139___sock_release+0x6e/0x8e bpf_trampoline_6442506592+0x47/0xaf __sock_release (net/socket.c:652) __sock_create (net/socket.c:1601) ... Allocated by task 299 on cpu 2 at 78.328492s: kasan_save_stack (mm/kasan/common.c:48) kasan_save_track (mm/kasan/common.c:68) __kasan_slab_alloc (mm/kasan/common.c:312 mm/kasan/common.c:338) kmem_cache_alloc_noprof (mm/slub.c:3941 mm/slub.c:4000 mm/slub.c:4007) sk_prot_alloc (net/core/sock.c:2075) sk_alloc (net/core/sock.c:2134) inet_create (net/ipv4/af_inet.c:327 net/ipv4/af_inet.c:252) __sock_create (net/socket.c:1572) __sys_socket (net/socket.c:1660 net/socket.c:1644 net/socket.c:1706) __x64_sys_socket (net/socket.c:1718) do_syscall_64 (arch/x86/entry/common.c:52 arch/x86/entry/common.c:83) entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:130) Freed by task 299 on cpu 2 at 78.328502s: kasan_save_stack (mm/kasan/common.c:48) kasan_save_track (mm/kasan/common.c:68) kasan_save_free_info (mm/kasan/generic.c:582) poison_slab_object (mm/kasan/common.c:242) __kasan_slab_free (mm/kasan/common.c:256) kmem_cache_free (mm/slub.c:4437 mm/slub.c:4511) __sk_destruct (net/core/sock.c:2117 net/core/sock.c:2208) inet_create (net/ipv4/af_inet.c:397 net/ipv4/af_inet.c:252) __sock_create (net/socket.c:1572) __sys_socket (net/socket.c:1660 net/socket.c:1644 net/socket.c:1706) __x64_sys_socket (net/socket.c:1718) do_syscall_64 (arch/x86/entry/common.c:52 arch/x86/entry/common.c:83) entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:130) Fix this by clearing the struct socket reference in sk_common_release() to cover all protocol families create functions, which may already attached the reference to the sk object with sock_init_data().
- BDU:2024-08227
- SUSE-SU-2024:3623-1
- SUSE-SU-2024:3624-1
- SUSE-SU-2024:3625-1
- SUSE-SU-2024:3626-1
- SUSE-SU-2024:3627-1
- SUSE-SU-2024:3628-1
- SUSE-SU-2024:3632-1
- SUSE-SU-2024:3635-1
- SUSE-SU-2024:3636-1
- SUSE-SU-2024:3638-1
- SUSE-SU-2024:3639-1
- SUSE-SU-2024:3643-1
- SUSE-SU-2024:3655-1
- SUSE-SU-2024:3666-1
- SUSE-SU-2024:3670-1
- SUSE-SU-2024:3672-1
- SUSE-SU-2024:3679-1
- SUSE-SU-2024:3680-1
- SUSE-SU-2024:3695-1
- Published
- Jul 12, 2024
- Updated
- Aug 5, 2026
- EPSS
- 0.2% · 17th percentile
- CWE
- CWE-416
Report tools
Action score
31
Monitor
Low priority for now.
- CVSS
- 31 / 40 · 7.8 / 10
- CISA KEV
- 0 / 30 · Not listed
- EPSS
- 0 / 30 · 0.2%
CISA SSVC decision
- Exploitation
- none
- Automatable
- no
- Technical impact
- partial
Vulnrichment: CISA's decision-tree inputs.
CNA vs NVD score
- NVD
- 7.8
- CNA · Linux
- 7.8
- agree
The score given by the assigning authority versus NVD’s independent score. A gap means the severity is contested.
Get told when this record changes
- Not in KEV: no record of exploitation in the wild
- No public exploit code on record
- A fix has been released
If any of these changes, we'll tell you in the daily email digest.
Running WordPress? Scan your site free with WP Lens
Noroxi analysis
What does it mean in your environment?
The assessment above is generated automatically from the record's data; it doesn't know your environment. Our team verifies on your systems whether this vulnerability is actually exploitable and which mitigation is enough.
We use this product, ask for helpAffected systems
Is your version affected?
Pick the product and type the version you run. It's compared with this record's version ranges in your browser; the version isn't sent anywhere.
| Vendor | Product | CPE |
|---|---|---|
| linux | linux kernel | cpe:2.3:o:linux:linux_kernel |
Affected versions
NVD version ranges (for catalog products). Add the product to your stack with a version and matching uses these.
- linux linux kernel5.12 and later · before 5.15.162
- linux linux kernel5.16 and later · before 6.1.96
- linux linux kernel6.2 and later · before 6.6.36
- linux linux kernel6.7 and later · before 6.9.7
- linux linux kernel6.10
Versions reported by the vendor
Affected version ranges reported by the assigning authority (Linux). Independent of NVD's CPE analysis and usually ahead of it.
Linux Linux
- 5.12affected
- c5dbb89fc2ac013afe67b9e4fcb3743c02b567cd and later · before 78e4aa528a7b1204219d808310524344f627d069affected · git
- c5dbb89fc2ac013afe67b9e4fcb3743c02b567cd and later · before 893eeba94c40d513cd0fe6539330ebdaea208c0eaffected · git
- c5dbb89fc2ac013afe67b9e4fcb3743c02b567cd and later · before 454c454ed645fed051216b79622f7cb69c1638f5affected · git
- c5dbb89fc2ac013afe67b9e4fcb3743c02b567cd and later · before 5dfe2408fd7dc4d2e7ac38a116ff0a37b1cfd3b9affected · git
- c5dbb89fc2ac013afe67b9e4fcb3743c02b567cd and later · before 6cd4a78d962bebbaf8beb7d2ead3f34120e3f7b2affected · git
- before 5.12not affected · semver
- 5.15.162 and later · up to and including 5.15.*not affected · semver
- 6.1.96 and later · up to and including 6.1.*not affected · semver
- 6.6.36 and later · up to and including 6.6.*not affected · semver
Package-level exposure
OSV and GitHub Advisory data: ecosystem, package and range. SBOM matching uses this table.
| Ecosystem | Package | Affected range | Fix |
|---|---|---|---|
| Debian:12 | linux | before 6.1.99-1 | 6.1.99-1 |
| Debian:13 | linux | before 6.9.7-1 | 6.9.7-1 |
| SUSE:Linux Enterprise Live Patching 15 SP4 | kernel-livepatch-SLE15-SP4_Update_18 | before 14-150400.2.1 | 14-150400.2.1 |
| SUSE:Linux Enterprise Live Patching 15 SP4 | kernel-livepatch-SLE15-SP4_Update_19 | before 13-150400.2.1 | 13-150400.2.1 |
| SUSE:Linux Enterprise Live Patching 15 SP4 | kernel-livepatch-SLE15-SP4_Update_20 | before 12-150400.2.1 | 12-150400.2.1 |
| SUSE:Linux Enterprise Live Patching 15 SP4 | kernel-livepatch-SLE15-SP4_Update_24 | before 7-150400.9.6.1 | 7-150400.9.6.1 |
| SUSE:Linux Enterprise Live Patching 15 SP4 | kernel-livepatch-SLE15-SP4_Update_25 | before 7-150400.9.8.1 | 7-150400.9.8.1 |
| SUSE:Linux Enterprise Live Patching 15 SP4 | kernel-livepatch-SLE15-SP4_Update_26 | before 8-150400.9.6.1 | 8-150400.9.6.1 |
| SUSE:Linux Enterprise Live Patching 15 SP4 | kernel-livepatch-SLE15-SP4_Update_26 | before 6-150400.9.6.1 | 6-150400.9.6.1 |
| SUSE:Linux Enterprise Live Patching 15 SP4 | kernel-livepatch-SLE15-SP4_Update_26 | before 7-150400.9.6.1 | 7-150400.9.6.1 |
| SUSE:Linux Enterprise Live Patching 15 SP4 | kernel-livepatch-SLE15-SP4_Update_27 | before 4-150400.9.6.1 | 4-150400.9.6.1 |
| SUSE:Linux Enterprise Live Patching 15 SP4 | kernel-livepatch-SLE15-SP4_Update_27 | before 8-150400.9.6.1 | 8-150400.9.6.1 |
| SUSE:Linux Enterprise Live Patching 15 SP4 | kernel-livepatch-SLE15-SP4_Update_27 | before 7-150400.9.6.1 | 7-150400.9.6.1 |
| SUSE:Linux Enterprise Live Patching 15 SP4 | kernel-livepatch-SLE15-SP4_Update_27 | before 6-150400.9.6.1 | 6-150400.9.6.1 |
| SUSE:Linux Enterprise Live Patching 15 SP4 | kernel-livepatch-SLE15-SP4_Update_27 | before 5-150400.9.6.1 | 5-150400.9.6.1 |
| SUSE:Linux Enterprise Live Patching 15 SP4 | kernel-livepatch-SLE15-SP4_Update_28 | before 2-150400.9.6.1 | 2-150400.9.6.1 |
| SUSE:Linux Enterprise Live Patching 15 SP4 | kernel-livepatch-SLE15-SP4_Update_28 | before 3-150400.9.6.1 | 3-150400.9.6.1 |
| SUSE:Linux Enterprise Live Patching 15 SP4 | kernel-livepatch-SLE15-SP4_Update_28 | before 4-150400.9.6.1 | 4-150400.9.6.1 |
| SUSE:Linux Enterprise Live Patching 15 SP4 | kernel-livepatch-SLE15-SP4_Update_28 | before 5-150400.9.6.1 | 5-150400.9.6.1 |
| SUSE:Linux Enterprise Live Patching 15 SP5 | kernel-livepatch-SLE15-SP5_Update_11 | before 7-150500.11.6.1 | 7-150500.11.6.1 |
| SUSE:Linux Enterprise Live Patching 15 SP5 | kernel-livepatch-SLE15-SP5_Update_12 | before 7-150500.11.10.1 | 7-150500.11.10.1 |
| SUSE:Linux Enterprise Live Patching 15 SP5 | kernel-livepatch-SLE15-SP5_Update_12 | before 8-150500.11.10.1 | 8-150500.11.10.1 |
| SUSE:Linux Enterprise Live Patching 15 SP5 | kernel-livepatch-SLE15-SP5_Update_13 | before 7-150500.11.6.1 | 7-150500.11.6.1 |
| SUSE:Linux Enterprise Live Patching 15 SP5 | kernel-livepatch-SLE15-SP5_Update_13 | before 6-150500.11.6.1 | 6-150500.11.6.1 |
+53
Same product
linux: all recordsOther highest-scoring records for the same primary product.
- CVE-2026-31431crypto: algif_aead - Revert to operating out-of-placeKEV90Now
- CVE-2022-0847A flaw was found in the way the "flags" member of the new pipe buffer structure was lacking proper initialization in copy_page_to_iter_pipe KEV89Now
- CVE-2021-22555Heap Out-Of-Bounds Write in Netfilter IP6T_SO_SET_REPLACEKEV85Now
Published before and after this one in the same product
- ← EarlierCVE-2024-40952Jul 12, 2024 · ocfs2: fix NULL pointer dereference in ocfs2_journal_dirty()22Monitor
- ← EarlierCVE-2024-40953Jul 12, 2024 · KVM: Fix a data race on last_boosted_vcpu in kvm_vcpu_on_spin()18Monitor
- Later →CVE-2024-40955Jul 12, 2024 · ext4: fix slab-out-of-bounds in ext4_mb_find_good_group_avg_frag_lists()22Monitor
Remediation
Which version to upgrade to
Fix versions compiled from the vendor, package registries and Microsoft. Verify the vendor's note before upgrading.
| Product / package | Fixed version | Source |
|---|---|---|
| Linux Linux | 454c454ed645fed051216b79622f7cb69c1638f5 | Vendor (CNA) |
| Linux Linux | 5dfe2408fd7dc4d2e7ac38a116ff0a37b1cfd3b9 | Vendor (CNA) |
| Linux Linux | 6cd4a78d962bebbaf8beb7d2ead3f34120e3f7b2 | Vendor (CNA) |
| Linux Linux | 78e4aa528a7b1204219d808310524344f627d069 | Vendor (CNA) |
| Linux Linux | 893eeba94c40d513cd0fe6539330ebdaea208c0e | Vendor (CNA) |
| debian:linux | 6.1.99-1 · Debian:12 | Package registry (OSV) |
| suse:kernel-livepatch-SLE15-SP4_Update_19 | 13-150400.2.1 · SUSE:Linux Enterprise Live Patching 15 SP4 | Package registry (OSV) |
| suse:kernel-livepatch-SLE15-SP5-RT_Update_11 | 7-150500.11.6.1 · SUSE:Linux Enterprise Live Patching 15 SP5 | Package registry (OSV) |
| suse:kernel-livepatch-SLE15-SP5-RT_Update_13 | 7-150500.11.6.1 · SUSE:Linux Enterprise Live Patching 15 SP5 | Package registry (OSV) |
| suse:kernel-livepatch-SLE15-SP5-RT_Update_14 | 5-150500.11.8.1 · SUSE:Linux Enterprise Live Patching 15 SP5 | Package registry (OSV) |
| suse:kernel-livepatch-SLE15-SP5-RT_Update_15 | 5-150500.11.6.1 · SUSE:Linux Enterprise Live Patching 15 SP5 | Package registry (OSV) |
| suse:kernel-livepatch-SLE15-SP5-RT_Update_16 | 4-150500.11.6.1 · SUSE:Linux Enterprise Live Patching 15 SP5 | Package registry (OSV) |
| suse:kernel-livepatch-SLE15-SP5-RT_Update_17 | 2-150500.11.6.1 · SUSE:Linux Enterprise Live Patching 15 SP5 | Package registry (OSV) |
| suse:kernel-livepatch-SLE15-SP5-RT_Update_6 | 13-150500.2.1 · SUSE:Linux Enterprise Live Patching 15 SP5 | Package registry (OSV) |
| suse:kernel-livepatch-SLE15-SP5-RT_Update_7 | 13-150500.2.1 · SUSE:Linux Enterprise Live Patching 15 SP5 | Package registry (OSV) |
| suse:kernel-livepatch-SLE15-SP5-RT_Update_8 | 12-150500.2.1 · SUSE:Linux Enterprise Live Patching 15 SP5 | Package registry (OSV) |
| suse:kernel-livepatch-SLE15-SP6-RT_Update_0 | 4-150600.3.1 · SUSE:Linux Enterprise Live Patching 15 SP6 | Package registry (OSV) |
| suse:kernel-livepatch-SLE15-SP6-RT_Update_1 | 3-150600.1.8.1 · SUSE:Linux Enterprise Live Patching 15 SP6 | Package registry (OSV) |
Exploit status
No known public exploit
No public exploit has been observed yet. That doesn't mean you're safe, only that the bar is a little higher.
Research context
For pentesters and researchers: attack profile, score disagreement, timeline, patch commits, credits, variant and chain candidates, bug bounty scope. All derived from existing data; no exploit code.
Timeline
From publication to today: proof of concept, Metasploit module, CISA KEV and fix record. Dates are as reported by the sources.
No dated events beyond publication.
No history yet (it accumulates with the daily EPSS job).
Patch and commit links
Commit, PR and diff links among the references. A starting point for patch-diffing and variant hunting; fixes, not exploits.
No commit or PR link among the references.
Credits
All researchersFinders, reporters and analysts named in the CNA record. Click a name for that researcher’s other records.
No credits in the CNA record.
Variant candidates
Same product, same weakness class, within 18 months. If the patch missed the root cause, the sibling bug is here.
No nightly-computed relations.
Chain candidates
An authentication bypass and a privilege-requiring bug in the same product, published close together: combined they may become an unauthenticated path.
—
Bug bounty scope
No known public program.
Source: bounty-targets-data (public HackerOne, Bugcrowd, Intigriti, YesWeHack listings).
National notice (Türkiye Cybersecurity Directorate / USOM)
Official security notices citing this record; remediation advice is on the agency's page.
- TR-24-0942 · Jul 16, 2024(Linux Kernel Güncellemesi)
Technical details
Attack conditions
- Someone with local access to the system can trigger it.
- A low-privileged account is enough.
- No user action is required.
- No special conditions are required; it is repeatable.
If successful
- Confidentiality
- high · data can be read
- Integrity
- high · data or configuration can be modified
- Availability
- high · the service can be disrupted
- Attack vector
- Local
- Attack complexity
- Low
- Privileges required
- Low
- User interaction
- None
- Scope
- Unchanged
- Confidentiality impact
- High
- Integrity impact
- High
- Availability impact
- High
Weakness class (CWE)
CWE-416 · Use After FreeCVSS vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
nvd-primary
Root cause
After a memory region is freed, another reference pointing to it is still used. By then, the same region may have been allocated for different data.
The bug in code
The whole CWE-416 classA representative example of this vulnerability class. Not the vendor's source code; it shows the faulty pattern and its fix.
Vulnerable
free(dev->buf);
/* ... another thread is still running ... */
process(dev->buf);Fixed
lock(&dev->lock);
free(dev->buf);
dev->buf = NULL;
unlock(&dev->lock);Attack context
MITRE CAPEC attack patterns and ATT&CK techniques for this weakness class (CWE). A starting point for detection rules and threat hunting.
MITRE has no CAPEC/ATT&CK mapping for this CWE.
Change log
- Fix✗ → ✓
For records you follow, these changes also arrive as notifications. →
References
Show all references (5 more)Show less
- git.kernel.org/stable/c/5dfe2408fd7dc4d2e7ac38a116ff0a37b1cfd3b9
- git.kernel.org/stable/c/6cd4a78d962bebbaf8beb7d2ead3f34120e3f7b2
- git.kernel.org/stable/c/78e4aa528a7b1204219d808310524344f627d069
- git.kernel.org/stable/c/893eeba94c40d513cd0fe6539330ebdaea208c0e
- lists.debian.org/debian-lts-announce/2025/01/msg00001.html
Vendor advisories and official records. Exploit/PoC links are deliberately left out.