🇰🇷 한글 설명
Linux 커널의 ath9k 무선 드라이버에서 ath9k_hif_usb_rx_cb 함수 처리 중 use-after-free 취약점이 발견되었습니다. ath9k_htc_probe_device에서 장치 초기화가 실패할 때 drv_priv 포인터가 먼저 해제되어, 이후 USB 인터럽트 콜백이 해제된 메모리에 접근하는 문제입니다. 수정은 drv_priv 초기화 위치를 probe 함수 끝으로 옮기고 통계 매크로를 NULL 안전하게 만드는 방식입니다.
💡 쉬운 설명
USB 무선랜 장치를 연결하는 과정이 실패하면 메모리가 이미 정리되었는데도 장치가 그 메모리를 다시 읽으려 합니다. 이 때문에 시스템이 불안정해지거나 악의적인 USB 장치로 악용될 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
ath9k: fix use-after-free in ath9k_hif_usb_rx_cb
Syzbot reported use-after-free Read in ath9k_hif_usb_rx_cb() [0]. The
problem was in incorrect htc_handle->drv_priv initialization.
Probable call trace which can trigger use-after-free:
ath9k_htc_probe_device()
/* htc_handle->drv_priv = priv; */
ath9k_htc_wait_for_target() <--- Failed
ieee80211_free_hw() <--- priv pointer is freed
<IRQ>
...
ath9k_hif_usb_rx_cb()
ath9k_hif_usb_rx_stream()
RX_STAT_INC() <--- htc_handle->drv_priv access
In order to not add fancy protection for drv_priv we can move
htc_handle->drv_priv initialization at the end of the
ath9k_htc_probe_device() and add helper macro to make
all *_STAT_* macros NULL safe, since syzbot has reported related NULL
deref in that macros [1]
📍 영향받는 시스템
ath9k_htc 드라이버를 사용하는 Linux 커널 (해당 패치 이전 버전, 5.x 및 6.x 계열 일부)
⚔️ 공격 벡터
물리적으로 연결된 악의적 USB 무선랜 장치가 초기화 실패 상황을 유도하여 커널 메모리 손상을 일으킬 수 있음
🛡️ 대응 방법
Linux 커널을 CVE-2022-50179 수정이 포함된 최신 안정 버전 또는 배포판 보안 업데이트로 업그레이드
🔧 검증 코드
커널 버전이 배포판의 패치된 버전 이상인지 확인하고, ath9k_htc 모듈이 로드되어 있지 않다면 이 취약점의 영향을 받지 않습니다.
uname -r && (lsmod | grep -E 'ath9k_htc|ath9k' || echo 'ath9k 모듈 미로드')