CVE-2022-50838

EUVD-2022-55860
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.
ProviderTypeBase ScoreAtk. VectorAtk. ComplexityPriv. RequiredVector
NISTPrimary
UNKNOWN
---
Awaiting analysis
This vulnerability is currently awaiting analysis.
Base Score
CVSS 3.x
EPSS Score
Percentile: 19%
Debian logo
Debian Releases
Debian Product
Codename
linux
bookworm
6.1.148-1
fixed
bookworm (security)
6.1.158-1
fixed
bullseye
5.10.223-1
fixed
bullseye (security)
5.10.247-1
fixed
forky
6.17.13-1
fixed
sid
6.17.13-1
fixed
trixie
6.12.57-1
fixed
trixie (security)
6.12.48-1
fixed
openSUSE logo
openSUSE / SLES Releases
openSUSE Product
Release
cluster-md-kmp-default
suse enterprise server 15 SP5
5.14.21-150500.55.133.1
fixed
dlm-kmp-default
suse enterprise server 15 SP5
5.14.21-150500.55.133.1
fixed
gfs2-kmp-default
suse enterprise server 15 SP5
5.14.21-150500.55.133.1
fixed
kernel-64kb
suse enterprise server 15 SP5
5.14.21-150500.55.133.1
fixed
kernel-default
suse enterprise server 15 SP5
5.14.21-150500.55.133.1
fixed
kernel-default-base
suse enterprise server 15 SP5
5.14.21-150500.55.133.1.150500.6.65.1
fixed
kernel-docs
suse enterprise server 15 SP5
5.14.21-150500.55.133.1
fixed
kernel-macros
suse enterprise server 15 SP5
5.14.21-150500.55.133.1
fixed
kernel-obs-build
suse enterprise server 15 SP5
5.14.21-150500.55.133.1
fixed
kernel-source
suse enterprise server 15 SP5
5.14.21-150500.55.133.1
fixed
kernel-syms
suse enterprise server 15 SP5
5.14.21-150500.55.133.1
fixed
kernel-zfcpdump
suse enterprise server 15 SP5
5.14.21-150500.55.133.1
fixed
ocfs2-kmp-default
suse enterprise server 15 SP5
5.14.21-150500.55.133.1
fixed
reiserfs-kmp-default
suse enterprise server 15 SP5
5.14.21-150500.55.133.1
fixed