CVE-2021-47281: ALSA: seq: Fix race of snd_seq_timer_open()
In the Linux kernel, the following vulnerability has been resolved:
ALSA: seq: Fix race of sndseqtimeropen()
The timer instance per queue is exclusive, and sndseqtimeropen() should have managed the concurrent accesses. It looks as if it's checking the already existing timer instance at the beginning, but it's not right, because there is no protection, hence any later concurrent call of sndseqtimeropen() may override the timer instance easily. This may result in UAF, as the leftover timer instance can keep running while the queue itself gets closed, as spotted by syzkaller recently.
For avoiding the race, add a proper check at the assignment of tmr->timeri again, and return -EBUSY if it's been already registered.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
In snd_seq_timer_open(), recheck tmr->timeri at the assignment and return -EBUSY if it has already been registered, preventing concurrent timer-instance registration.
Event History
Frequently Asked Questions
What is the severity of CVE-2021-47281?
The severity of CVE-2021-47281 is classified as medium due to potential race conditions that could affect system stability.
How do I fix CVE-2021-47281?
To fix CVE-2021-47281, update the Linux kernel to version 5.10.44 or later, or to any version in the 5.12.x or 5.13.x series.
What versions of the Linux kernel are affected by CVE-2021-47281?
CVE-2021-47281 affects Linux kernel versions up to 5.10.44, as well as versions between 5.11.0 and 5.12.11, and 5.13 release candidates.
What components are involved in the CVE-2021-47281 vulnerability?
CVE-2021-47281 involves the ALSA subsystem, specifically the handling of timers in the snd_seq_timer_open() function.
Is CVE-2021-47281 related to any previous vulnerabilities in the Linux kernel?
Yes, CVE-2021-47281 addresses a race condition that is part of ongoing security improvements in the ALSA subsystem of the Linux kernel.