🇰🇷 한글 설명
Linux 커널의 mshv 모듈에서 mshv_irqfd_deassign 함수가 적절한 잠금(lock)을 획득하지 않아 발생하는 레이스 컨디션 취약점입니다. 이로 인해 리스트 순회 중 데이터 불일치가 발생하거나, 노드 포인터 오염으로 인해 중복 삭제(double hlist_del)가 발생할 수 있습니다.
💡 쉬운 설명
컴퓨터의 핵심 부품인 커널이 데이터를 정리하는 과정에서 순서가 꼬여 오류가 발생하는 문제입니다. 이 오류를 이용하면 시스템이 갑자기 멈추거나 예상치 못한 동작을 할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
mshv: Fix race in mshv_irqfd_deassign
mshv_irqfd_deactivate() and the hlist traversal of pt_irqfds_list
require pt->pt_irqfds_lock to be held, but mshv_irqfd_deassign()
omits it. This races with the EPOLLHUP path in mshv_irqfd_wakeup(),
which does take the lock before calling mshv_irqfd_deactivate().
Additionally, mshv_irqfd_deactivate() uses hlist_del() which poisons
the node pointers rather than resetting them. Since
mshv_irqfd_is_active() relies on hlist_unhashed() (checks pprev ==
NULL), a poisoned node still appears active. If a concurrent path calls
mshv_irqfd_deactivate() again on the same irqfd, the guard fails to
prevent a double hlist_del() on poisoned pointers.
Fix both issues:
- Add the missing spin_lock_irq/spin_unlock_irq around the list
traversal in mshv_irqfd_deassign(), matching mshv_irqfd_release().
- Use hlist_del_init() instead of hlist_del() so the node is properly
marked as unhashed after removal, making the is_active guard reliable.
📍 영향받는 시스템
Linux kernel (mshv 모듈을 사용하는 특정 버전)
⚔️ 공격 벡터
동시성 제어 미흡을 이용한 레이스 컨디션 유도 (Local/Remote)
🛡️ 대응 방법
커널 패치를 통해 mshv_irqfd_deassign에 spin_lock을 추가하고 hlist_del_init를 사용하도록 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 패치 버전인지 배포판 보안 공지를 통해 확인