ALSA: usb-audio: Fix potential memory leaks
Published Oct 4, 2025
5.5
MEDIUMCVSS 3.1
EPSS 0.16%
Description
When the driver hits -ENOMEM at allocating a URB or a buffer, it aborts and goes to the error path that releases the all previously allocated resources. However, when -ENOMEM hits at the middle of the sync EP URB allocation loop, the partially allocated URBs might be left without released, because ep->nurbs is still zero at that point.
Fix it by setting ep->nurbs at first, so that the error handler loops over the full URB list.
Affected products
-
- Version StatusaffectedConstraints
- Version StatusaffectedConstraints
- Version StatusaffectedConstraints
- Version StatusaffectedConstraints
- Version StatusaffectedConstraints
- Version StatusaffectedConstraints
- Version StatusaffectedConstraints
- Version StatusaffectedConstraints
- Version StatusaffectedConstraints
- Version
-
- Version 3.5StatusaffectedConstraints-
- Version 0StatusunaffectedConstraints<3.5
- Version 4.14.296StatusunaffectedConstraints<=4.14.*
- Version 4.19.262StatusunaffectedConstraints<=4.19.*
- Version 4.9.331StatusunaffectedConstraints<=4.9.*
- Version 5.10.150StatusunaffectedConstraints<=5.10.*
- Version 5.15.75StatusunaffectedConstraints<=5.15.*
- Version 5.19.17StatusunaffectedConstraints<=5.19.*
- Version 5.4.220StatusunaffectedConstraints<=5.4.*
- Version 6.0.3StatusunaffectedConstraints<=6.0.*
- Version 6.1StatusunaffectedConstraints<=*
- Version
Default status is the baseline for the product, each version can override it (e.g. patched versions marked unaffected).
| Vendor | Product | Default status | Versions | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Linux | Linux | unaffected |
| ||||||||||||||||||||||||||||||||||||
| Linux | Linux | affected |
|
- ≥ 3.5 · < 4.9.331
- ≥ 4.10 · < 4.14.296
- ≥ 4.15 · < 4.19.262
- ≥ 4.20 · < 5.4.220
- ≥ 5.5 · < 5.10.150
- ≥ 5.11 · < 5.15.75
- ≥ 5.16 · < 5.19.17
- ≥ 6.0 · < 6.0.3
No data.
Red Hat Enterprise Linux 8
kernel-0:4.18.0-477.10.1.el8_8
Fixed · RHSA-2023:2951
Red Hat Enterprise Linux 9
kernel-0:5.14.0-284.11.1.el9_2
Fixed · RHSA-2023:2458
Red Hat Enterprise Linux 9
kernel-0:5.14.0-284.11.1.el9_2
Fixed · RHSA-2023:2458
Red Hat Enterprise Linux 10
kernel
Not affected
Red Hat Enterprise Linux 6
kernel
Out of support scope
Red Hat Enterprise Linux 7
kernel
Fix deferred
Red Hat Enterprise Linux 7
kernel-rt
Fix deferred
Red Hat Enterprise Linux 8
kernel-rt
Fix deferred
Red Hat Enterprise Linux 9
kernel-rt
Fix deferred
| Product | Package | State | Advisory |
|---|---|---|---|
| Red Hat Enterprise Linux 8 | kernel-0:4.18.0-477.10.1.el8_8 | Fixed | RHSA-2023:2951 |
| Red Hat Enterprise Linux 9 | kernel-0:5.14.0-284.11.1.el9_2 | Fixed | RHSA-2023:2458 |
| Red Hat Enterprise Linux 9 | kernel-0:5.14.0-284.11.1.el9_2 | Fixed | RHSA-2023:2458 |
| Red Hat Enterprise Linux 10 | kernel | Not affected | n/a |
| Red Hat Enterprise Linux 6 | kernel | Out of support scope | n/a |
| Red Hat Enterprise Linux 7 | kernel | Fix deferred | n/a |
| Red Hat Enterprise Linux 7 | kernel-rt | Fix deferred | n/a |
| Red Hat Enterprise Linux 8 | kernel-rt | Fix deferred | n/a |
| Red Hat Enterprise Linux 9 | kernel-rt | Fix deferred | n/a |
No package ranges for this CVE.
Remediation
Red Hat statement
USB audio devices often use isochronous endpoints for audio streaming, with separate synchronization endpoints for clock recovery. During initialization, the driver allocates multiple URBs (USB Request Blocks) for these endpoints. The allocation happens in a loop: create URB, allocate buffer, repeat. The ep->nurbs field tracks how many URBs have been successfully allocated. Here's the problem: ep->nurbs is only set after the entire loop completes successfully. If allocation fails midway—say, the driver successfully allocates 5 URBs but fails on the 6th due to -ENOMEM—the error handler is supposed to clean up. It loops from 0 to ep->nurbs, freeing each URB. But since ep->nurbs is still zero (it was never updated), the loop doesn't execute at all. The 5 successfully allocated URBs are simply abandoned. Each time USB audio initialization fails under memory pressure, more URBs leak. The fix is simple: set ep->nurbs before starting the loop, so the cleanup knows how far to iterate.
References (15)
- https://access.redhat.com/security/cve/CVE-2022-50484 Vendor Advisory
- https://bugzilla.redhat.com/show_bug.cgi?id=2401488 Issue Tracking
- https://euvd.enisa.europa.eu/vulnerability/EUVD-2025-32370 Advisory
- https://git.kernel.org/stable/c/0604e5e5537af099ea2f6dfd892afe5c92db8a80 Patch
- https://git.kernel.org/stable/c/0672215994e2347a9b4f145e2bc1709b1e01cee3 Patch
- https://git.kernel.org/stable/c/28d8d267af5d73f91d7640cbdb4024703256e36c Patch
- https://git.kernel.org/stable/c/46f0aed47673e275d682af60ed26dcc28add8eae Patch
- https://git.kernel.org/stable/c/6382da0828995af87aa8b8bef28cc61aceb4aff3 Patch
- https://git.kernel.org/stable/c/988ec0cd0a2643c25c1658f7c33de2e15a5a2e31 Patch
- https://git.kernel.org/stable/c/bc1d16d282bca421c6fc31de4b8fd412010f01bd Patch
- https://git.kernel.org/stable/c/e4442410f76d66b9f7e854010bce04853f665324 Patch
- https://git.kernel.org/stable/c/faa8c1ed77d0169955b9b3516b714cc5fb512f27 Patch
- https://lore.kernel.org/linux-cve-announce/2025100440-CVE-2022-50484-1a6a@gregkh/T
- https://nvd.nist.gov/vuln/detail/CVE-2022-50484
- https://www.cve.org/CVERecord?id=CVE-2022-50484
Change history (0)
No recorded changes yet.