CVE-2026-23240: tls: Fix race condition in tls_sw_cancel_work_tx()
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
tls: Fix race condition in tls_sw_cancel_work_tx()
This issue was discovered during a code audit.
After cancel_delayed_work_sync() is called from tls_sk_proto_close(), tx_work_handler() can still be scheduled from paths such as the Delayed ACK handler or ksoftirqd.
As a result, the tx_work_handler() worker may dereference a freed TLS object.
The following is a simple race scenario:
cpu0 cpu1
tls_sk_proto_close()
tls_sw_cancel_work_tx()
tls_write_space()
tls_sw_write_space()
if (!test_and_set_bit(BIT_TX_SCHEDULED, &tx_ctx->tx_bitmask))
set_bit(BIT_TX_SCHEDULED, &ctx->tx_bitmask);
cancel_delayed_work_sync(&ctx->tx_work.work);
schedule_delayed_work(&tx_ctx->tx_work.work, 0);To prevent this race condition, cancel_delayed_work_sync() is replaced with disable_delayed_work_sync().
The Linux kernel CVE team has assigned CVE-2026-23240 to this issue.
Affected and fixed versions
===========================
Issue introduced in 5.3 with commit f87e62d45e51b12d48d2cb46b5cde8f83b866bc4 and fixed in 6.12.75 with commit a5de36d6cee74a92c1a21b260bc507e64bc451de Issue introduced in 5.3 with commit f87e62d45e51b12d48d2cb46b5cde8f83b866bc4 and fixed in 6.18.16 with commit 854cd32bc74fe573353095e90958490e4e4d641b Issue introduced in 5.3 with commit f87e62d45e51b12d48d2cb46b5cde8f83b866bc4 and fixed in 6.19.6 with commit 17153f154f80be2b47ebf52840f2d8f724eb2f3b Issue introduced in 5.3 with commit f87e62d45e51b12d48d2cb46b5cde8f83b866bc4 and fixed in 7.0-rc2 with commit 7bb09315f93dce6acc54bf59e5a95ba7365c2be4
Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.
Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at
https://cve.org/CVERecord/?id=CVE-2026-23240
will be updated if fixes are backported, please check that for the most up to date information about this issue.
Affected files
==============
The file(s) affected by this issue are:
net/tls/tls_sw.c
Mitigation
==========
The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:
https://git.kernel.org/stable/c/a5de36d6cee74a92c1a21b260bc507e64bc451de https://git.kernel.org/stable/c/854cd32bc74fe573353095e90958490e4e4d641b https://git.kernel.org/stable/c/17153f154f80be2b47ebf52840f2d8f724eb2f3b https://git.kernel.org/stable/c/7bb09315f93dce6acc54bf59e5a95ba7365c2be4