cve.bz

CVE-2024-36904 Use After Free

7.8 highEPSS 0.6%Fix available

High (7.8). EPSS 0.6% estimated probability of exploitation activity in the next 30 days.

On this page
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>

Severity

CVSS 3.1

7.8 high
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
EPSS
0.6% (unchanged from 0.6% a week ago; 0.6% 30 days ago) estimated probability of exploitation activity in the next 30 days; 50th percentile. Scored 2026-11-15. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: none · Automatable: no · Technical impact: partial, assessed 2024-06-12. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWE
CWE-416 Use After Free
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2024-36904 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2024-36904?via=ask-ai-copy and https://cve.bz/cve/CVE-2024-36904?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2024-36904 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the CNA's record in the CVE List.

ProductAffected
Linux4.16 and later

Fixed in

ProductRelease lineFixed in
Linux4.194.19.314
Linux5.45.4.276
Linux5.105.10.217
Linux5.155.15.159
Linux6.16.1.91
Linux6.66.6.31
Linux6.86.8.10
Linuxlater releases6.9

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian10linux4.19.316-1DLA-3840-1
Debian10linux-5.105.10.218-1~deb10u1DLA-3843-1
Debian11linux5.10.218-1DSA-5703-1
Debian12linux6.1.94-1DEBIAN-CVE-2024-36904
Debian13, 14linux6.8.11-1DEBIAN-CVE-2024-36904
Ubuntu16.04:LTSlinux-hwe-edgeno fix listedUBUNTU-CVE-2024-36904
Ubuntu18.04:LTSlinux-gcp, linux-hwe, linux-oem and 12 moreno fix listedUBUNTU-CVE-2024-36904
Ubuntu20.04:LTSlinux5.4.0-192.212UBUNTU-CVE-2024-36904 USN-6951-1
Ubuntu20.04:LTSlinux-aws5.4.0-1130.140UBUNTU-CVE-2024-36904 USN-6951-1
Ubuntu20.04:LTSlinux-aws-5.155.15.0-1067.73~20.04.1UBUNTU-CVE-2024-36904 USN-6950-2
Ubuntu20.04:LTSlinux-azure5.4.0-1135.142UBUNTU-CVE-2024-36904 USN-6951-2
Ubuntu20.04:LTSlinux-azure-5.155.15.0-1070.79~20.04.1UBUNTU-CVE-2024-36904 USN-6956-1
Ubuntu20.04:LTSlinux-azure-fde-5.155.15.0-1070.79~20.04.1.1USN-6956-1
Ubuntu20.04:LTSlinux-bluefield5.4.0-1090.97UBUNTU-CVE-2024-36904 USN-6951-4
Ubuntu20.04:LTSlinux-gcp5.4.0-1134.143UBUNTU-CVE-2024-36904 USN-6951-1
Ubuntu20.04:LTSlinux-gcp-5.155.15.0-1066.74~20.04.1UBUNTU-CVE-2024-36904 USN-6950-1
Ubuntu20.04:LTSlinux-gke, linux-riscv, linux-raspi2 and 24 moreno fix listedUBUNTU-CVE-2024-36904
70 more for Ubuntu in the JSON and on Ubuntu's page.
Red Hatenterprise_linux:8::baseosperf, kernel, bpftool and 30 more0:4.18.0-553.16.1.el8_10RHSA-2024:5101
Red Hatenterprise_linux:8::crbperf-debuginfo, kernel-debuginfo, bpftool-debuginfo and 7 more0:4.18.0-553.16.1.el8_10RHSA-2024:5101
Red Hatenterprise_linux:8::nfvkernel-rt, kernel-rt-kvm, kernel-rt-core and 12 more0:4.18.0-553.16.1.rt7.357.el8_10RHSA-2024:5102
Red Hatenterprise_linux:8::realtimekernel-rt, kernel-rt-core, kernel-rt-debug and 10 more0:4.18.0-553.16.1.rt7.357.el8_10RHSA-2024:5102
Red Hatenterprise_linux:9::appstreamrv, perf, rtla and 26 more0:5.14.0-427.26.1.el9_4RHSA-2024:4583
Red Hatenterprise_linux:9::appstream, enterprise_linux:9::crb, enterprise_linux:9::nfv and 1 morebpftool-debuginfo0:7.3.0-427.26.1.el9_4RHSA-2024:4583
Red Hatenterprise_linux:9::baseosbpftool, bpftool-debuginfo0:7.3.0-427.26.1.el9_4RHSA-2024:4583
Red Hatenterprise_linux:9::baseoskernel, kernel-64k, kernel-core and 43 more0:5.14.0-427.26.1.el9_4RHSA-2024:4583
Red Hatenterprise_linux:9::crblibperf, perf-debuginfo, kernel-debuginfo and 14 more0:5.14.0-427.26.1.el9_4RHSA-2024:4583
Red Hatenterprise_linux:9::nfvkernel-rt, kernel-rt-kvm, kernel-rt-core and 20 more0:5.14.0-427.26.1.el9_4RHSA-2024:4583
Red Hatenterprise_linux:9::realtimekernel-rt, kernel-rt-core, perf-debuginfo and 18 more0:5.14.0-427.26.1.el9_4RHSA-2024:4583
Red Hatrhel_aus:8.6::baseos, rhel_tus:8.6::baseosperf, kernel, bpftool and 20 more0:4.18.0-372.119.1.el8_6RHSA-2024:5692
10 more for Red Hat in the JSON and on Red Hat's page.
SUSEEnterprise Storage 7.1, Linux Enterprise High Performance Computing 15 SP3-LTSSkernel-64kb, kernel-docs, kernel-syms and 4 more5.3.18-150300.59.167.1SUSE-SU-2024:2362-1
SUSEEnterprise Storage 7.1, Linux Enterprise High Performance Computing 15 SP3-LTSS, Linux Enterprise Micro 5.1 and 3 morekernel-default-base5.3.18-150300.59.167.1.150300.18.98.1SUSE-SU-2024:2362-1
SUSELinux Enterprise High Availability Extension 15 SP2, Linux Enterprise Live Patching 15 SP2kernel-default5.3.18-150200.24.197.1SUSE-SU-2024:2365-1
SUSELinux Enterprise High Availability Extension 15 SP3, Linux Enterprise Live Patching 15 SP3, Linux Enterprise Micro 5.1 and 1 morekernel-default5.3.18-150300.59.167.1SUSE-SU-2024:2362-1
SUSELinux Enterprise High Availability Extension 15 SP4, Linux Enterprise Live Patching 15 SP4, Linux Enterprise Micro 5.3 and 1 morekernel-default5.14.21-150400.24.125.1SUSE-SU-2024:2495-1
SUSELinux Enterprise High Availability Extension 15 SP5, Linux Enterprise Live Patching 15 SP5, Linux Enterprise Micro 5.5 and 2 morekernel-default5.14.21-150500.55.73.1SUSE-SU-2024:2939-1
SUSELinux Enterprise High Availability Extension 15 SP6, Linux Enterprise Live Patching 15 SP6, Linux Enterprise Module for Legacy 15 SP6 and 1 morekernel-default6.4.0-150600.23.14.2SUSE-SU-2024:2571-1
SUSELinux Enterprise High Performance Computing 15 SP2-LTSS, Linux Enterprise Server 15 SP2-LTSS, Linux Enterprise Server for SAP Applications 15 SP2kernel-default-base5.3.18-150200.24.197.1.150200.9.101.1SUSE-SU-2024:2365-1
SUSELinux Enterprise High Performance Computing 15 SP2-LTSS, Linux Enterprise Server 15 SP2-LTSS, Linux Enterprise Server for SAP Applications 15 SP2kernel-docs, kernel-syms, kernel-source and 3 more5.3.18-150200.24.197.1SUSE-SU-2024:2365-1
SUSELinux Enterprise High Performance Computing 15 SP4-ESPOS, Linux Enterprise High Performance Computing 15 SP4-LTSSkernel-64kb, kernel-docs, kernel-syms and 3 more5.14.21-150400.24.125.1SUSE-SU-2024:2495-1
SUSELinux Enterprise High Performance Computing 15 SP4-ESPOS, Linux Enterprise High Performance Computing 15 SP4-LTSS, Linux Enterprise Micro 5.3 and 5 morekernel-default-base5.14.21-150400.24.125.1.150400.24.60.1SUSE-SU-2024:2495-1
SUSELinux Enterprise Live Patching 15 SP2kernel-livepatch-SLE15-SP2_Update_4216-150200.2.1SUSE-SU-2024:4276-1
102 more for SUSE in the JSON and on SUSE's page.
openSUSELeap 15.5dtb-aarch64, kernel-64kb, kernel-syms and 7 more5.14.21-150500.55.73.1SUSE-SU-2024:2939-1
openSUSELeap 15.5kernel-azure, kernel-syms-azure, kernel-source-azure5.14.21-150500.33.60.1SUSE-SU-2024:2372-1
openSUSELeap 15.5kernel-docs5.14.21-150500.55.73.2SUSE-SU-2024:2939-1
openSUSELeap 15.5kernel-rt, kernel-syms-rt, kernel-rt_debug and 1 more5.14.21-150500.13.61.1SUSE-SU-2024:2394-1
openSUSELeap 15.5, Leap Micro 5.5kernel-default-base5.14.21-150500.55.73.1.150500.6.33.8SUSE-SU-2024:2939-1
openSUSELeap 15.6dtb-aarch64, kernel-64kb6.4.0-150600.23.14.1SUSE-SU-2024:2571-1
openSUSELeap 15.6kernel-azure, kernel-source-azure6.4.0-150600.8.8.2SUSE-SU-2024:2896-1
openSUSELeap 15.6kernel-default-base6.4.0-150600.23.14.2.150600.12.4.3SUSE-SU-2024:2571-1
openSUSELeap 15.6kernel-docs, kernel-syms, kernel-debug and 6 more6.4.0-150600.23.14.2SUSE-SU-2024:2571-1
openSUSELeap 15.6kernel-rt, kernel-syms-rt, kernel-rt_debug and 1 more6.4.0-150600.10.5.1SUSE-SU-2024:2973-1
openSUSELeap 15.6kernel-syms-azure6.4.0-150600.8.8.1SUSE-SU-2024:2896-1
openSUSELeap Micro 5.5kernel-default5.14.21-150500.55.73.1SUSE-SU-2024:2939-1
AlmaLinux8kernel-rt, kernel-rt-kvm, kernel-rt-core and 9 more4.18.0-553.16.1.rt7.357.el8_10ALSA-2024:5102
AlmaLinux8perf, kernel, bpftool and 22 more4.18.0-553.16.1.el8_10ALSA-2024:5101
AlmaLinux9bpftool7.3.0-427.26.1.el9_4ALSA-2024:4583
AlmaLinux9rv, perf, rtla and 58 more5.14.0-427.26.1.el9_4ALSA-2024:4583
Rocky Linux8kernel0:4.18.0-553.16.1.el8_10RLSA-2024:5101
Rocky Linux8kernel0:4.18.0-553.16.1.el8_10.cloud.0.1RXSA-2024:5101
Rocky Linux8kernel-rt0:4.18.0-553.16.1.rt7.357.el8_10RLSA-2024:5102
Rocky Linux9kernel0:5.14.0-427.26.1.el9_4RLSA-2024:4583
Alpaquita23linux-lts6.1.91-r0BELL-CVE-2024-36904
Alpaquita25, streamlinux-lts6.12.41-r0BELL-CVE-2024-36904

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; Red Hat Security Data © Red Hat, Inc., CC BY 4.0; SUSE security data, CC BY 4.0; AlmaLinux's OSV database, MIT; Rocky Linux's errata, BSD-3-Clause; BellSoft's OSV database, MIT. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · Red Hat · SUSE · openSUSE · Alpaquita.

