🔍 CVE-2025-68282

0.0
CVSS Score
UNKNOWN
2025-12-16
2026-10-13 19:10
✅ 완료

🇰🇷 한글 설명

리눅스 커널의 USB 가젯 장치 제거 과정에서 발생하는 레이스 컨디션으로 인해 use-after-free 취약점이 발생합니다. 장치 정리 중 인터럽트가 발생하여 새로운 작업이 스케줄링될 경우, 이미 해제된 메모리에 접근하여 시스템 불안정이나 권한 상승을 초래할 수 있습니다.

💡 쉬운 설명

USB 장치를 연결 해제하는 도중에 갑자기 다른 신호가 들어오면, 컴퓨터가 이미 지워버린 메모리 영역을 다시 사용하려고 시도하는 오류입니다. 이로 인해 시스템이 멈추거나 보안 문제가 생길 수 있습니다.

🇺🇸 원문 (English)

In the Linux kernel, the following vulnerability has been resolved: usb: gadget: udc: fix use-after-free in usb_gadget_state_work A race condition during gadget teardown can lead to a use-after-free in usb_gadget_state_work(), as reported by KASAN: BUG: KASAN: invalid-access in sysfs_notify+0x2c/0xd0 Workqueue: events usb_gadget_state_work The fundamental race occurs because a concurrent event (e.g., an interrupt) can call usb_gadget_set_state() and schedule gadget->work at any time during the cleanup process in usb_del_gadget(). Commit 399a45e5237c ("usb: gadget: core: flush gadget workqueue after device removal") attempted to fix this by moving flush_work() to after device_del(). However, this does not fully solve the race, as a new work item can still be scheduled *after* flush_work() completes but before the gadget's memory is freed, leading to the same use-after-free. This patch fixes the race condition robustly by introducing a 'teardown' flag and a 'state_lock' spinlock to the usb_gadget struct. The flag is set during cleanup in usb_del_gadget() *before* calling flush_work() to prevent any new work from being scheduled once cleanup has commenced. The scheduling site, usb_gadget_set_state(), now checks this flag under the lock before queueing the work, thus safely closing the race window.

📍 영향받는 시스템

Linux Kernel (USB Gadget Driver 관련 버전)

⚔️ 공격 벡터

USB 가젯 장치 제거(teardown) 과정 중 특정 인터럽트를 유발하여 레이스 컨디션 유도

🛡️ 대응 방법

리눅스 커널을 최신 보안 패치가 적용된 버전으로 업데이트 (teardown 플래그 및 state_lock 도입 버전)

🔧 검증 코드

출력된 커널 버전이 해당 취약점이 해결된 패치 커밋(399a45e5237c 이후)이 포함된 버전인지 확인합니다.

Shell / Script
uname -r

💻 영향받는 소프트웨어

Linux Kernel