tcp: fix TFO max_qlen accounting across reuseport migration
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 54b92e84193749c9968aff2dd46e3b0f42643e18 · < d974618b2097453778389d385e3741629c40e0a3| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
tcp: fix TFO max_qlen accounting across reuseport migration
A listener's TCP_FASTOPEN max_qlen stops being accurate and lets through far more pending Fast Open requests than it was configured for.
This only shows up with SO_REUSEPORT listener migration, where closing a listener hands its still-pending TFO children over to a surviving one.
fastopenq.qlen is charged in tcp_fastopen_create_child() when the child is created and uncharged in reqsk_fastopen_remove() when the handshake completes. The uncharge follows rsk_listener of the request the child points at, and inet_reqsk_clone() has repointed the child at a new request owned by the new listener, so the ++ and the -- land on two different sockets. The new listener's qlen drifts negative and its limit no longer binds.
Charge the new listener during migration, like reqsk_queue_migrated() already does for queue->young and queue->qlen.
From the CVE record · Linux
A Linux kernel accounting error can let a TCP listener accept far more pending Fast Open requests than its configured limit. This occurs when a SO_REUSEPORT listener closes and its pending Fast Open connections migrate to a surviving listener. The input does not specify authentication or user-interaction requirements.
Engineers running Linux kernels with TCP Fast Open and SO_REUSEPORT listener migration should check whether their kernel is affected; affected versions were not provided.