net: stream: purge sk_error_queue in sk_stream_kill_queues()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 3988164fe9ddf98ebf5b5cdede91ac38c5f08a7e · < 9da204cd67c4fe97e8aa465d10d5c2e7076f7f42| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
net: stream: purge sk_error_queue in sk_stream_kill_queues()
Changheon Lee reported TCP socket leaks, with a nice repro.
It seems we leak TCP sockets with the following sequence:
1) SOF_TIMESTAMPING_TX_ACK is enabled on the socket.
Each ACK will cook an skb put in error queue, from __skb_tstamp_tx(). __skb_tstamp_tx() is using skb_clone(), unless SOF_TIMESTAMPING_OPT_TSONLY was also requested.
2) If the application is also using MSG_ZEROCOPY, then we put in the error queue cloned skbs that had a struct ubuf_info attached to them.
Whenever an struct ubuf_info is allocated, sock_zerocopy_alloc() does a sock_hold().
From the CVE record · Linux
The Linux kernel can leak TCP sockets when an application enables transmit ACK timestamping, uses MSG_ZEROCOPY, and closes a socket while its error queue is not empty. A local application can repeat this sequence to exhaust kernel memory and freeze the host; no separate user interaction is described.
Engineers running Linux kernels should check whether their kernel includes the fix; affected versions are not specified.