🇰🇷 한글 설명
Linux 커널의 netfilter ipset 구성 요소에서 list:set 가비지 컬렉션(GC)과 swap 작업 간의 참조 카운트(refcount) 경합 조건 취약점이 발견되었습니다. ip_set_swap() 실행 중 참조 카운트가 이미 0이 된 세트를 참조하게 되어 커널 패닉(BUG_ON)을 유발할 수 있습니다.
💡 쉬운 설명
리눅스 시스템의 네트워크 설정 관리 도구에서 데이터 처리 순서가 꼬이면서 시스템이 갑자기 멈추거나 꺼질 수 있는 오류입니다. 특정 네트워크 규칙을 교체하는 과정에서 충돌이 발생하여 컴퓨터의 두뇌 역할을 하는 커널이 중단됩니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
netfilter: ipset: fix refcount race between list:set GC and swap
__ip_set_put_byindex() resolved the index to a set pointer under RCU,
then took ip_set_ref_lock in __ip_set_put() to decrement set->ref.
ip_set_swap() holds that same lock while swapping both the ip_set_list
slots and the two sets' ref counters, so it can interleave between the
dereference and the lock acquisition, leaving the caller to decrement a
set whose reference already moved to the other index and hit
BUG_ON(set->ref == 0). list_set_gc() reaches this from timer softirq,
which the nfnl mutex does not serialize against swap: an expiring
list:set member calls list_set_del() -> ip_set_put_byindex() while
IPSET_CMD_SWAP runs on the referenced sets.
Resolve the index and decrement under ip_set_ref_lock, as ip_set_swap()
already does, keeping the refcount tied to the index rather than to a
stale set pointer.
kernel BUG at net/netfilter/ipset/ip_set_core.c:685!
Oops: invalid opcode: 0000 [#1] SMP KASAN NOPTI
RIP: 0010:ip_set_put_byindex (net/netfilter/ipset/ip_set_core.c:870)
Call Trace:
<IRQ>
list_set_del (net/netfilter/ipset/ip_set_list_set.c:159)
set_cleanup_entries (net/netfilter/ipset/ip_set_list_set.c:181)
list_set_gc (net/netfilter/ipset/ip_set_list_set.c:578)
call_timer_fn (kernel/time/timer.c:1748)
__run_timers (kernel/time/timer.c:1799 kernel/time/timer.c:2374)
run_timer_softirq (kernel/time/timer.c:2405)
</IRQ>
Kernel panic - not syncing: Fatal exception in interrupt
📍 영향받는 시스템
Linux Kernel (netfilter/ipset 모듈을 사용하는 모든 시스템)
⚔️ 공격 벡터
로컬 권한을 가진 사용자가 ipset swap 명령과 가비지 컬렉션을 유도하여 커널 패닉 유발
🛡️ 대응 방법
ipset 관련 패치가 적용된 최신 Linux 커널 버전으로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 보안 패치 버전 이상인지 확인