Skip to content
Memory corruption Write-up Advanced

(CVE-2025-39682) Linux Kernel net/tls Use-After-Free in tls_sw_recvmsg Leading to Privilege Escalation

A use-after-free flaw exists in the Linux kernel's net/tls subsystem, specifically in tls_sw_recvmsg. A local unprivileged attacker could exploit this to elevate privileges to root.

starlabs.sg

Published on starlabs.sg

The Linux kernel’s net/tls subsystem implements kernel-side TLS record processing. When a socket is configured with TCPULP set to "tls", receive-path processing is handled by tlsswrecvmsg, which decrypts incoming TLS records and delivers plaintext to the caller.

The author, on starlabs.sg

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Impact

A local unprivileged attacker could elevate privileges to root.

What the attacker needed

Local access to the system; unprivileged user account

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

A use-after-free is a memory bug where a program keeps using memory after it has been freed, which can let an attacker control what happens next. Here, a local user on the machine could trigger this bug in the kernel's TLS handling to gain root (administrator) rights.

What is Memory corruption?

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.