Skip to content

CVE-2025-23142 sctp: detect and prevent references to a freed transport in sendmsg

HighCVSS 7.8 EPSS 0.23%
Published
Updated
Exploit status
No public exploit known
CISA SSVC
No known exploitation · automatable: no · technical impact: total
Technology
Linux KernelUbuntuDebian

Description

In the Linux kernel, the following vulnerability has been resolved:

sctp: detect and prevent references to a freed transport in sendmsg

sctp_sendmsg() re-uses associations and transports when possible by
doing a lookup based on the socket endpoint and the message destination
address, and then sctp_sendmsg_to_asoc() sets the selected transport in
all the message chunks to be sent.

There's a possible race condition if another thread triggers the removal
of that selected transport, for instance, by explicitly unbinding an
address with setsockopt(SCTP_SOCKOPT_BINDX_REM), after the chunks have
been set up and before the message is sent. This can happen if the send
buffer is full, during the period when the sender thread temporarily
releases the socket lock in sctp_wait_for_sndbuf().

This causes the access to the transport data in
sctp_outq_select_transport(), when the association outqueue is flushed,
to result in a use-after-free read.

This change avoids this scenario by having sctp_transport_free() signal
the freeing of the transport, tagging it as "dead". In order to do this,
the patch restores the "dead" bit in struct sctp_transport, which was
removed in
commit 47faa1e4c50e ("sctp: remove the dead field of sctp_transport").

Then, in the scenario where the sender thread has released the socket
lock in sctp_wait_for_sndbuf(), the bit is checked again after
re-acquiring the socket lock to detect the deletion. This is done while
holding a reference to the transport to prevent it from being freed in
the process.

If the transport was deleted while the socket lock was relinquished,
sctp_sendmsg_to_asoc() will return -EAGAIN to let userspace retry the
send.

The bug was found by a private syzbot instance (see the error report [1]
and the C reproducer that triggers it [2]).

Upgrade path

11 packages: 10 fixed.

PackageAffectedFixed inStatus
azure linux kernel(Azure Linux 3.0) < 6.6.92.2-1 6.6.92.2-1 Fixed
debian/linux(Debian 12) < 6.1.135-1; = 6.1.27-1; = 6.1.37-1; = 6.1.38-1 +34 more 6.1.135-1 Fixed
debian/linux(Debian 13) < 6.12.25-1 6.12.25-1 Fixed
debian/linux(Debian 14) < 6.12.25-1 6.12.25-1 Fixed
Linux kernel < 5.4.293; < 5.10.237; < 5.15.181; < 6.1.135 +34 more 0f7df4899299ce4662e5f95badb9dbc57cc37fa5, 2e5068b7e0ae0a54f6cfd03a2f80977da657f1ee, 3.19, 4.5, 4.10, 4.15, 4.20, 5.4.293, 5.10.237, 5.15.181, 5bc83bdf5f5b8010d1ca5a4555537e62413ab4e2, 6.1.135, 6.6.88, 6.12.24, 6.13.12, 6.14.3, 6.15, 7a63f4fb0efb4e69efd990cbb740a848679ec4b0, 9e7c37fadb3be1fc33073fcf10aa96d166caa697, 3257386be6a7eb8a8bfc9cbfb746df4eb4fc70e8, 547762250220325d350d0917a7231480e0f4142b, c6fefcb71d246baaf3bacdad1af7ff50ebcfe652, f1a69a940de58b16e8249dff26f74c8cc59b32be Fixed
ubuntu/linux(Ubuntu 22.04) < 5.15.0-144.157 5.15.0-144.157 Fixed
ubuntu/linux(Ubuntu 24.04) < 6.8.0-100.100 6.8.0-100.100 Fixed
ubuntu/linux-kvm(Ubuntu 22.04) < 5.15.0-1084.89 5.15.0-1084.89 Fixed
ubuntu/linux-raspi(Ubuntu 22.04) < 5.15.0-1083.86 5.15.0-1083.86 Fixed
ubuntu/linux-raspi(Ubuntu 24.04) < 6.8.0-1047.51 6.8.0-1047.51 Fixed
debian linux = 11.0 No fix listed Versions listed

