CVE-2022-50838

Linux Kernel Memory Leak via TCP Socket Error Queue

Title source: llm
STIX 2.1

Description

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(). As long as the cloned skbs are still in sk_error_queue, socket refcount is kept elevated. 3) Application closes the socket, while error queue is not empty. Since tcp_close() no longer purges the socket error queue, we might end up with a TCP socket with at least one skb in error queue keeping the socket alive forever. This bug can be (ab)used to consume all kernel memory and freeze the host. We need to purge the error queue, with proper synchronization against concurrent writers.

Scores

EPSS 0.0025
EPSS Percentile 16.3%

Details

Status published
Products (37)
linux/Kernel < 4.9.337linux
linux/Kernel 4.10.0 - 4.14.303linux
linux/Kernel 4.15.0 - 4.19.270linux
linux/Kernel 4.20.0 - 5.4.229linux
linux/Kernel 5.11.0 - 5.15.86linux
linux/Kernel 5.16.0 - 6.1.2linux
linux/Kernel 5.5.0 - 5.10.163linux
Linux/Linux < 5.16
Linux/Linux 24bcbe1cc69fa52dc4f7b5b2456678ed464724d8 - 8c330c36b3970d0917f48827fa6c7a9c75aa4602
Linux/Linux 24bcbe1cc69fa52dc4f7b5b2456678ed464724d8 - b458d349f8753f666233828ebd30df6f100cf7d5
... and 27 more
Published Dec 30, 2025
Tracked Since Feb 18, 2026