CVE-2022-50838

net: stream: purge sk_error_queue in sk_stream_kill_queues()

No CVSS score yet EPSS 0.30%

Published 30 Dec 2025 Updated 23 May 2026 CNA: Linux

Check your servers for CVE-2022-50838

The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2022-50838 affects the running kernel, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.

Check my servers

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.

Exploitation

EPSS 0.30%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 25.0% of all scored CVEs. Scores of 1 Dec 2026.

Affected products

As the CNA lists them.

ProductVersions
Linux
affected from 7737b104c211fa843de268b897d601e070292a72, before c8c1eec578a9ae2dc8f14a1846942a0b7bf29d1d
affected from 89be5c357de34718eaaaefed80737f432c5ab86f, before bab542cf56fc174c8447c00b73be99ffd66d2d39
affected from 8b8b3d738e450d2c2ccdc75f0ab5a951746c2a96, before 6f00bd0402a1e3d2d556afba57c045bd7931e4d3
affected from b631c603b5fb98d2bd709c35d384901965a3dd51, before 4f1d37ff4226eb99d6b69e9f4518e279e1a851bf
affected from daf15fa1fd997749e881aedd9f03f73a11240e82, before 9062493811676ee0efe6c74d98f00ca38c4e17d4
affected from 3988164fe9ddf98ebf5b5cdede91ac38c5f08a7e, before 9da204cd67c4fe97e8aa465d10d5c2e7076f7f42
affected from 24bcbe1cc69fa52dc4f7b5b2456678ed464724d8, before 8c330c36b3970d0917f48827fa6c7a9c75aa4602
affected from 24bcbe1cc69fa52dc4f7b5b2456678ed464724d8, before b458d349f8753f666233828ebd30df6f100cf7d5
affected from 24bcbe1cc69fa52dc4f7b5b2456678ed464724d8, before e0c8bccd40fc1c19e1d246c39bcf79e357e1ada3
affected 6ba975e14f5ebb87143d737c493adf4031409a68
affected 4437f3ead9e85c35fe0e3adfb98c0b97eaa267eb
affected from 4.9.291, before 4.9.337
affected from 4.14.256, before 4.14.303
affected from 4.19.218, before 4.19.270
affected from 5.4.160, before 5.4.229
affected from 5.10.80, before 5.10.163
affected from 5.15.3, before 5.15.86
affected from 4.4.293, before 4.5
affected from 5.14.19, before 5.15
Other versions: unaffected
Linux
affected 5.16
unaffected before 5.16
unaffected from 4.9.337 up to and including 4.9.*
unaffected from 4.14.303 up to and including 4.14.*
unaffected from 4.19.270 up to and including 4.19.*
unaffected from 5.4.229 up to and including 5.4.*
unaffected from 5.10.163 up to and including 5.10.*
unaffected from 5.15.86 up to and including 5.15.*
unaffected from 6.0.16 up to and including 6.0.*
unaffected from 6.1.2 up to and including 6.1.*
unaffected 6.2 and later
Other versions: affected

Is my server affected?

This CVE is in the Linux kernel. Compare the running kernel with the fixed kernel version of your distribution, and reboot after a kernel update:

uname -r
# Debian, Ubuntu: does the changelog of the running kernel name the CVE?
zgrep -l CVE-2022-50838 /usr/share/doc/linux-image-$(uname -r)/changelog.Debian.gz
# RHEL, Rocky, Alma
rpm -q --changelog kernel | grep CVE-2022-50838

With Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:

trivy rootfs --scanners vuln / | grep CVE-2022-50838
trivy image --scanners vuln IMAGE | grep CVE-2022-50838

Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.

References

Other references

Source: the record CVE-2022-50838 of the CVE List (CVE Program), CVE Terms of Use; EPSS of FIRST. The text of the record is shown as published. Data sources and licences.