Red Hat

Red Hat rates this Moderate.

Red Hat's mitigation

Mitigation for this issue is either not available or the currently available options don't meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base or stability.

ProductPackageStateAdvisory
Red Hat Enterprise Linux 8kernel-rt-0:4.18.0-553.16.1.rt7.357.el8_10Fixed 2024-08-08RHSA-2024:5102
Red Hat Enterprise Linux 8kernel-0:4.18.0-553.16.1.el8_10Fixed 2024-08-08RHSA-2024:5101
Red Hat Enterprise Linux 8.6 Advanced Mission Critical Update Supportkernel-0:4.18.0-372.119.1.el8_6Fixed 2024-08-21RHSA-2024:5692
Red Hat Enterprise Linux 8.6 Telecommunications Update Servicekernel-0:4.18.0-372.119.1.el8_6Fixed 2024-08-21RHSA-2024:5692
Red Hat Enterprise Linux 8.6 Update Services for SAP Solutionskernel-0:4.18.0-372.119.1.el8_6Fixed 2024-08-21RHSA-2024:5692
Red Hat Enterprise Linux 8.8 Extended Update Supportkernel-0:4.18.0-477.70.1.el8_8Fixed 2024-09-03RHSA-2024:6206
Red Hat Enterprise Linux 9kernel-0:5.14.0-427.26.1.el9_4Fixed 2024-07-17RHSA-2024:4583
Red Hat Enterprise Linux 9.2 Extended Update Supportkernel-0:5.14.0-284.75.1.el9_2Fixed 2024-07-24RHSA-2024:4823
Red Hat Enterprise Linux 9.2 Extended Update Supportkernel-rt-0:5.14.0-284.75.1.rt14.360.el9_2Fixed 2024-07-24RHSA-2024:4831
Red Hat Enterprise Linux 6kernelOut of support scope
Red Hat Enterprise Linux 7kernelOut of support scope
Red Hat Enterprise Linux 7kernel-rtOut of support scope
Red Hat Enterprise Linux 9kernel-rtAffected

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2024-36904.

