🇰🇷 한글 설명
Linux 커널의 usb gadget f_midi2 드라이버에서 문자열 속성을 표시하는 과정 중 Use-After-Free 취약점이 발견되었습니다. f_midi2_opts_str_show 함수가 락을 획득하기 전에 포인터를 역참조하여, 동시에 값이 변경될 경우 이미 해제된 메모리에 접근할 수 있는 레이스 컨디션이 발생합니다.
💡 쉬운 설명
컴퓨터의 USB 설정 정보를 읽어오는 과정에서, 정보를 읽는 도중에 다른 프로그램이 해당 정보를 삭제하면 시스템이 혼란에 빠지는 문제입니다. 이로 인해 시스템이 갑자기 멈추거나 보안 문제가 생길 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
usb: gadget: f_midi2: fix use-after-free in string attribute show path
f_midi2_opts_str_show() takes the string lock internally, but its
callers dereference the opts->info.<field> pointer before calling it,
outside the lock. This races with f_midi2_opts_str_store(), which
frees the old string under opts->lock when the attribute is written
concurrently, the show path can read a pointer that gets freed
before the lock inside str_show() is even taken.
Change f_midi2_opts_str_show() to take a pointer to the string field,
matching the existing pattern in f_midi2_opts_str_store(), and
dereference it only after the lock is held. Update all three callers
(iface_name, block name, and the EP string option macro) accordingly.
📍 영향받는 시스템
Linux kernel (usb gadget f_midi2 driver 포함 버전)
⚔️ 공격 벡터
로컬 공격자가 USB gadget 속성을 동시에 읽고 쓰는 작업을 수행하여 메모리 오류 유도
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 패치 버전 이후인지 확인