Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2024-58240 Overview
CVE-2024-58240 is a flaw in the Linux kernel's Transport Layer Security (TLS) subsystem. The issue affects the handling of synchronous (non-async) decryption requests, where request lifecycle management was intertwined with asynchronous completion logic. The upstream fix separates the non-async decryption path from the async path, simplifying reference counting and request completion handling. The vulnerability is classified under [CWE-416] Use After Free. It affects Linux kernel versions through the 6.8 release candidates and ships in Debian GNU/Linux 11. Siemens has also issued a product advisory covering downstream appliances that embed the affected kernel code.
Critical Impact
A local, authenticated user can trigger memory corruption in the kernel TLS receive path, resulting in potential privilege escalation, data compromise, or denial of service.
Affected Products
- Linux kernel (including 6.8-rc1 through 6.8-rc6)
- Debian GNU/Linux 11
- Siemens products embedding the affected kernel (see Siemens advisory SSA-032379)
Discovery Timeline
- 2025-08-28 - CVE-2024-58240 published to the National Vulnerability Database (NVD)
- 2026-10-15 - Last updated in NVD database
Technical Details for CVE-2024-58240
Vulnerability Analysis
The vulnerability resides in the kernel TLS (kTLS) receive path implemented in net/tls/tls_sw.c. The decryption request handler combined synchronous and asynchronous completion flows, sharing reference counting and a single crypto_wait structure. Under race conditions between async notify and socket close, kernel memory could be freed while still referenced by the completion path, leading to a use-after-free condition.
The upstream series separates the no-async decryption request handling from the async handling, allowing the synchronous path to simply wait for completion and return its result without reference counting. Related work in commit aec7961916f3 ("tls: fix race between async notify and socket close") addressed earlier UAF conditions, and the current fix hardens the separation to prevent regression.
Exploitation requires local access and low privileges. Successful exploitation impacts kernel confidentiality, integrity, and availability.
Root Cause
The root cause is a lifecycle mismatch between synchronous callers and asynchronous crypto completions. Shared state across both paths created windows where socket teardown could race against an in-flight decryption request, leaving dangling pointers accessible via the completion callback.
Attack Vector
An attacker with local shell access and the ability to open AF_INET/AF_INET6 sockets with TCP_ULP set to tls can repeatedly trigger decryption while concurrently closing the socket. By timing socket close against async crypto completion, the attacker drives the kernel into a use-after-free state on TLS receive buffers. The relevant fixes are tracked in kernel commits 41532b78, 48905146, 99911529, and dec5b6e7.
No public proof-of-concept exploit is available at the time of writing.
Detection Methods for CVE-2024-58240
Indicators of Compromise
- Unexpected kernel oops or BUG: KASAN: use-after-free messages referencing tls_sw.c or tls_decrypt_done in dmesg.
- Repeated process crashes or kernel panics on hosts using kTLS offload for applications such as NGINX, HAProxy, or Kafka.
- Local user processes repeatedly opening TLS sockets and triggering abnormal close patterns.
Detection Strategies
- Audit kernel versions against the fixed commits listed in the Debian LTS Announcement and the Siemens Security Advisory.
- Enable KASAN or kernel lockdep on test systems to surface use-after-free conditions in the TLS receive path.
- Monitor auditd for processes using setsockopt with TCP_ULP=tls followed by rapid close sequences from non-service accounts.
Monitoring Recommendations
- Forward /var/log/kern.log and dmesg output to a centralized log platform and alert on use-after-free, general protection fault, or tls_sw strings.
- Baseline legitimate kTLS consumers and alert on new, unprivileged binaries invoking TCP_ULP=tls.
- Track kernel package versions across the fleet and alert when hosts drift from patched baselines.
How to Mitigate CVE-2024-58240
Immediate Actions Required
- Inventory all Linux hosts and identify kernels in the vulnerable range, prioritizing systems that enable kTLS.
- Apply vendor-supplied kernel updates from Debian and distribution partners; reboot to activate the patched kernel.
- For Siemens industrial products, follow the remediation steps in advisory SSA-032379.
- Restrict local shell access on multi-tenant systems until patches are deployed.
Patch Information
The fix is published in the mainline Linux kernel through commits 41532b78, 48905146, 99911529, and dec5b6e7. Debian users should install updates described in the Debian LTS Announcement. Siemens customers should consult the Siemens Security Advisory.
Workarounds
- Disable kernel TLS offload where it is not strictly required by unloading the tls module (modprobe -r tls) and blacklisting it.
- Enforce least-privilege policies to limit local account access on servers running kTLS workloads.
- Apply seccomp or LSM policies to restrict setsockopt(TCP_ULP) to approved service accounts only.
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

