Cloudanix VulnDB

CVE-2022-50838

None

CVSS

—

EPSS

0.3%

Published

Dec 30, 2025

CISA due date

—

Cloudanix analysis

Schedule a fix SSVC: Track

A bug in the Linux kernel can let certain network connections stay open in the background, gradually using up all available memory until the computer stops responding.

Exploitation
Local Privilege
Attacker needs
Local User
Complexity
Low
Impact
Denial Of Service
Component
OS kernel
Class
Denial of service
Remediation
Upgrade
Effort
Medium
Patch risk
Low

What it actually does

Failure to purge sk_error_queue in sk_stream_kill_queues allows cloned skbs holding ubuf_info references to remain after socket close when SOF_TIMESTAMPING_TX_ACK and MSG_ZEROCOPY are combined, keeping socket refcounts elevated and leaking kernel memory until exhaustion.

Why it matters to the business

Attackers or misbehaving local processes can exhaust all kernel memory on affected Linux systems, freezing the host and disrupting all services until reboot; the issue affects widely deployed kernels but carries low immediate external exploit risk.

How an attack unfolds

An attacker compiles and runs a local program that creates a TCP socket, enables SOF_TIMESTAMPING_TX_ACK, performs MSG_ZEROCOPY sends to populate the error queue with cloned skbs, then closes the socket; repeated execution leaks sockets indefinitely because tcp_close no longer drains the queue, eventually triggering OOM and system freeze.

How to fix it

Upgrade Linux kernels to a fixed release containing commit c8c1eec578a9ae2dc8f14a1846942a0b7bf29d1d or version 4.9.337 and later; rebuild and reboot into the patched kernel; where immediate upgrade is impossible, restrict untrusted local code execution and monitor memory pressure.

How to confirm the fix worked

Verify running kernel version is at or above the listed fixed releases; attempt to reproduce the socket-leak sequence in a test environment and confirm sk_error_queue is drained on close and refcounts return to expected values.

Typical attack path

  1. Create TCP socket and set SOF_TIMESTAMPING_TX_ACK option
  2. Perform sends with MSG_ZEROCOPY to attach ubuf_info and populate sk_error_queue via timestamping
  3. Close the socket while the error queue still contains cloned skbs
  4. Repeat the sequence to accumulate socket leaks and drive kernel memory consumption

How to detect it

Search system logs and kernel messages for repeated socket allocation warnings or OOM killer invocations; inspect processes that set timestamping socket options combined with zero-copy sends via strace or eBPF; correlate high sk_socket or ubuf_info object counts in slabinfo or /proc/slabinfo.

What your security team should do

  • Patch all Linux hosts to a kernel containing the referenced fix within normal change windows
  • Inventory systems running older kernels and prioritize those with high local-user exposure
  • Add kernel memory and socket-count monitoring to detect anomalous growth before OOM
  • Review any internal applications using SOF_TIMESTAMPING_TX_ACK together with MSG_ZEROCOPY

The record

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.

Affected packages

Ecosystem Package Introduced Fixed
Linux Kernel 0 4.9.337
SUSE:Linux Enterprise Micro 5.5 kernel-rt 0 5.14.21-150500.13.118.1
SUSE:Linux Enterprise Micro 5.5 kernel-source-rt 0 5.14.21-150500.13.118.1

Related vulnerabilities