Skip to content
Noroxi
NVD / CVE Program· CNA Linux

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().

HighCVSS 7.8 · v3.1—No exploit Fix available
Published
Jul 12, 2024
Updated
Aug 5, 2026
EPSS
0.2% · 17th percentile

Report tools

JSON

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.

Follow CVE-2024-40954

When you'll hear from us

  • when it enters CISA KEV
  • when exploit code appears or is weaponized
  • when the record is updated (including a fixed version)
  • when EPSS rises 20 points in a week

One daily email digest (06:00 UTC); connect a webhook for KEV listings and weaponized exploits instantly.

Your free account also gets you

Running WordPress? Scan your site free with WP Lens

  • Stack alerts: add the products and versions you run, get the new CVEs that affect them
  • Uptime monitoring: 1 site, instant email when it goes down
  • Add your domain: subdomains and takeover risk scanned every week (1 domain)
  • 10 scans an hour on the security tools (3 a day without an account), an API key and MCP
  • All your scans in one panel: findings, what changed in the last scan, a report per domain or per client (PDF, share link)
All free tools

Sign up with email · Have an account? Sign in

Free account, no card. Unfollow any time.

Running WordPress? Scan your site free with WP Lens

Is your version affected? Check it

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 help

Affected 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.

VendorProduct
linuxlinux 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.

EcosystemPackageAffected rangeFix
Debian:12linuxbefore 6.1.99-16.1.99-1
Debian:13linuxbefore 6.9.7-16.9.7-1
SUSE:Linux Enterprise Live Patching 15 SP4kernel-livepatch-SLE15-SP4_Update_18before 14-150400.2.114-150400.2.1
SUSE:Linux Enterprise Live Patching 15 SP4kernel-livepatch-SLE15-SP4_Update_19before 13-150400.2.113-150400.2.1
SUSE:Linux Enterprise Live Patching 15 SP4kernel-livepatch-SLE15-SP4_Update_20before 12-150400.2.112-150400.2.1
SUSE:Linux Enterprise Live Patching 15 SP4kernel-livepatch-SLE15-SP4_Update_24before 7-150400.9.6.17-150400.9.6.1
SUSE:Linux Enterprise Live Patching 15 SP4kernel-livepatch-SLE15-SP4_Update_25before 7-150400.9.8.17-150400.9.8.1
SUSE:Linux Enterprise Live Patching 15 SP4kernel-livepatch-SLE15-SP4_Update_26before 8-150400.9.6.18-150400.9.6.1
SUSE:Linux Enterprise Live Patching 15 SP4kernel-livepatch-SLE15-SP4_Update_26before 6-150400.9.6.16-150400.9.6.1
SUSE:Linux Enterprise Live Patching 15 SP4kernel-livepatch-SLE15-SP4_Update_26before 7-150400.9.6.17-150400.9.6.1
SUSE:Linux Enterprise Live Patching 15 SP4kernel-livepatch-SLE15-SP4_Update_27before 4-150400.9.6.14-150400.9.6.1
SUSE:Linux Enterprise Live Patching 15 SP4kernel-livepatch-SLE15-SP4_Update_27before 8-150400.9.6.18-150400.9.6.1
SUSE:Linux Enterprise Live Patching 15 SP4kernel-livepatch-SLE15-SP4_Update_27before 7-150400.9.6.17-150400.9.6.1
SUSE:Linux Enterprise Live Patching 15 SP4kernel-livepatch-SLE15-SP4_Update_27before 6-150400.9.6.16-150400.9.6.1
SUSE:Linux Enterprise Live Patching 15 SP4kernel-livepatch-SLE15-SP4_Update_27before 5-150400.9.6.15-150400.9.6.1
SUSE:Linux Enterprise Live Patching 15 SP4kernel-livepatch-SLE15-SP4_Update_28before 2-150400.9.6.12-150400.9.6.1
SUSE:Linux Enterprise Live Patching 15 SP4kernel-livepatch-SLE15-SP4_Update_28before 3-150400.9.6.13-150400.9.6.1
SUSE:Linux Enterprise Live Patching 15 SP4kernel-livepatch-SLE15-SP4_Update_28before 4-150400.9.6.14-150400.9.6.1
SUSE:Linux Enterprise Live Patching 15 SP4kernel-livepatch-SLE15-SP4_Update_28before 5-150400.9.6.15-150400.9.6.1
SUSE:Linux Enterprise Live Patching 15 SP5kernel-livepatch-SLE15-SP5_Update_11before 7-150500.11.6.17-150500.11.6.1
SUSE:Linux Enterprise Live Patching 15 SP5kernel-livepatch-SLE15-SP5_Update_12before 7-150500.11.10.17-150500.11.10.1
SUSE:Linux Enterprise Live Patching 15 SP5kernel-livepatch-SLE15-SP5_Update_12before 8-150500.11.10.18-150500.11.10.1
SUSE:Linux Enterprise Live Patching 15 SP5kernel-livepatch-SLE15-SP5_Update_13before 7-150500.11.6.17-150500.11.6.1
SUSE:Linux Enterprise Live Patching 15 SP5kernel-livepatch-SLE15-SP5_Update_13before 6-150500.11.6.16-150500.11.6.1

