CVE-2025-23142
Severity CVSS v4.0:
Pending analysis
Type:
CWE-416
Use After Free
Publication date:
01/05/2025
Last modified:
05/11/2025
Description
In the Linux kernel, the following vulnerability has been resolved:<br />
<br />
sctp: detect and prevent references to a freed transport in sendmsg<br />
<br />
sctp_sendmsg() re-uses associations and transports when possible by<br />
doing a lookup based on the socket endpoint and the message destination<br />
address, and then sctp_sendmsg_to_asoc() sets the selected transport in<br />
all the message chunks to be sent.<br />
<br />
There&#39;s a possible race condition if another thread triggers the removal<br />
of that selected transport, for instance, by explicitly unbinding an<br />
address with setsockopt(SCTP_SOCKOPT_BINDX_REM), after the chunks have<br />
been set up and before the message is sent. This can happen if the send<br />
buffer is full, during the period when the sender thread temporarily<br />
releases the socket lock in sctp_wait_for_sndbuf().<br />
<br />
This causes the access to the transport data in<br />
sctp_outq_select_transport(), when the association outqueue is flushed,<br />
to result in a use-after-free read.<br />
<br />
This change avoids this scenario by having sctp_transport_free() signal<br />
the freeing of the transport, tagging it as "dead". In order to do this,<br />
the patch restores the "dead" bit in struct sctp_transport, which was<br />
removed in<br />
commit 47faa1e4c50e ("sctp: remove the dead field of sctp_transport").<br />
<br />
Then, in the scenario where the sender thread has released the socket<br />
lock in sctp_wait_for_sndbuf(), the bit is checked again after<br />
re-acquiring the socket lock to detect the deletion. This is done while<br />
holding a reference to the transport to prevent it from being freed in<br />
the process.<br />
<br />
If the transport was deleted while the socket lock was relinquished,<br />
sctp_sendmsg_to_asoc() will return -EAGAIN to let userspace retry the<br />
send.<br />
<br />
The bug was found by a private syzbot instance (see the error report [1]<br />
and the C reproducer that triggers it [2]).
Impact
Base Score 3.x
7.80
Severity 3.x
HIGH
Vulnerable products and versions
| CPE | From | Up to |
|---|---|---|
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 3.18.128 (including) | 3.19 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 4.4.166 (including) | 4.5 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 4.9.142 (including) | 4.10 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 4.14.85 (including) | 4.15 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 4.19.6 (including) | 5.4.293 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.5 (including) | 5.10.237 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.11 (including) | 5.15.181 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.16 (including) | 6.1.135 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 6.2 (including) | 6.6.88 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 6.7 (including) | 6.12.24 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 6.13 (including) | 6.13.12 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 6.14 (including) | 6.14.3 (excluding) |
| cpe:2.3:o:linux:linux_kernel:6.15:rc1:*:*:*:*:*:* | ||
| cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:* |
To consult the complete list of CPE names with products and versions, see this page
References to Advisories, Solutions, and Tools
- https://git.kernel.org/stable/c/0f7df4899299ce4662e5f95badb9dbc57cc37fa5
- https://git.kernel.org/stable/c/2e5068b7e0ae0a54f6cfd03a2f80977da657f1ee
- https://git.kernel.org/stable/c/3257386be6a7eb8a8bfc9cbfb746df4eb4fc70e8
- https://git.kernel.org/stable/c/547762250220325d350d0917a7231480e0f4142b
- https://git.kernel.org/stable/c/5bc83bdf5f5b8010d1ca5a4555537e62413ab4e2
- https://git.kernel.org/stable/c/7a63f4fb0efb4e69efd990cbb740a848679ec4b0
- https://git.kernel.org/stable/c/9e7c37fadb3be1fc33073fcf10aa96d166caa697
- https://git.kernel.org/stable/c/c6fefcb71d246baaf3bacdad1af7ff50ebcfe652
- https://git.kernel.org/stable/c/f1a69a940de58b16e8249dff26f74c8cc59b32be
- https://lists.debian.org/debian-lts-announce/2025/05/msg00030.html
- https://lists.debian.org/debian-lts-announce/2025/05/msg00045.html



