lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <2025123018-CVE-2022-50838-1824@gregkh>
Date: Tue, 30 Dec 2025 13:13:24 +0100
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-cve-announce@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...nel.org>
Subject: CVE-2022-50838: net: stream: purge sk_error_queue in sk_stream_kill_queues()

From: Greg Kroah-Hartman <gregkh@...nel.org>

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.

The Linux kernel CVE team has assigned CVE-2022-50838 to this issue.


Affected and fixed versions
===========================

	Issue introduced in 4.9.291 with commit 7737b104c211fa843de268b897d601e070292a72 and fixed in 4.9.337 with commit c8c1eec578a9ae2dc8f14a1846942a0b7bf29d1d
	Issue introduced in 4.14.256 with commit 89be5c357de34718eaaaefed80737f432c5ab86f and fixed in 4.14.303 with commit bab542cf56fc174c8447c00b73be99ffd66d2d39
	Issue introduced in 4.19.218 with commit 8b8b3d738e450d2c2ccdc75f0ab5a951746c2a96 and fixed in 4.19.270 with commit 6f00bd0402a1e3d2d556afba57c045bd7931e4d3
	Issue introduced in 5.4.160 with commit b631c603b5fb98d2bd709c35d384901965a3dd51 and fixed in 5.4.229 with commit 4f1d37ff4226eb99d6b69e9f4518e279e1a851bf
	Issue introduced in 5.10.80 with commit daf15fa1fd997749e881aedd9f03f73a11240e82 and fixed in 5.10.163 with commit 9062493811676ee0efe6c74d98f00ca38c4e17d4
	Issue introduced in 5.15.3 with commit 3988164fe9ddf98ebf5b5cdede91ac38c5f08a7e and fixed in 5.15.86 with commit 9da204cd67c4fe97e8aa465d10d5c2e7076f7f42
	Issue introduced in 5.16 with commit 24bcbe1cc69fa52dc4f7b5b2456678ed464724d8 and fixed in 6.0.16 with commit 8c330c36b3970d0917f48827fa6c7a9c75aa4602
	Issue introduced in 5.16 with commit 24bcbe1cc69fa52dc4f7b5b2456678ed464724d8 and fixed in 6.1.2 with commit b458d349f8753f666233828ebd30df6f100cf7d5
	Issue introduced in 5.16 with commit 24bcbe1cc69fa52dc4f7b5b2456678ed464724d8 and fixed in 6.2 with commit e0c8bccd40fc1c19e1d246c39bcf79e357e1ada3
	Issue introduced in 4.4.293 with commit 6ba975e14f5ebb87143d737c493adf4031409a68
	Issue introduced in 5.14.19 with commit 4437f3ead9e85c35fe0e3adfb98c0b97eaa267eb

Please see https://www.kernel.org for a full list of currently supported
kernel versions by the kernel community.

Unaffected versions might change over time as fixes are backported to
older supported kernel versions.  The official CVE entry at
	https://cve.org/CVERecord/?id=CVE-2022-50838
will be updated if fixes are backported, please check that for the most
up to date information about this issue.


Affected files
==============

The file(s) affected by this issue are:
	net/core/stream.c


Mitigation
==========

The Linux kernel CVE team recommends that you update to the latest
stable kernel version for this, and many other bugfixes.  Individual
changes are never tested alone, but rather are part of a larger kernel
release.  Cherry-picking individual commits is not recommended or
supported by the Linux kernel community at all.  If however, updating to
the latest release is impossible, the individual changes to resolve this
issue can be found at these commits:
	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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