🇰🇷 한글 설명
Linux 커널의 ALSA(Advanced Linux Sound Architecture) 구성 요소에서 비원자적(non-atomic) 작업과 PCM 트리거 시작 간의 레이스 컨디션 취약점이 발견되었습니다. hw_params, hw_free, prepare 작업이 진행되는 동안 PCM 시작 명령이 동시에 실행될 경우 상태 불일치가 발생할 수 있습니다. 이 패치는 PCM 트리거 시 버퍼 접근 잠금 상태를 확인하여 동시 작업을 방지합니다.
💡 쉬운 설명
사운드 카드를 제어하는 과정에서 두 가지 명령이 동시에 처리되려고 할 때 충돌이 발생하는 문제입니다. 이로 인해 시스템의 사운드 설정 상태가 꼬이거나 예기치 않은 오류가 발생할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
ALSA: pcm: Fix race between non-atomic ops and trigger-start
We protect the races of the concurrent state transitions between
atomic PCM ops, but the checks between the non-atomic ops (hw_params,
hw_free and prepare) and the atomic ops aren't perfect; there is a
check of the conflicting PCM state at the beginning of hw_params & co,
but the atomic PCM ops can be still issued during the non-atomic PCM
operations. An example such scenario is that a thread A re-issues the
PREPARE or HW_PARAMS for the already prepared stream, while another
thread B triggers the PCM start in the middle of the prepare
operation. Although this usually doesn't lead to much serious issues,
it can give some inconsistency as reported by syzkaller (such as
ODEBUG warning).
There are various atomic PCM ops, and basically the only problem is
the PCM start as it operates from the PREPARED state. Other trigger
commands (stop, etc) are for the running or the other special state,
hence they are filtered as pre-condition.
This patch is for preventing the PCM trigger-start during the non-
atomic operations in order to address the problems above.
Fortunately, the hw_params, hw_free and prepare operations call
snd_pcm_buffer_access_lock(), and this can be used for checking the
concurrent operations at the PCM trigger -- which sets the
runtime->buffer_accessing to a negative (if possible), so the PCM
trigger just needs to check the runtime->buffer_accessing value; if
it's negative, it means the concurrent non-atomic PCM ops is running.
📍 영향받는 시스템
Linux Kernel (ALSA 구성 요소 포함 버전)
⚔️ 공격 벡터
로컬 사용자가 정교하게 설계된 멀티스레드 명령을 통해 사운드 드라이버의 상태 불일치를 유도
🛡️ 대응 방법
ALSA 레이스 컨디션 패치가 적용된 최신 Linux 커널로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 패치 버전 이후인지 확인