🇰🇷 한글 설명
Linux 커널의 usb gadget u_audio 구성 요소에서 사운드 카드 연결 해제 시 Use-After-Free(UAF) 취약점이 발견되었습니다. 사운드 카드가 해제된 후에도 사용자 공간의 ALSA 제어 요소가 해당 메모리에 접근을 시도하여 메모리 오염이 발생할 수 있습니다.
💡 쉬운 설명
사운드 카드를 연결 해제할 때 컴퓨터가 메모리에서 정보를 너무 빨리 지워버리는 문제입니다. 이로 인해 프로그램이 이미 사라진 정보를 다시 읽으려다 시스템 오류나 보안 문제가 발생할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
usb: gadget: u_audio: Fix use-after-free on sound card disconnect
g_audio_cleanup() invokes snd_card_free_when_closed() to initiate sound
card teardown and immediately frees the underlying struct snd_uac_chip
context. However, snd_card_free_when_closed() returns asynchronously
while ALSA control elements (kctls) remain open in userspace.
When userspace control applications access or close these open file
descriptors, kctl callbacks attempt to dereference kctl->private_data
pointing to &uac->c_prm or &uac->p_prm within the freed uac structure,
resulting in a use-after-free (UAF) memory corruption.
Fix this issue by deferring the destruction of struct snd_uac_chip until
all references to the ALSA sound card are released. Register a custom
card->private_free callback (u_audio_card_free) during g_audio_setup()
that frees uac and its associated playback/capture request and ring
buffers only when the sound card reference count drops to zero.
📍 영향받는 시스템
Linux kernel (usb gadget u_audio module 사용 환경)
⚔️ 공격 벡터
사운드 카드 연결 해제 시 사용자 공간의 ALSA 제어 애플리케이션을 통한 메모리 참조 유도
🛡️ 대응 방법
사운드 카드 참조 횟수가 0이 될 때까지 메모리 해제를 지연시키는 커널 패치 적용
🔧 검증 코드
현재 실행 중인 커널 버전을 확인하여 해당 취약점이 수정된 최신 보안 패치 버전인지 확인합니다.