🇰🇷 한글 설명
Linux 커널의 TIPC 프로토콜에서 tipc_exit_net() 함수 호출 시 UDP 베어러 정리 작업이 완료될 때까지 busy-wait 루프를 사용하여 CPU 자원을 과도하게 소모하는 취약점이 발견되었습니다. 특히 선점형 설정이 아니거나 높은 우선순위 작업에서 실행될 경우 CPU 사이클을 낭비하고 소프트 락업(soft lockup)을 유발할 수 있습니다. 이를 해결하기 위해 busy loop를 wait_var_event()로 교체하여 스레드가 적절히 대기할 수 있도록 수정되었습니다.
💡 쉬운 설명
컴퓨터가 특정 작업이 끝나기를 기다리는 동안 아무것도 하지 않고 계속 헛바퀴를 돌며 CPU를 낭비하는 문제가 있었습니다. 이로 인해 시스템이 멈추거나 느려질 수 있는데, 이제는 작업이 끝날 때까지 효율적으로 휴식을 취하며 기다리도록 개선되었습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
tipc: avoid busy looping in tipc_exit_net()
Blamed commit introduced a busy-wait loop in tipc_exit_net()
to wait for pending UDP bearer cleanup works to complete:
while (atomic_read(&tn->wq_count))
cond_resched();
This loop can busy-wait for a long time if cond_resched() is a NOP. This
typically happens if the netns exit is executed by a high priority task,
or under kernels configured without preemption (CONFIG_PREEMPT_NONE). In
such cases, it wastes CPU cycles and can lead to soft lockups.
Fix this by replacing the busy loop with wait_var_event(), allowing the
thread to sleep properly until the work queue count reaches zero.
Accordingly, update cleanup_bearer() to use atomic_dec_and_test() and
wake_up_var() to wake up the waiter when the count drops to zero.
This uses the global wait queue hash table, avoiding the need to bloat
struct tipc_net with a wait_queue_head_t. The atomic_dec_and_test()
provides the necessary memory barrier to ensure the wakeup is not missed.
📍 영향받는 시스템
Linux kernel (TIPC 프로토콜을 사용하는 환경)
⚔️ 공격 벡터
로컬 시스템에서 네트워크 네임스페이스(netns)를 종료할 때 CPU 자원 고갈 및 시스템 지연 유발 가능
🛡️ 대응 방법
TIPC 관련 busy-wait 루프가 수정된 최신 Linux 커널 버전으로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 패치된 이후의 버전인지 확인