CVE-2022-50838

Source
https://cve.org/CVERecord?id=CVE-2022-50838
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-50838.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2022-50838
Downstream
DEBIAN (1)
SUSE (2)
UBUNTU (1)
Related
Published
2025-12-30T12:10:57Z
Modified
2026-10-08T02:47:51Z
Summary
net: stream: purge sk_error_queue in sk_stream_kill_queues()
Details

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.

Database specific
{
    "cna_assigner":  "Linux",
    "osv_generated_from":  "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/50xxx/CVE-2022-50838.json"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
7737b104c211fa843de268b897d601e070292a72
Fixed
c8c1eec578a9ae2dc8f14a1846942a0b7bf29d1d
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
89be5c357de34718eaaaefed80737f432c5ab86f
Fixed
bab542cf56fc174c8447c00b73be99ffd66d2d39
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
8b8b3d738e450d2c2ccdc75f0ab5a951746c2a96
Fixed
6f00bd0402a1e3d2d556afba57c045bd7931e4d3
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
b631c603b5fb98d2bd709c35d384901965a3dd51
Fixed
4f1d37ff4226eb99d6b69e9f4518e279e1a851bf
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
daf15fa1fd997749e881aedd9f03f73a11240e82
Fixed
9062493811676ee0efe6c74d98f00ca38c4e17d4
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
3988164fe9ddf98ebf5b5cdede91ac38c5f08a7e
Fixed
9da204cd67c4fe97e8aa465d10d5c2e7076f7f42
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
24bcbe1cc69fa52dc4f7b5b2456678ed464724d8
Fixed
8c330c36b3970d0917f48827fa6c7a9c75aa4602
Fixed
b458d349f8753f666233828ebd30df6f100cf7d5
Fixed
e0c8bccd40fc1c19e1d246c39bcf79e357e1ada3
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
4.9.291
Fixed
4.9.337
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
4.14.256
Fixed
4.14.303
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
4.19.218
Fixed
4.19.270
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
5.4.160
Fixed
5.4.229
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
5.10.80
Fixed
5.10.163
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
5.15.3
Fixed
5.15.86
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
4.4.293
Fixed
4.5
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
5.14.19
Fixed
5.15
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
6ba975e14f5ebb87143d737c493adf4031409a68
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
4437f3ead9e85c35fe0e3adfb98c0b97eaa267eb

Affected versions

v4.*
v4.14.256
v4.14.257
v4.14.258
v4.14.259
v4.14.260
v4.14.261
v4.14.262
v4.14.263
v4.14.264
v4.14.265
v4.14.266
v4.14.267
v4.14.268
v4.14.269
v4.14.270
v4.14.271
v4.14.272
v4.14.273
v4.14.274
v4.14.275
v4.14.276
v4.14.277
v4.14.278
v4.14.279
v4.14.280
v4.14.281
v4.14.282
v4.14.283
v4.14.284
v4.14.285
v4.14.286
v4.14.287
v4.14.288
v4.14.289
v4.14.290
v4.14.291
v4.14.292
v4.14.293
v4.14.294
v4.14.295
v4.14.296
v4.14.297
v4.14.298
v4.14.299
v4.14.300
v4.14.301
v4.14.302
v4.19.218
v4.19.219
v4.19.220
v4.19.221
v4.19.222
v4.19.223
v4.19.224
v4.19.225
v4.19.226
v4.19.227
v4.19.228
v4.19.229
v4.19.230
v4.19.231
v4.19.232
v4.19.233
v4.19.234
v4.19.235
v4.19.236
v4.19.237
v4.19.238
v4.19.239
v4.19.240
v4.19.241
v4.19.242
v4.19.243
v4.19.244
v4.19.245
v4.19.246
v4.19.247
v4.19.248
v4.19.249
v4.19.250
v4.19.251
v4.19.252
v4.19.253
v4.19.254
v4.19.255
v4.19.256
v4.19.257
v4.19.258
v4.19.259
v4.19.260
v4.19.261
v4.19.262
v4.19.263
v4.19.264
v4.19.265
v4.19.266
v4.19.267
v4.19.268
v4.19.269
v4.4.293
v4.4.294
v4.4.295
v4.4.296
v4.4.297
v4.4.298
v4.4.299
v4.4.300
v4.4.301
v4.4.302
v4.9.291
v4.9.292
v4.9.293
v4.9.294
v4.9.295
v4.9.296
v4.9.297
v4.9.298
v4.9.299
v4.9.300
v4.9.301
v4.9.302
v4.9.303
v4.9.304
v4.9.305
v4.9.306
v4.9.307
v4.9.308
v4.9.309
v4.9.310
v4.9.311
v4.9.312
v4.9.313
v4.9.314
v4.9.315
v4.9.316
v4.9.317
v4.9.318
v4.9.319
v4.9.320
v4.9.321
v4.9.322
v4.9.323
v4.9.324
v4.9.325
v4.9.326
v4.9.327
v4.9.328
v4.9.329
v4.9.330
v4.9.331
v4.9.332
v4.9.333
v4.9.334
v4.9.335
v4.9.336
v5.*
v5.10.100
v5.10.101
v5.10.102
v5.10.103
v5.10.104
v5.10.105
v5.10.106
v5.10.107
v5.10.108
v5.10.109
v5.10.110
v5.10.111
v5.10.112
v5.10.113
v5.10.114
v5.10.115
v5.10.116
v5.10.117
v5.10.118
v5.10.119
v5.10.120
v5.10.121
v5.10.122
v5.10.123
v5.10.124
v5.10.125
v5.10.126
v5.10.127
v5.10.128
v5.10.129
v5.10.130
v5.10.131
v5.10.132
v5.10.133
v5.10.134
v5.10.135
v5.10.136
v5.10.137
v5.10.138
v5.10.139
v5.10.140
v5.10.141
v5.10.142
v5.10.143
v5.10.144
v5.10.145
v5.10.146
v5.10.147
v5.10.148
v5.10.149
v5.10.150
v5.10.151
v5.10.152
v5.10.153
v5.10.154
v5.10.155
v5.10.156
v5.10.157
v5.10.158
v5.10.159
v5.10.160
v5.10.161
v5.10.162
v5.10.80
v5.10.81
v5.10.82
v5.10.83
v5.10.84
v5.10.85
v5.10.86
v5.10.87
v5.10.88
v5.10.89
v5.10.90
v5.10.91
v5.10.92
v5.10.93
v5.10.94
v5.10.95
v5.10.96
v5.10.97
v5.10.98
v5.10.99
v5.14.19
v5.14.20
v5.14.21
v5.15.10
v5.15.11
v5.15.12
v5.15.13
v5.15.14
v5.15.15
v5.15.16
v5.15.17
v5.15.18
v5.15.19
v5.15.20
v5.15.21
v5.15.22
v5.15.23
v5.15.24
v5.15.25
v5.15.26
v5.15.27
v5.15.28
v5.15.29
v5.15.3
v5.15.30
v5.15.31
v5.15.32
v5.15.33
v5.15.34
v5.15.35
v5.15.36
v5.15.37
v5.15.38
v5.15.39
v5.15.4
v5.15.40
v5.15.41
v5.15.42
v5.15.43
v5.15.44
v5.15.45
v5.15.46
v5.15.47
v5.15.48
v5.15.49
v5.15.5
v5.15.50
v5.15.51
v5.15.52
v5.15.53
v5.15.54
v5.15.55
v5.15.56
v5.15.57
v5.15.58
v5.15.59
v5.15.6
v5.15.60
v5.15.61
v5.15.62
v5.15.63
v5.15.64
v5.15.65
v5.15.66
v5.15.67
v5.15.68
v5.15.69
v5.15.7
v5.15.70
v5.15.71
v5.15.72
v5.15.73
v5.15.74
v5.15.75
v5.15.76
v5.15.77
v5.15.78
v5.15.79
v5.15.8
v5.15.80
v5.15.81
v5.15.82
v5.15.83
v5.15.84
v5.15.85
v5.15.9
v5.4.160
v5.4.161
v5.4.162
v5.4.163
v5.4.164
v5.4.165
v5.4.166
v5.4.167
v5.4.168
v5.4.169
v5.4.170
v5.4.171
v5.4.172
v5.4.173
v5.4.174
v5.4.175
v5.4.176
v5.4.177
v5.4.178
v5.4.179
v5.4.180
v5.4.181
v5.4.182
v5.4.183
v5.4.184
v5.4.185
v5.4.186
v5.4.187
v5.4.188
v5.4.189
v5.4.190
v5.4.191
v5.4.192
v5.4.193
v5.4.194
v5.4.195
v5.4.196
v5.4.197
v5.4.198
v5.4.199
v5.4.200
v5.4.201
v5.4.202
v5.4.203
v5.4.204
v5.4.205
v5.4.206
v5.4.207
v5.4.208
v5.4.209
v5.4.210
v5.4.211
v5.4.212
v5.4.213
v5.4.214
v5.4.215
v5.4.216
v5.4.217
v5.4.218
v5.4.219
v5.4.220
v5.4.221
v5.4.222
v5.4.223
v5.4.224
v5.4.225
v5.4.226
v5.4.227
v5.4.228

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-50838.json"

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Fixed
4.9.337
Type
ECOSYSTEM
Events
Introduced
4.10.0
Fixed
4.14.303
Type
ECOSYSTEM
Events
Introduced
4.15.0
Fixed
4.19.270
Type
ECOSYSTEM
Events
Introduced
4.20.0
Fixed
5.4.229
Type
ECOSYSTEM
Events
Introduced
5.5.0
Fixed
5.10.163
Type
ECOSYSTEM
Events
Introduced
5.11.0
Fixed
5.15.86
Type
ECOSYSTEM
Events
Introduced
5.16.0
Fixed
6.0.16
Fixed
6.1.2

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-50838.json"