🇰🇷 한글 설명
Linux 커널의 ALSA 타이머 관리 과정에서 snd_timer 객체가 해제될 때 연결된 슬레이브 타이머 인스턴스들이 제대로 분리되지 않아 발생하는 Use-After-Free 취약점입니다. 특히 CONFIG_SND_UTIMER 설정이 활성화된 경우, 사용자 공간에서 타이머를 빈번하게 생성 및 삭제함으로써 해당 취약점을 쉽게 유발할 수 있습니다.
💡 쉬운 설명
사운드 장치를 제어하는 타이머 기능이 종료될 때, 연결된 하위 타이머들을 제대로 정리하지 못해 메모리 오류가 발생하는 문제입니다. 공격자가 이 허점을 이용하면 이미 삭제된 메모리 영역에 접근하여 시스템을 불안정하게 만들거나 보안 문제를 일으킬 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
ALSA: timer: Forcibly close timer instances at closing
When snd_timer object is freed via snd_timer_free() and still pending
snd_timer_instance objects are assigned to the timer object, it tries
to unlink all instances and just set NULL to each ti->timer, then
releases the resources immediately. The problem is, however, when
there are slave timer instances that are associated with a master
instance linked to this timer: namely, those slave instances still
point to the freed timer object although the master instance is
unlinked, which may lead to user-after-free. The bug can be easily
triggered particularly when a new userspace-driven timers
(CONFIG_SND_UTIMER) is involved, since it can create and delete the
timer object via a simple file open/close, while the other
applications may keep accessing to that timer.
This patch is an attempt to paper over the problem above: now instead
of just unlinking, call snd_timer_close[_locked]() forcibly for each
pending timer instance, so that all assigned slave timer instances are
properly detached, too. Since snd_timer_close() might be called later
by the driver that created that instance, the check of
SNDRV_TIMER_IFLG_DEAD is added at the beginning, too.
📍 영향받는 시스템
Linux Kernel (CONFIG_SND_UTIMER 설정이 활성화된 환경)
⚔️ 공격 벡터
사용자 공간에서 타이머 객체를 반복적으로 생성 및 삭제하여 메모리 해제 후 접근(Use-After-Free) 유도
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 snd_timer_close() 호출 로직 적용
🔧 검증 코드
출력된 커널 버전을 확인하여 해당 취약점이 해결된 패치 버전 이상인지 확인합니다.