CVE-2026-31533: net/tls: fix use-after-free in -EBUSY error path of tls_do_encryption
In the Linux kernel, the following vulnerability has been resolved:
net/tls: fix use-after-free in -EBUSY error path of tlsdoencryption
The -EBUSY handling in tlsdoencryption(), introduced by commit 859054147318 ("net: tls: handle backlogging of crypto requests"), has a use-after-free due to double cleanup of encryptpending and the scatterlist entry.
When cryptoaeadencrypt() returns -EBUSY, the request is enqueued to the cryptd backlog and the async callback tlsencryptdone() will be invoked upon completion. That callback unconditionally restores the scatterlist entry (sge->offset, sge->length) and decrements ctx->encryptpending. However, if tlsencryptasyncwait() returns an error, the synchronous error path in tlsdoencryption() performs the same cleanup again, double-decrementing encryptpending and double-restoring the scatterlist.
The double-decrement corrupts the encryptpending sentinel (initialized to 1), making tlsencryptasyncwait() permanently skip the wait for pending async callbacks. A subsequent sendmsg can then free the tlsrec via bpfexectxverdict() while a cryptd callback is still pending, resulting in a use-after-free when the callback fires on the freed record.
Fix this by skipping the synchronous cleanup when the -EBUSY async wait returns an error, since the callback has already handled encryptpending and sge restoration.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 5.10.223-1Fixed in 5.10.257-1Fixed in 6.1.170-3Fixed in 6.1.174-1Fixed in 6.12.86-1Fixed in 6.12.90-2Fixed in 7.0.10-1 - Upgrade
Upgrade
debian/linux-6.1to a version that resolves this vulnerability.Fixed in 6.1.174-1~deb11u1 - Upgrade
Upgrade
Linux kernel net/tlsto a version that resolves this vulnerability.Patch 859054147318
Event History
Frequently Asked Questions
What is the severity of CVE-2026-31533?
CVE-2026-31533 has been classified as a high severity vulnerability due to the potential for misuse of freed memory.
How do I fix CVE-2026-31533?
To fix CVE-2026-31533, update the Linux kernel to a version that includes the patch for the use-after-free vulnerability.
What affected software is impacted by CVE-2026-31533?
CVE-2026-31533 affects the Linux kernel specifically.
What type of vulnerability is CVE-2026-31533?
CVE-2026-31533 is classified as a use-after-free vulnerability in the TLS encryption handling code.
What is the impact of CVE-2026-31533 on system security?
The impact of CVE-2026-31533 could lead to potential unauthorized access or crashes due to memory misuse.