🇰🇷 한글 설명
Linux 커널의 mt76 Wi-Fi 드라이버에서 mt76_put_vif_phy_link 함수가 RCU 보호를 받는 메모리를 적절한 대기 시간 없이 kfree()로 즉시 해제하는 취약점이 발견되었습니다. 이로 인해 기존 RCU 리더가 해제된 메모리에 접근할 경우 Use-After-Free(UAF) 오류가 발생할 수 있습니다.
💡 쉬운 설명
Wi-Fi를 사용하는 과정에서 컴퓨터가 이미 사용 중인 메모리를 너무 빨리 지워버려 발생하는 문제입니다. 이로 인해 시스템이 갑자기 멈추거나 보안 문제가 생길 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
wifi: mt76: use kfree_rcu for offchannel link in mt76_put_vif_phy_link
mt76_put_vif_phy_link() frees the offchannel mlink with plain kfree()
after rcu_assign_pointer(NULL). However, rcu_assign_pointer only prevents
future RCU readers from obtaining the pointer -- it does not wait for
existing readers that already hold it via rcu_dereference.
The TX datapath (e.g. mt7996_mac_write_txwi) dereferences mlink->wcid
and mlink->idx under rcu_read_lock. If a TX softirq obtained the pointer
via rcu_dereference just before the NULL assignment, it will dereference
freed memory after the kfree.
struct mt76_vif_link already contains an rcu_head field that is unused at
this free site -- a developer oversight, since the adjacent
kfree_rcu_mightsleep call for rx_sc in the same function shows the
pattern was understood.
Replace kfree(mlink) with kfree_rcu(mlink, rcu_head).
📍 영향받는 시스템
Linux kernel (mt76 Wi-Fi driver module)
⚔️ 공격 벡터
특정 네트워크 트래픽 상황을 유도하여 메모리 해제와 데이터 접근 간의 타이밍 차이(Race Condition)를 이용한 Use-After-Free 공격
🛡️ 대응 방법
커널 패치를 적용하여 kfree() 호출을 kfree_rcu()로 교체하여 메모리 해제 시점을 RCU 동기화에 맞게 조정해야 합니다.
🔧 검증 코드
현재 커널 버전과 mt76 모듈 정보를 확인하고, dmesg 로그에서 관련 메모리 오류(Use-After-Free) 흔적이 있는지 확인합니다.
uname -r && modinfo mt76 && dmesg | grep -i 'mt76'