sctp: fix race between sctp_wait_for_connect and peeloff
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 668c9beb9020d5834ee9e43c208190a07d2b1928 · < 68667ee4c7dadf7f63167234e2a1af09b3f7874e| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
sctp: fix race between sctp_wait_for_connect and peeloff
sctp_wait_for_connect() drops and re-acquires the socket lock while waiting for the association to reach ESTABLISHED state. During this window, another thread can peeloff the association to a new socket via getsockopt(SCTP_SOCKOPT_PEELOFF), changing asoc->base.sk. After re-acquiring the old socket lock, sctp_wait_for_connect() returns success without noticing the migration — the caller then accesses the association under the wrong lock in sctp_datamsg_from_user().
Add the same sk != asoc->base.sk check that sctp_wait_for_sndbuf() already has, returning an error if the association was migrated while we slept.
From the CVE record · Linux
The Linux kernel’s SCTP code has a race between waiting for a connection and peeling off an association to a new socket. If another thread peels off the association during that wait, the caller can access it under the wrong socket lock. The description does not specify an authentication requirement or user interaction.
Engineers running Linux kernels with SCTP support should check whether their kernel includes the fix; affected versions are not specified.