# CVE-2022-50838: net: stream: purge sk\_error\_queue in sk\_stream\_kill\_queues()

- Priority: **Routine**
- Reason: Not severe (CVSS 6.8, local access); no exploitation reported by the 5 checked sources
- Next step: Fix in the normal cadence
- Status: published
- Published: 2025-12-30 · Modified: 2026-05-23
- Aliases: UBUNTU-CVE-2022-50838, DEBIAN-CVE-2022-50838
- Record: https://cvemate.com/vulnerability/CVE-2022-50838 · JSON: https://cvemate.com/vulnerability/CVE-2022-50838/json

## Description

```text
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.
```

## Signals

- CVSS: 6.8 medium (v4.0, OSV · Ubuntu) CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
- EPSS: 0.304%, percentile 24.981%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected (first 20 of 123)

- debian linux (Debian): \< 6.1.4-1
- ubuntu linux (Ubuntu): \< 4.15.0-208.220 \| \< 5.4.0-144.161 \| \< 5.15.0-69.76
- ubuntu linux-allwinner-5.19 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws (Ubuntu): \< 4.15.0-1153.166 \| \< 5.4.0-1097.105 \| \< 5.15.0-1033.37
- ubuntu linux-aws-5.0 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.11 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.13 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.15 (Ubuntu): \< 5.15.0-1033.37~20.04.1
- ubuntu linux-aws-5.19 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.3 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.4 (Ubuntu): \< 5.4.0-1097.105~18.04.1
- ubuntu linux-aws-5.8 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-6.2 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-6.5 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-fips (Ubuntu): \< 4.15.0-2092.98 \| \< 5.4.0-1099.107+fips1
- ubuntu linux-aws-hwe (Ubuntu): \< 4.15.0-1153.166~16.04.1
- ubuntu linux-azure (Ubuntu): \< 4.15.0-1162.177~14.04.1 \| \< 4.15.0-1162.177~16.04.1 \| All versions (No fix recorded) \| \< 5.4.0-1104.110 \| \< 5.15.0-1035.42
- ubuntu linux-azure-4.15 (Ubuntu): \< 4.15.0-1162.177
- ubuntu linux-azure-5.11 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-azure-5.13 (Ubuntu): All versions (No fix recorded)

## References

- <https://git.kernel.org/stable/c/c8c1eec578a9ae2dc8f14a1846942a0b7bf29d1d>
- <https://git.kernel.org/stable/c/bab542cf56fc174c8447c00b73be99ffd66d2d39>
- <https://git.kernel.org/stable/c/6f00bd0402a1e3d2d556afba57c045bd7931e4d3>
- <https://git.kernel.org/stable/c/4f1d37ff4226eb99d6b69e9f4518e279e1a851bf>
- <https://git.kernel.org/stable/c/9062493811676ee0efe6c74d98f00ca38c4e17d4>
- <https://git.kernel.org/stable/c/9da204cd67c4fe97e8aa465d10d5c2e7076f7f42>
- <https://git.kernel.org/stable/c/8c330c36b3970d0917f48827fa6c7a9c75aa4602>
- <https://git.kernel.org/stable/c/b458d349f8753f666233828ebd30df6f100cf7d5>
- <https://git.kernel.org/stable/c/e0c8bccd40fc1c19e1d246c39bcf79e357e1ada3>
- <https://ubuntu.com/security/CVE-2022-50838>
- <https://www.cve.org/CVERecord?id=CVE-2022-50838>
- <https://git.kernel.org/linus/e0c8bccd40fc1c19e1d246c39bcf79e357e1ada3>
- <https://security-tracker.debian.org/tracker/CVE-2022-50838>

---

Data as of 2026-12-05T04:41:31.342Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