+53

Other highest-scoring records for the same primary product.

  • CVE-2026-31431crypto: algif_aead - Revert to operating out-of-placeKEV
    90Now
  • 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 KEV
    89Now
  • CVE-2021-22555Heap Out-Of-Bounds Write in Netfilter IP6T_SO_SET_REPLACEKEV
    85Now

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 / packageFixed versionSource
Linux Linux454c454ed645fed051216b79622f7cb69c1638f5Vendor (CNA)
Linux Linux5dfe2408fd7dc4d2e7ac38a116ff0a37b1cfd3b9Vendor (CNA)
Linux Linux6cd4a78d962bebbaf8beb7d2ead3f34120e3f7b2Vendor (CNA)
Linux Linux78e4aa528a7b1204219d808310524344f627d069Vendor (CNA)
Linux Linux893eeba94c40d513cd0fe6539330ebdaea208c0eVendor (CNA)
debian:linux6.1.99-1 · Debian:12Package registry (OSV)
suse:kernel-livepatch-SLE15-SP4_Update_1913-150400.2.1 · SUSE:Linux Enterprise Live Patching 15 SP4Package registry (OSV)
suse:kernel-livepatch-SLE15-SP5-RT_Update_117-150500.11.6.1 · SUSE:Linux Enterprise Live Patching 15 SP5Package registry (OSV)
suse:kernel-livepatch-SLE15-SP5-RT_Update_137-150500.11.6.1 · SUSE:Linux Enterprise Live Patching 15 SP5Package registry (OSV)
suse:kernel-livepatch-SLE15-SP5-RT_Update_145-150500.11.8.1 · SUSE:Linux Enterprise Live Patching 15 SP5Package registry (OSV)
suse:kernel-livepatch-SLE15-SP5-RT_Update_155-150500.11.6.1 · SUSE:Linux Enterprise Live Patching 15 SP5Package registry (OSV)
suse:kernel-livepatch-SLE15-SP5-RT_Update_164-150500.11.6.1 · SUSE:Linux Enterprise Live Patching 15 SP5Package registry (OSV)
suse:kernel-livepatch-SLE15-SP5-RT_Update_172-150500.11.6.1 · SUSE:Linux Enterprise Live Patching 15 SP5Package registry (OSV)
suse:kernel-livepatch-SLE15-SP5-RT_Update_613-150500.2.1 · SUSE:Linux Enterprise Live Patching 15 SP5Package registry (OSV)
suse:kernel-livepatch-SLE15-SP5-RT_Update_713-150500.2.1 · SUSE:Linux Enterprise Live Patching 15 SP5Package registry (OSV)
suse:kernel-livepatch-SLE15-SP5-RT_Update_812-150500.2.1 · SUSE:Linux Enterprise Live Patching 15 SP5Package registry (OSV)
suse:kernel-livepatch-SLE15-SP6-RT_Update_04-150600.3.1 · SUSE:Linux Enterprise Live Patching 15 SP6Package registry (OSV)
suse:kernel-livepatch-SLE15-SP6-RT_Update_13-150600.1.8.1 · SUSE:Linux Enterprise Live Patching 15 SP6Package 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.

Finders, 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.

All national notices →

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 Free

CVSS 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.

A representative example of this vulnerability class. Not the vendor's source code; it shows the faulty pattern and its fix.

Vulnerable

c
free(dev->buf);/* ... another thread is still running ... */process(dev->buf);

Fixed

c
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

  1. Fix✗ → ✓

For records you follow, these changes also arrive as notifications. →

References

All records