🇰🇷 한글 설명
Linux kernel USB Target 드라이버(f_tcm)에서 nexus 설정 전에 BOT 명령이 도착할 때 NULL 포인터를 검증 없이 역참조하는 취약점. USB 호스트의 악의적인 명령으로 커널 패닉(로컬 DoS) 발생.
💡 쉬운 설명
Linux 시스템에서 USB 장치 통신 준비가 완료되지 않은 상태에서 특정 명령이 오면 시스템이 충돌. 악의적인 USB 기기가 이를 악용해 컴퓨터를 강제 중단시킬 수 있음.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
usb: gadget: f_tcm: Fix NULL pointer dereferences in nexus handling
The `tpg->tpg_nexus` pointer in the USB Target driver is dynamically
managed and tied to userspace configuration via ConfigFS. It can be
NULL if the USB host sends requests before the nexus is fully
established or immediately after it is dropped.
Currently, functions like `bot_submit_command()` and the data
transfer paths retrieve `tv_nexus = tpg->tpg_nexus` and immediately
dereference `tv_nexus->tvn_se_sess` without any validation. If a
malicious or misconfigured USB host sends a BOT (Bulk-Only Transport)
command during this race window, it triggers a NULL pointer
dereference, leading to a kernel panic (local DoS).
This exposes an inconsistent API usage within the module, as peer
functions like `usbg_submit_command()` and `bot_send_bad_response()`
correctly implement a NULL check for `tv_nexus` before proceeding.
Fix this by bringing consistency to the nexus handling. Add the
missing `if (!tv_nexus)` checks to the vulnerable BOT command and
request processing paths, aborting the command gracefully with an
error instead of crashing the system.
📍 영향받는 시스템
CONFIG_USB_GADGET_TARGET 활성화된 Linux kernel (f_tcm 모듈)
⚔️ 공격 벡터
악의적/오구성 USB 호스트에서 nexus 미초기화 상태에 BOT 명령 전송
🛡️ 대응 방법
영향받는 Linux kernel을 최신 버전으로 업데이트 또는 보안 패치 적용
🔧 검증 코드
모듈이 로드되어 있으면 시스템이 취약할 수 있음. 로드되지 않으면 이 취약점 영향 없음.
lsmod | grep -i 'usb_target_tcm\|target_core_mod' && echo 'Vulnerable module loaded' || echo 'Module not loaded'