🇰🇷 한글 설명
리눅스 커널의 IPv4 IGMP 처리 과정에서 장치 해제와 IGMP 쿼리 처리 간의 경쟁 상태로 인해 Use-After-Free(UAF) 취약점이 발생합니다. 장치가 파괴되는 도중 타이머 콜백이 이미 해제된 메모리에 접근하여 커널 패닉을 유발할 수 있습니다.
💡 쉬운 설명
네트워크 장치가 꺼지는 순간과 네트워크 신호가 들어오는 순간이 겹치면서, 컴퓨터가 이미 사라진 정보를 다시 사용하려다 시스템이 멈추는 문제입니다. 이로 인해 시스템이 갑자기 재부팅되거나 중단될 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
ipv4: igmp: Fix potential UAF in igmp_gq_start_timer()
A race condition exists between device teardown (inetdev_destroy) and
incoming IGMP query processing (igmp_rcv), leading to a Use-After-Free
in the IGMP timer callback.
During device destruction, inetdev_destroy() drops the primary reference
to in_device, which can drop its refcount to 0. The actual freeing of
in_device memory is deferred via RCU (using call_rcu()).
Concurrently, igmp_rcv() runs under RCU read lock and obtains the
in_device pointer. Because the memory is RCU-protected, CPU-0 can safely
dereference in_device even if its refcount has hit 0.
However, if CPU-0 calls igmp_gq_start_timer() and re-arms the timer, it
attempts to acquire a reference using in_dev_hold(). This increments the
refcount from 0 to 1, triggering a "refcount_t: addition on 0" warning.
Since the in_device memory is still scheduled to be freed after the RCU
grace period (as the free callback does not check the refcount again),
the device is freed while the timer is still armed. When the timer
expires, it accesses the freed memory, causing a kernel panic.
Fix this by using refcount_inc_not_zero() (via a new helper
in_dev_hold_safe()) to prevent acquiring a reference if the device is
already being destroyed. If the refcount is 0, we do not arm the timer.
A similar issue in IPv6 MLD is fixed in a subsequent patch.
📍 영향받는 시스템
Linux Kernel (IPv4 IGMP 관련 모듈이 활성화된 버전)
⚔️ 공격 벡터
네트워크를 통해 특정 IGMP 패킷을 전송하여 장치 해제 시점과 타이머 실행 시점을 정밀하게 일치시키는 레이스 컨디션 공격
🛡️ 대응 방법
리눅스 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 in_dev_hold_safe() 로직을 적용해야 합니다.
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 패치 버전 이후인지 확인합니다.