CVE-2025-23142

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

State
Published
Severity
7.8 High
Published
May 1, 2025
Updated
Oct 15, 2026
Reserved
Jan 11, 2025

Read the record on cve.org

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]).

Scores

CVSSScoreVectorSource
3.17.8 HighCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:HLinux

Weaknesses

The record names no weakness.

Affected Products

ProductVersions
LinuxLinux
  • df132eff463873e14e019a07f387b4d577d6d1f9 to before 547762250220325d350d0917a7231480e0f4142bAffected
  • df132eff463873e14e019a07f387b4d577d6d1f9 to before 3257386be6a7eb8a8bfc9cbfb746df4eb4fc70e8Affected
  • df132eff463873e14e019a07f387b4d577d6d1f9 to before 0f7df4899299ce4662e5f95badb9dbc57cc37fa5Affected
  • df132eff463873e14e019a07f387b4d577d6d1f9 to before 7a63f4fb0efb4e69efd990cbb740a848679ec4b0Affected
  • df132eff463873e14e019a07f387b4d577d6d1f9 to before c6fefcb71d246baaf3bacdad1af7ff50ebcfe652Affected
  • df132eff463873e14e019a07f387b4d577d6d1f9 to before 9e7c37fadb3be1fc33073fcf10aa96d166caa697Affected
  • df132eff463873e14e019a07f387b4d577d6d1f9 to before 5bc83bdf5f5b8010d1ca5a4555537e62413ab4e2Affected
  • df132eff463873e14e019a07f387b4d577d6d1f9 to before 2e5068b7e0ae0a54f6cfd03a2f80977da657f1eeAffected
  • df132eff463873e14e019a07f387b4d577d6d1f9 to before f1a69a940de58b16e8249dff26f74c8cc59b32beAffected
  • 26e51e5287eed4d96ea66a3da95429f42940f013Affected
  • 8b97e045bd6d37f96f161e4d371ae174148e1587Affected
  • e044554e97e812eb257d073bcc130e0ea653858fAffected
  • 8376fdc999be008f0e9918db52f1ed8c08f5a1c9Affected
  • cd947138e8c31e8cfcd489c12e9b97271beb6e79Affected
  • 3.18.128 to before 3.19Affected
  • 4.4.166 to before 4.5Affected
  • 4.9.142 to before 4.10Affected
  • 4.14.85 to before 4.15Affected
  • 4.19.6 to before 4.20Affected
LinuxLinux
  • 4.20Affected
  • before 4.20Not affected
  • 5.4.293 through 5.4.*Not affected
  • 5.10.237 through 5.10.*Not affected
  • 5.15.181 through 5.15.*Not affected
  • 6.1.135 through 6.1.*Not affected
  • 6.6.88 through 6.6.*Not affected
  • 6.12.24 through 6.12.*Not affected
  • 6.13.12 through 6.13.*Not affected
  • 6.14.3 through 6.14.*Not affected
  • 6.15 and laterNot affected

References

Every record here comes from the CVE Program’s CVE List. © 1999–2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.