CVE-2026-31533

In the Linux kernel, the following vulnerability has been resolved: net/tls: fix use-after-free in -EBUSY error path of tls_do_encryption The -EBUSY handling in tls_do_encryption(), introduced by commit 859054147318 ("net: tls: handle backlogging of crypto requests"), has a use-after-free due to double cleanup of encrypt_pending and the scatterlist entry. When crypto_aead_encrypt() returns -EBUSY, the request is enqueued to the cryptd backlog and the async callback tls_encrypt_done() will be invoked upon completion. That callback unconditionally restores the scatterlist entry (sge->offset, sge->length) and decrements ctx->encrypt_pending. However, if tls_encrypt_async_wait() returns an error, the synchronous error path in tls_do_encryption() performs the same cleanup again, double-decrementing encrypt_pending and double-restoring the scatterlist. The double-decrement corrupts the encrypt_pending sentinel (initialized to 1), making tls_encrypt_async_wait() permanently skip the wait for pending async callbacks. A subsequent sendmsg can then free the tls_rec via bpf_exec_tx_verdict() 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 encrypt_pending and sge restoration.
Configurations

Configuration 1 (hide)

OR cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:7.0:rc1:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:7.0:rc2:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:7.0:rc3:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:7.0:rc4:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:7.0:rc5:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:7.0:rc6:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:7.0:rc7:*:*:*:*:*:*

History

11 Nov 2026, 23:10

Type Values Removed Values Added
Summary
  • (es) En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta: net/tls: corrige uso después de liberación en la ruta de error -EBUSY de tls_do_encryption El manejo de -EBUSY en tls_do_encryption(), introducido por el commit 859054147318 (’net: tls: maneja el retraso de las solicitudes criptográficas’), tiene un uso después de liberación debido a la doble limpieza de encrypt_pending y la entrada de scatterlist. Cuando crypto_aead_encrypt() devuelve -EBUSY, la solicitud se encola en el backlog de cryptd y la devolución de llamada asíncrona tls_encrypt_done() será invocada al finalizar. Esa devolución de llamada restaura incondicionalmente la entrada de scatterlist (sge -> offset, sge -> length) y decrementa ctx -> encrypt_pending. Sin embargo, si tls_encrypt_async_wait() devuelve un error, la ruta de error síncrona en tls_do_encryption() realiza la misma limpieza de nuevo, decrementando doblemente encrypt_pending y restaurando doblemente el scatterlist. El doble decremento corrompe el centinela encrypt_pending (inicializado a 1), haciendo que tls_encrypt_async_wait() omita permanentemente la espera de las devoluciones de llamada asíncronas pendientes. Un sendmsg posterior puede entonces liberar el tls_rec a través de bpf_exec_tx_verdict() mientras una devolución de llamada de cryptd aún está pendiente, resultando en un uso después de liberación cuando la devolución de llamada se activa en el registro liberado. Soluciona esto omitiendo la limpieza síncrona cuando la espera asíncrona de -EBUSY devuelve un error, ya que la devolución de llamada ya ha manejado la restauración de encrypt_pending y sge.

15 Oct 2026, 02:19

Type Values Removed Values Added
References
  • () https://cert-portal.siemens.com/productcert/html/ssa-457936.html -

Information

Published : 2026-04-23 18:16

Updated : 2026-11-11 23:10


NVD link : CVE-2026-31533

Mitre link : CVE-2026-31533

CVE.ORG link : CVE-2026-31533


JSON object : View

Products Affected

linux

  • linux_kernel
CWE
CWE-416

Use After Free