Skip to content
Noroxi
NVD / CVE Program· CNA Linux

CVE-2024-36904: tcp: Use refcount_inc_not_zero() in tcp_twsk_unique().

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.61% (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 13ed7cdf079686ccd3618335205700c03f6fb446, 1796ca9c6f5bd50554214053af5f47d112818ee3, 1d9cf07810c30ef7948879567d10fd1f01121d34.

Low priority for now. Upgrade to Linux Linux 13ed7cdf079686ccd3618335205700c03f6fb446, 1796ca9c6f5bd50554214053af5f47d112818ee3, 1d9cf07810c30ef7948879567d10fd1f01121d34 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: tcp: Use refcount_inc_not_zero() in tcp_twsk_unique(). Anderson Nascimento reported a use-after-free splat in tcp_twsk_unique() with nice analysis. Since commit ec94c2696f0b ("tcp/dccp: avoid one atomic operation for timewait hashdance"), inet_twsk_hashdance() sets TIME-WAIT socket's sk_refcnt after putting it into ehash and releasing the bucket lock. Thus, there is a small race window where other threads could try to reuse the port during connect() and call sock_hold() in tcp_twsk_unique() for the TIME-WAIT socket with zero refcnt. If that happens, the refcnt taken by tcp_twsk_unique() is overwritten and sock_put() will cause underflow, triggering a real use-after-free somewhere else. To avoid the use-after-free, we need to use refcount_inc_not_zero() in tcp_twsk_unique() and give up on reusing the port if it returns false. [0]: refcount_t: addition on 0; use-after-free. WARNING: CPU: 0 PID: 1039313 at lib/refcount.c:25 refcount_warn_saturate+0xe5/0x110 CPU: 0 PID: 1039313 Comm: trigger Not tainted 6.8.6-200.fc39.x86_64 #1 Hardware name: VMware, Inc. VMware20,1/440BX Desktop Reference Platform, BIOS VMW201.00V.21805430.B64.2305221830 05/22/2023 RIP: 0010:refcount_warn_saturate+0xe5/0x110 Code: 42 8e ff 0f 0b c3 cc cc cc cc 80 3d aa 13 ea 01 00 0f 85 5e ff ff ff 48 c7 c7 f8 8e b7 82 c6 05 96 13 ea 01 01 e8 7b 42 8e ff <0f> 0b c3 cc cc cc cc 48 c7 c7 50 8f b7 82 c6 05 7a 13 ea 01 01 e8 RSP: 0018:ffffc90006b43b60 EFLAGS: 00010282 RAX: 0000000000000000 RBX: ffff888009bb3ef0 RCX: 0000000000000027 RDX: ffff88807be218c8 RSI: 0000000000000001 RDI: ffff88807be218c0 RBP: 0000000000069d70 R08: 0000000000000000 R09: ffffc90006b439f0 R10: ffffc90006b439e8 R11: 0000000000000003 R12: ffff8880029ede84 R13: 0000000000004e20 R14: ffffffff84356dc0 R15: ffff888009bb3ef0 FS: 00007f62c10926c0(0000) GS:ffff88807be00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000020ccb000 CR3: 000000004628c005 CR4: 0000000000f70ef0 PKRU: 55555554 Call Trace: <TASK> ? refcount_warn_saturate+0xe5/0x110 ? __warn+0x81/0x130 ? refcount_warn_saturate+0xe5/0x110 ? report_bug+0x171/0x1a0 ? refcount_warn_saturate+0xe5/0x110 ? handle_bug+0x3c/0x80 ? exc_invalid_op+0x17/0x70 ? asm_exc_invalid_op+0x1a/0x20 ? refcount_warn_saturate+0xe5/0x110 tcp_twsk_unique+0x186/0x190 __inet_check_established+0x176/0x2d0 __inet_hash_connect+0x74/0x7d0 ? __pfx___inet_check_established+0x10/0x10 tcp_v4_connect+0x278/0x530 __inet_stream_connect+0x10f/0x3d0 inet_stream_connect+0x3a/0x60 __sys_connect+0xa8/0xd0 __x64_sys_connect+0x18/0x20 do_syscall_64+0x83/0x170 entry_SYSCALL_64_after_hwframe+0x78/0x80 RIP: 0033:0x7f62c11a885d Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d a3 45 0c 00 f7 d8 64 89 01 48 RSP: 002b:00007f62c1091e58 EFLAGS: 00000296 ORIG_RAX: 000000000000002a RAX: ffffffffffffffda RBX: 0000000020ccb004 RCX: 00007f62c11a885d RDX: 0000000000000010 RSI: 0000000020ccb000 RDI: 0000000000000003 RBP: 00007f62c1091e90 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000296 R12: 00007f62c10926c0 R13: ffffffffffffff88 R14: 0000000000000000 R15: 00007ffe237885b0 </TASK>

HighCVSS 7.8 · v3.1—No exploit Fix available
Published
May 30, 2024
Updated
Oct 15, 2026
EPSS
0.6% · 49th 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.6%

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-36904

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
debiandebian linux

Affected versions

NVD version ranges (for catalog products). Add the product to your stack with a version and matching uses these.

  • debian debian linux10.0
  • linux linux kernel4.20 and later · before 5.4.276
  • linux linux kernel5.5 and later · before 5.10.217
  • linux linux kernel5.11 and later · before 5.15.159
  • linux linux kernel4.16 and later · before 4.19.314
  • linux linux kernel6.2 and later · before 6.6.31
  • linux linux kernel6.7 and later · before 6.8.10
  • linux linux kernel5.16 and later · before 6.1.91
  • linux linux kernel6.9

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

    • 4.16affected
    • ec94c2696f0bcd5ae92a553244e4ac30d2171a2d and later · before 84546cc1aeeb4df3e444b18a4293c9823f974be9affected · git
    • ec94c2696f0bcd5ae92a553244e4ac30d2171a2d and later · before 1796ca9c6f5bd50554214053af5f47d112818ee3affected · git
    • ec94c2696f0bcd5ae92a553244e4ac30d2171a2d and later · before 1d9cf07810c30ef7948879567d10fd1f01121d34affected · git
    • ec94c2696f0bcd5ae92a553244e4ac30d2171a2d and later · before 27b0284d8be182a81feb65581ab6a724dfd596e8affected · git
    • ec94c2696f0bcd5ae92a553244e4ac30d2171a2d and later · before 13ed7cdf079686ccd3618335205700c03f6fb446affected · git
    • ec94c2696f0bcd5ae92a553244e4ac30d2171a2d and later · before 6e48faad92be13166184d21506e4e54c79c13adcaffected · git
    • ec94c2696f0bcd5ae92a553244e4ac30d2171a2d and later · before 517e32ea0a8c72202d0d8aa8df50a7cd3d6fdefcaffected · git
    • ec94c2696f0bcd5ae92a553244e4ac30d2171a2d and later · before f2db7230f73a80dbb179deab78f88a7947f0ab7eaffected · git
    • before 4.16not affected · semver

Package-level exposure

OSV and GitHub Advisory data: ecosystem, package and range. SBOM matching uses this table.

EcosystemPackageAffected rangeFix
AlmaLinux:9bpftoolbefore 7.3.0-427.26.1.el9_47.3.0-427.26.1.el9_4
AlmaLinux:9kernelbefore 5.14.0-427.26.1.el9_45.14.0-427.26.1.el9_4
AlmaLinux:9kernel-64kbefore 5.14.0-427.26.1.el9_45.14.0-427.26.1.el9_4
AlmaLinux:9kernel-64k-corebefore 5.14.0-427.26.1.el9_45.14.0-427.26.1.el9_4
AlmaLinux:9kernel-64k-debugbefore 5.14.0-427.26.1.el9_45.14.0-427.26.1.el9_4
AlmaLinux:9kernel-64k-debug-corebefore 5.14.0-427.26.1.el9_45.14.0-427.26.1.el9_4
AlmaLinux:9kernel-64k-debug-develbefore 5.14.0-427.26.1.el9_45.14.0-427.26.1.el9_4
AlmaLinux:9kernel-64k-debug-devel-matchedbefore 5.14.0-427.26.1.el9_45.14.0-427.26.1.el9_4
AlmaLinux:9kernel-64k-debug-modulesbefore 5.14.0-427.26.1.el9_45.14.0-427.26.1.el9_4
AlmaLinux:9kernel-64k-debug-modules-corebefore 5.14.0-427.26.1.el9_45.14.0-427.26.1.el9_4
AlmaLinux:9kernel-64k-debug-modules-extrabefore 5.14.0-427.26.1.el9_45.14.0-427.26.1.el9_4
AlmaLinux:9kernel-64k-develbefore 5.14.0-427.26.1.el9_45.14.0-427.26.1.el9_4
AlmaLinux:9kernel-64k-devel-matchedbefore 5.14.0-427.26.1.el9_45.14.0-427.26.1.el9_4
AlmaLinux:9kernel-64k-modulesbefore 5.14.0-427.26.1.el9_45.14.0-427.26.1.el9_4
AlmaLinux:9kernel-64k-modules-corebefore 5.14.0-427.26.1.el9_45.14.0-427.26.1.el9_4
AlmaLinux:9kernel-64k-modules-extrabefore 5.14.0-427.26.1.el9_45.14.0-427.26.1.el9_4
AlmaLinux:9kernel-abi-stablelistsbefore 5.14.0-427.26.1.el9_45.14.0-427.26.1.el9_4
AlmaLinux:9kernel-corebefore 5.14.0-427.26.1.el9_45.14.0-427.26.1.el9_4
AlmaLinux:9kernel-cross-headersbefore 5.14.0-427.26.1.el9_45.14.0-427.26.1.el9_4
AlmaLinux:9kernel-debugbefore 5.14.0-427.26.1.el9_45.14.0-427.26.1.el9_4
AlmaLinux:9kernel-debug-corebefore 5.14.0-427.26.1.el9_45.14.0-427.26.1.el9_4
AlmaLinux:9kernel-debug-develbefore 5.14.0-427.26.1.el9_45.14.0-427.26.1.el9_4
AlmaLinux:9kernel-debug-devel-matchedbefore 5.14.0-427.26.1.el9_45.14.0-427.26.1.el9_4
AlmaLinux:9kernel-debug-modulesbefore 5.14.0-427.26.1.el9_45.14.0-427.26.1.el9_4

+96

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-36902May 30, 2024 · ipv6: fib6_rules: avoid possible NULL dereference in fib6_rule_action()
    22Monitor
  • ← EarlierCVE-2024-36903May 30, 2024 · ipv6: Fix potential uninit-value access in __ip6_make_skb()
    22Monitor
  • Later →CVE-2024-36905May 30, 2024 · tcp: defer shutdown(SEND_SHUTDOWN) for TCP_SYN_RECV sockets
    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 Linux13ed7cdf079686ccd3618335205700c03f6fb446Vendor (CNA)
Linux Linux1796ca9c6f5bd50554214053af5f47d112818ee3Vendor (CNA)
Linux Linux1d9cf07810c30ef7948879567d10fd1f01121d34Vendor (CNA)
Linux Linux27b0284d8be182a81feb65581ab6a724dfd596e8Vendor (CNA)
Linux Linux517e32ea0a8c72202d0d8aa8df50a7cd3d6fdefcVendor (CNA)
Linux Linux6e48faad92be13166184d21506e4e54c79c13adcVendor (CNA)
Linux Linux84546cc1aeeb4df3e444b18a4293c9823f974be9Vendor (CNA)
Linux Linuxf2db7230f73a80dbb179deab78f88a7947f0ab7eVendor (CNA)
almalinux:bpftool7.3.0-427.26.1.el9_4 · AlmaLinux:9Package registry (OSV)
almalinux:kernel5.14.0-427.26.1.el9_4 · AlmaLinux:9Package registry (OSV)
almalinux:kernel-64k5.14.0-427.26.1.el9_4 · AlmaLinux:9Package registry (OSV)
almalinux:kernel-64k-core5.14.0-427.26.1.el9_4 · AlmaLinux:9Package registry (OSV)
almalinux:kernel-64k-debug5.14.0-427.26.1.el9_4 · AlmaLinux:9Package registry (OSV)
almalinux:kernel-64k-debug-core5.14.0-427.26.1.el9_4 · AlmaLinux:9Package registry (OSV)
almalinux:kernel-64k-debug-devel5.14.0-427.26.1.el9_4 · AlmaLinux:9Package registry (OSV)
almalinux:kernel-64k-debug-devel-matched5.14.0-427.26.1.el9_4 · AlmaLinux:9Package registry (OSV)
almalinux:kernel-64k-debug-modules5.14.0-427.26.1.el9_4 · AlmaLinux:9Package registry (OSV)
almalinux:kernel-64k-debug-modules-core5.14.0-427.26.1.el9_4 · AlmaLinux:9Package registry (OSV)
almalinux:kernel-64k-debug-modules-extra5.14.0-427.26.1.el9_4 · AlmaLinux:9Package registry (OSV)
almalinux:kernel-64k-devel5.14.0-427.26.1.el9_4 · AlmaLinux:9Package registry (OSV)
debian:linux6.1.94-1 · Debian:12Package registry (OSV)
debian:linux-5.105.10.218-1~deb10u1 · Debian:10Package registry (OSV)
red hat:bpftool-debuginfo0:7.3.0-427.26.1.el9_4 · Red Hat:enterprise_linux:9::appstreamPackage registry (OSV)
red hat:kernel-64k-debug-debuginfo0:5.14.0-427.26.1.el9_4 · Red Hat:enterprise_linux:9::appstreamPackage registry (OSV)
red hat:kernel-64k-debug-devel0:5.14.0-427.26.1.el9_4 · Red Hat:enterprise_linux:9::appstreamPackage registry (OSV)
red hat:kernel-64k-debug-devel-matched0:5.14.0-427.26.1.el9_4 · Red Hat:enterprise_linux:9::appstreamPackage registry (OSV)
red hat:kernel-64k-debuginfo0:5.14.0-427.26.1.el9_4 · Red Hat:enterprise_linux:9::appstreamPackage registry (OSV)
red hat:kernel-64k-devel0:5.14.0-427.26.1.el9_4 · Red Hat:enterprise_linux:9::appstreamPackage registry (OSV)
red hat:kernel-64k-devel-matched0:5.14.0-427.26.1.el9_4 · Red Hat:enterprise_linux:9::appstreamPackage registry (OSV)
red hat:kernel-debug-debuginfo0:5.14.0-427.26.1.el9_4 · Red Hat:enterprise_linux:9::appstreamPackage registry (OSV)

+17

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

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