sctp: hold asoc or transport before mod_timer() in timer handlers
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 · < 35bf3b23c9a871f44c1453d85f8332be4e088dda| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
sctp: hold asoc or transport before mod_timer() in timer handlers
Take the association or transport reference before rearming a timer in the timer handlers.
The existing code calls mod_timer() before taking the reference needed by the rearmed timer without holding the sock lock. This creates a race with timer cleanup: if the timer is deleted after mod_timer() returns but before the reference is taken, the cleanup path can drop the timer's reference and destroy the transport or association. The timer handler then takes a reference on the already freed object and eventually drops it, causing a refcount underflow.
Hold the object before mod_timer() and drop the reference if mod_timer() reports that the timer was already pending in timer handlers. Apply the same ordering to the proto-unreachable path, which can rearm a transport timer outside the timer handlers without holding the sock lock.
From the CVE record · Linux
The Linux kernel's SCTP timer handlers can rearm a timer before taking a reference to its association or transport. A race with timer cleanup can then cause a reference to an already freed object and a refcount underflow. The input does not specify how an attacker could trigger the race or whether access or user interaction is required.
Engineers running Linux kernels with SCTP should check their kernel versions; affected versions are not specified.