CVE-2026-139361

Source
https://cve.org/CVERecord?id=CVE-2026-139361
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-139361.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2026-139361
Downstream
Published
2026-11-30T13:34:02Z
Modified
2026-11-30T15:02:28Z
Summary
ALSA: pcm: Add refcount for races between drain and unlink
Details

In the Linux kernel, the following vulnerability has been resolved:

ALSA: pcm: Add refcount for races between drain and unlink

We added a workaround for the case where a linked substream gets unlinked during the drain operation by another substream of the same linked group in the commit 9b1dbd69ba6f ("ALSA: pcm: fix use-after-free on linked stream runtime in snd_pcm_drain()"). There, we just cached the parameters of the draining substream for avoiding UAF.

Then, we check the draining substream (to_check) again in the loop and remove it from the queue only when it's still present. It means, however, that the wait queue entry won't be removed if the substream went out of the link beforehand, hence a stale wq entry remains. Later on, this can be woken up, and this may hit a UAF, too. The problem surfaced more due to the recent change to call snd_pcm_unlink() earlier.

For properly handling both cases above, in this patch, we introduce a refcount to the snd_pcm_runtime that indicates the substream is being accessed / used, then at snd_pcm_release_substream(), it's synced before the actual resource release via snd_refcount_sync(). This guarantees that the accessors are finished, and safe to release memories. Along with the introduction of a refcount, the comments and the code changes by the former fix were partially reverted as they don't fit with the updated code flow any longer.

Last but not least, the setup of wait queue entry and prepare_to_wait() call are moved before the group unref. With this change, we can avoid the race between the enqueue and the wakeup, too.

Database specific
{
    "cna_assigner":  "Linux",
    "osv_generated_from":  "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/139xxx/CVE-2026-139361.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
f2cb2e0d27fb925c73a78f0ce7d6dbf68d3747c1
Fixed
220edbb1806a43a45e9f51a6cc68c54d58c583ee
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
fc71f888994569f87d5bee20b1ac6c9c1e3a7a79
Fixed
7131b6e1cab439eae7bf4ed37857183e84268b5b
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
629cf09464cf98670996ea5c191dc9743e6f3f00
Fixed
bf052a1fb6507ccb6aea53b12db98f0976f8872d
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
ae8f8d30d334bad5b1b3cdb1eb8a0b771f55e432
Fixed
68273cb3c8e115b1886ddb4bdf30dd91af1a9e62
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
4a758e9a1f5ed722f83c4dd35f867fe811553bcb
Fixed
7d8afac865e73648bae36075b829d5bc4dd32f4e
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
9b1dbd69ba6f8f8c69bc7b77c2ce3b9c6ed05ba6
Fixed
bac6a5a3c96237c025086b885d31a3485a3204d9
Fixed
91d0048a97e0fdc0a071caa0ba59e659bc6f84df
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
9baee36e8c5443411c4629afabafaff8a46a23fd
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
c2f64e05a0587a83ec42dbd6b7a7ded79b2ff694

Affected versions

v5.*
v5.10.253
v5.10.254
v5.10.255
v5.10.256
v5.10.257
v5.10.258
v5.10.259
v5.10.260
v5.10.261
v5.10.262
v5.10.263
v5.10.264
v5.10.265
v5.10.266
v5.10.267
v5.10.268
v5.10.269
v5.10.270
v5.10.271
v5.10.272
v5.10.273
v5.10.274
v5.10.275
v5.15.220
v5.15.221
v5.15.222
v5.15.223
v5.15.224
v5.15.225
v6.*
v6.1.167
v6.1.168
v6.1.169
v6.1.170
v6.1.171
v6.1.172
v6.1.173
v6.1.174
v6.1.175
v6.1.176
v6.1.177
v6.1.178
v6.1.179
v6.1.180
v6.1.181
v6.1.182
v6.1.183
v6.1.184
v6.1.185
v6.1.186
v6.1.187
v6.1.188
v6.1.189
v6.1.190
v6.1.191
v6.1.192
v6.12.100
v6.12.101
v6.12.102
v6.12.103
v6.12.104
v6.12.105
v6.12.106
v6.12.107
v6.12.108
v6.12.109
v6.12.110
v6.12.111
v6.12.112
v6.12.113
v6.12.114
v6.12.115
v6.12.116
v6.12.117
v6.12.118
v6.12.78
v6.12.79
v6.12.80
v6.12.81
v6.12.82
v6.12.83
v6.12.84
v6.12.85
v6.12.86
v6.12.87
v6.12.88
v6.12.89
v6.12.90
v6.12.91
v6.12.92
v6.12.93
v6.12.94
v6.12.95
v6.12.96
v6.12.97
v6.12.98
v6.12.99
v6.18.19
v6.18.20
v6.18.21
v6.18.22
v6.18.23
v6.18.24
v6.18.25
v6.18.26
v6.18.27
v6.18.28
v6.18.29
v6.18.30
v6.18.31
v6.18.32
v6.18.33
v6.18.34
v6.18.35
v6.18.36
v6.18.37
v6.18.38
v6.18.39
v6.18.40
v6.18.41
v6.18.42
v6.18.43
v6.18.44
v6.18.45
v6.18.46
v6.18.47
v6.18.48
v6.18.49
v6.18.50
v6.18.51
v6.18.52
v6.18.53
v6.18.54
v6.18.55
v6.18.56
v6.18.57
v6.18.58
v6.18.59
v6.18.60
v6.18.61
v6.18.62
v6.18.63
v6.18.64
v6.19.10
v6.19.11
v6.19.12
v6.19.13
v6.19.14
v6.19.9
v6.6.130
v6.6.131
v6.6.132
v6.6.133
v6.6.134
v6.6.135
v6.6.136
v6.6.137
v6.6.138
v6.6.139
v6.6.140
v6.6.141
v6.6.142
v6.6.143
v6.6.144
v6.6.145
v6.6.146
v6.6.147
v6.6.148
v6.6.149
v6.6.150
v6.6.151
v6.6.152
v6.6.153
v6.6.154
v6.6.155
v6.6.156
v6.6.157
v6.6.158
v6.6.159
v6.6.160
v6.6.161
v6.6.162

Database specific

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

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
5.10.253
Fixed
5.11
Type
ECOSYSTEM
Events
Introduced
5.15.220
Fixed
5.15.226
Type
ECOSYSTEM
Events
Introduced
6.1.167
Fixed
6.1.193
Type
ECOSYSTEM
Events
Introduced
6.6.130
Fixed
6.6.163
Type
ECOSYSTEM
Events
Introduced
6.12.78
Fixed
6.12.119
Type
ECOSYSTEM
Events
Introduced
6.18.19
Fixed
6.18.65
Type
ECOSYSTEM
Events
Introduced
6.19.9
Fixed
6.20
Type
ECOSYSTEM
Events
Introduced
7.0.0
Fixed
7.3.6

Database specific

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