🇰🇷 한글 설명
Linux 커널의 ovpn 인터페이스 삭제 과정에서 새로운 피어를 추가할 때 발생하는 레이스 컨디션 취약점입니다. 인터페이스 삭제 중 netlink를 통해 새로운 피어가 추가되면 netdevice의 참조 카운트가 유지되어 장치 등록 해제가 불가능해지고 시스템이 멈출 수 있습니다.
💡 쉬운 설명
네트워크 연결을 끊는 도중에 갑자기 새로운 연결 요청이 들어오면, 컴퓨터가 연결을 완전히 정리하지 못하고 멈춰버리는 문제입니다. 이로 인해 네트워크 장치가 정상적으로 작동하지 않거나 시스템이 응답하지 않을 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
ovpn: fix race between deleting interface and adding new peer
While deleting an existing ovpn interface, there is a very
narrow window where adding a new peer via netlink may cause
the netdevice to hang and prevent its unregistration.
It may happen during ovpn_dellink(), when all existing peers are
freed and the device is queued for deregistration, but a
CMD_PEER_NEW message comes in adding a new peer that takes again
a reference to the netdev.
At this point there is no way to release the device because we are
under the assumption that all peers were already released.
Fix the race condition by releasing all peers in ndo_uninit(),
when the netdevice has already been removed from the netdev
list.
Also ovpn_peer_add() has now an extra check that forces the
function to bail out if the device reg_state is not REGISTERED.
This way any incoming CMD_PEER_NEW racing with the interface
deletion routine will simply stop before adding the peer.
Note that the above check happens while holding the netdev_lock
to prevent racing netdev state changes.
ovpn_dellink() is now empty and can be removed.
📍 영향받는 시스템
Linux kernel (ovpn module 사용 환경)
⚔️ 공격 벡터
인터페이스 삭제 시점에 netlink를 통해 의도적으로 CMD_PEER_NEW 메시지를 전송하여 레이스 컨디션 유발
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 패치 버전 이후인지 확인