Affected products

ProductAffected versionsFixed in
azure linux kernel(Azure Linux:3.0) < 6.6.92.2-1 6.6.92.2-1
debian/linux(Debian:12) < 6.1.135-1 6.1.135-1
debian/linux(Debian:12) = 6.1.106-1 No fix listed
debian/linux(Debian:12) = 6.1.106-2 No fix listed
debian/linux(Debian:12) = 6.1.106-3 No fix listed
debian/linux(Debian:12) = 6.1.112-1 No fix listed
debian/linux(Debian:12) = 6.1.115-1 No fix listed
debian/linux(Debian:12) = 6.1.119-1 No fix listed
debian/linux(Debian:12) = 6.1.123-1 No fix listed
debian/linux(Debian:12) = 6.1.124-1 No fix listed
debian/linux(Debian:12) = 6.1.128-1 No fix listed
debian/linux(Debian:12) = 6.1.129-1 No fix listed
debian/linux(Debian:12) = 6.1.133-1 No fix listed
debian/linux(Debian:12) = 6.1.27-1 No fix listed
debian/linux(Debian:12) = 6.1.37-1 No fix listed
debian/linux(Debian:12) = 6.1.38-1 No fix listed
debian/linux(Debian:12) = 6.1.38-2 No fix listed
debian/linux(Debian:12) = 6.1.38-2~bpo11+1 No fix listed
debian/linux(Debian:12) = 6.1.38-3 No fix listed
debian/linux(Debian:12) = 6.1.38-4 No fix listed
debian/linux(Debian:12) = 6.1.38-4~bpo11+1 No fix listed
debian/linux(Debian:12) = 6.1.52-1 No fix listed
debian/linux(Debian:12) = 6.1.55-1 No fix listed
debian/linux(Debian:12) = 6.1.55-1~bpo11+1 No fix listed
debian/linux(Debian:12) = 6.1.64-1 No fix listed
Show 60 more
ProductAffected versionsFixed in
debian/linux(Debian:12) = 6.1.66-1 No fix listed
debian/linux(Debian:12) = 6.1.67-1 No fix listed
debian/linux(Debian:12) = 6.1.69-1 No fix listed
debian/linux(Debian:12) = 6.1.69-1~bpo11+1 No fix listed
debian/linux(Debian:12) = 6.1.76-1 No fix listed
debian/linux(Debian:12) = 6.1.76-1~bpo11+1 No fix listed
debian/linux(Debian:12) = 6.1.82-1 No fix listed
debian/linux(Debian:12) = 6.1.85-1 No fix listed
debian/linux(Debian:12) = 6.1.90-1 No fix listed
debian/linux(Debian:12) = 6.1.90-1~bpo11+1 No fix listed
debian/linux(Debian:12) = 6.1.94-1 No fix listed
debian/linux(Debian:12) = 6.1.94-1~bpo11+1 No fix listed
debian/linux(Debian:12) = 6.1.98-1 No fix listed
debian/linux(Debian:12) = 6.1.99-1 No fix listed
debian/linux(Debian:13) < 6.12.25-1 6.12.25-1
debian/linux(Debian:14) < 6.12.25-1 6.12.25-1
Linux kernel >= df132eff463873e14e019a07f387b4d577d6d1f9, < 547762250220325d350d0917a7231480e0f4142b 547762250220325d350d0917a7231480e0f4142b
Linux kernel >= df132eff463873e14e019a07f387b4d577d6d1f9, < 3257386be6a7eb8a8bfc9cbfb746df4eb4fc70e8 3257386be6a7eb8a8bfc9cbfb746df4eb4fc70e8
Linux kernel >= df132eff463873e14e019a07f387b4d577d6d1f9, < 0f7df4899299ce4662e5f95badb9dbc57cc37fa5 0f7df4899299ce4662e5f95badb9dbc57cc37fa5
Linux kernel >= df132eff463873e14e019a07f387b4d577d6d1f9, < 7a63f4fb0efb4e69efd990cbb740a848679ec4b0 7a63f4fb0efb4e69efd990cbb740a848679ec4b0
Linux kernel >= df132eff463873e14e019a07f387b4d577d6d1f9, < c6fefcb71d246baaf3bacdad1af7ff50ebcfe652 c6fefcb71d246baaf3bacdad1af7ff50ebcfe652
Linux kernel >= df132eff463873e14e019a07f387b4d577d6d1f9, < 9e7c37fadb3be1fc33073fcf10aa96d166caa697 9e7c37fadb3be1fc33073fcf10aa96d166caa697
Linux kernel >= df132eff463873e14e019a07f387b4d577d6d1f9, < 5bc83bdf5f5b8010d1ca5a4555537e62413ab4e2 5bc83bdf5f5b8010d1ca5a4555537e62413ab4e2
Linux kernel >= df132eff463873e14e019a07f387b4d577d6d1f9, < 2e5068b7e0ae0a54f6cfd03a2f80977da657f1ee 2e5068b7e0ae0a54f6cfd03a2f80977da657f1ee
Linux kernel >= df132eff463873e14e019a07f387b4d577d6d1f9, < f1a69a940de58b16e8249dff26f74c8cc59b32be f1a69a940de58b16e8249dff26f74c8cc59b32be
Linux kernel = 26e51e5287eed4d96ea66a3da95429f42940f013 No fix listed
Linux kernel = 8b97e045bd6d37f96f161e4d371ae174148e1587 No fix listed
Linux kernel = e044554e97e812eb257d073bcc130e0ea653858f No fix listed
Linux kernel = 8376fdc999be008f0e9918db52f1ed8c08f5a1c9 No fix listed
Linux kernel = cd947138e8c31e8cfcd489c12e9b97271beb6e79 No fix listed
Linux kernel >= 3.18.128, < 3.19 3.19
Linux kernel >= 4.4.166, < 4.5 4.5
Linux kernel >= 4.9.142, < 4.10 4.10
Linux kernel >= 4.14.85, < 4.15 4.15
Linux kernel >= 4.19.6, < 4.20 4.20
Linux kernel = 4.20 No fix listed
Linux kernel < 5.4.293 5.4.293
Linux kernel < 5.10.237 5.10.237
Linux kernel < 5.15.181 5.15.181
Linux kernel < 6.1.135 6.1.135
Linux kernel < 6.6.88 6.6.88
Linux kernel < 6.12.24 6.12.24
Linux kernel < 6.13.12 6.13.12
Linux kernel < 6.14.3 6.14.3
Linux kernel < 6.15 6.15
ubuntu/linux(Ubuntu:22.04) < 5.15.0-144.157 5.15.0-144.157
ubuntu/linux-kvm(Ubuntu:22.04) < 5.15.0-1084.89 5.15.0-1084.89
ubuntu/linux-raspi(Ubuntu:22.04) < 5.15.0-1083.86 5.15.0-1083.86
ubuntu/linux(Ubuntu:24.04) < 6.8.0-100.100 6.8.0-100.100
ubuntu/linux-raspi(Ubuntu:24.04) < 6.8.0-1047.51 6.8.0-1047.51
Linux kernel >= 4.19.6, < 5.4.293 5.4.293
Linux kernel >= 5.5, < 5.10.237 5.10.237
Linux kernel >= 5.11, < 5.15.181 5.15.181
Linux kernel >= 5.16, < 6.1.135 6.1.135
Linux kernel >= 6.2, < 6.6.88 6.6.88
Linux kernel >= 6.7, < 6.12.24 6.12.24
Linux kernel >= 6.13, < 6.13.12 6.13.12
Linux kernel >= 6.14, < 6.14.3 6.14.3
Linux kernel = 6.15-rc1 No fix listed
debian linux = 11.0 No fix listed

References