CVE-2022-48702: ALSA: emu10k1: Fix out of bounds access in snd_emu10k1_pcm_channel_alloc()
In the Linux kernel, the following vulnerability has been resolved:
ALSA: emu10k1: Fix out of bounds access in sndemu10k1pcmchannelalloc()
The voice allocator sometimes begins allocating from near the end of the array and then wraps around, however sndemu10k1pcmchannelalloc() accesses the newly allocated voices as if it never wrapped around.
This results in out of bounds access if the first voice has a high enough index so that firstvoice + requestedvoicecount > NUMG (64). The more voices are requested, the more likely it is for this to occur.
This was initially discovered using PipeWire, however it can be reproduced by calling aplay multiple times with 16 channels: aplay -r 48000 -D plughw:CARD=Live,DEV=3 -c 16 /dev/zero
UBSAN: array-index-out-of-bounds in sound/pci/emu10k1/emupcm.c:127:40 index 65 is out of range for type 'sndemu10k1voice [64]' CPU: 1 PID: 31977 Comm: aplay Tainted: G W IOE 6.0.0-rc2-emu10k1+ #7 Hardware name: ASUSTEK COMPUTER INC P5W DH Deluxe/P5W DH Deluxe, BIOS 3002 07/22/2010 Call Trace: <TASK> dumpstacklvl+0x49/0x63 dumpstack+0x10/0x16 ubsanepilogue+0x9/0x3f ubsanhandleoutofbounds.cold+0x44/0x49 sndemu10k1playbackhwparams+0x3bc/0x420 [sndemu10k1] sndpcmhwparams+0x29f/0x600 [sndpcm] sndpcmcommonioctl+0x188/0x1410 [sndpcm] ? exittousermodeprepare+0x35/0x170 ? dosyscall64+0x69/0x90 ? syscallexittousermode+0x26/0x50 ? dosyscall64+0x69/0x90 ? exittousermodeprepare+0x35/0x170 sndpcmioctl+0x27/0x40 [sndpcm] x64sysioctl+0x95/0xd0 dosyscall64+0x5c/0x90 ? dosyscall64+0x69/0x90 ? dosyscall64+0x69/0x90 entrySYSCALL64afterhwframe+0x63/0xcd
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
Linux kernel (sound/pci/emu10k1)to a version that resolves this vulnerability.Fixed in 6.0.0-rc2-emu10k1+ #7 - Compensating control
If emupcm.c out-of-bounds can be triggered by requesting many voices (e.g., via ALSA/PipeWire/aplay with high channel counts), reduce the requested channel/voice count (e.g., lower -c / the number of voices) until the kernel fix is applied.
Event History
Frequently Asked Questions
What is the severity of CVE-2022-48702?
CVE-2022-48702 has a CVSS score that indicates it is a moderate to high severity vulnerability.
How do I fix CVE-2022-48702?
To fix CVE-2022-48702, upgrade your Linux kernel to a version that contains the patch addressing this vulnerability.
What software versions are affected by CVE-2022-48702?
CVE-2022-48702 affects specific versions of the Linux Kernel ranging from before 4.9.328 up to 6.0-rc4.
What type of vulnerability is CVE-2022-48702?
CVE-2022-48702 is an out-of-bounds access vulnerability in the ALSA emu10k1 driver.
Is there a workaround for CVE-2022-48702?
There are no known workarounds for CVE-2022-48702, and it is recommended to apply the latest kernel updates.