ICS advisories (CISA)

AdvisoryTitlePublishedSectorsAffectedFixed
ICSA-25-226-15Siemens SINEC OS2025-08-12Critical Manufacturing, Transportation Systems, Energy, Healthcare and Public Health, Financial Services, Government Services and FacilitiesRUGGEDCOM RST2428P (6GK6242-6PA00), SCALANCE XCM-/XRM-/XCH-/XRH-300 familynone listed
ICSA-24-102-01Siemens SIMATIC S7-1500 TM MFP2024-04-09Critical ManufacturingSIMATIC S7-1500 TM MFP - GNU/Linux subsystemnone listed
ICSA-23-348-10Siemens SIMATIC S7-15002023-12-12Critical Manufacturing, Transportation Systems, Energy, Healthcare and Public Health, Financial Services, Government Services and FacilitiesSIMATIC S7-1500 CPU 1518-4 PN/DP MFP (6ES7518-4AX00-1AB0), SIMATIC S7-1500 CPU 1518-4 PN/DP MFP (6ES7518-4AX00-1AC0), SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP (6ES7518-4FX00-1AB0) and 2 morenone listed

From CISA's ICS advisories (CSAF), provided under CISA's notification. Only the facts are shown; each advisory is on CISA's page. Credits.

References

Check your stackJSON