CVE-2022-50838
TCP Socket Leak in Linux Kernel Causes Memory Exhaustion
Publication date: 2025-12-30
Last updated on: 2025-12-30
Assigner: kernel.org
Description
Description
CVSS Scores
EPSS Scores
| Probability: | |
| Percentile: |
Meta Information
Affected Vendors & Products
| Vendor | Product | Version / Range |
|---|---|---|
| linux | linux_kernel | * |
Helpful Resources
Exploitability
| CWE ID | Description |
|---|---|
| CWE-UNKNOWN |
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?
This vulnerability involves a TCP socket leak in the Linux kernel. When certain socket options are enabled (SOF_TIMESTAMPING_TX_ACK and MSG_ZEROCOPY), cloned socket buffers (skbs) with attached information are placed in the socket's error queue. If the application closes the socket while the error queue is not empty, the socket's reference count remains elevated because the error queue is not purged. This causes the TCP socket to remain alive indefinitely, leading to resource leaks.
How can this vulnerability impact me? :
This vulnerability can be exploited to consume all kernel memory by leaking TCP sockets that are never properly closed. This can eventually freeze the host system due to resource exhaustion.
What immediate steps should I take to mitigate this vulnerability?
The immediate step to mitigate this vulnerability is to apply the patch or update that purges the socket error queue properly in the Linux kernel, ensuring that tcp_close() purges the error queue with proper synchronization against concurrent writers. Until the patch is applied, avoid using the combination of SOF_TIMESTAMPING_TX_ACK with MSG_ZEROCOPY on TCP sockets, as this sequence leads to socket leaks and potential kernel memory exhaustion.