🇰🇷 한글 설명
Linux 커널 openvswitch 모듈에서, 등록 해제 중인 네트워크 디바이스(예: net/dummy)로 패킷을 전송할 때 skb_tx_hash()의 루프가 무한 반복되어 CPU 코어가 멈추는 문제입니다. 기존 수정은 carrier 상태만 확인해 불충분했으며, 이번 패치는 디바이스의 running 상태도 함께 확인하도록 보완했습니다.
💡 쉬운 설명
네트워크 장치를 제거하는 도중에 OVS 소프트웨어가 그 장치로 데이터를 보내려 하면 시스템 코어가 영원히 멈출 수 있습니다. 이 패치는 장치가 실제로 동작 중인지 확인해 그런 전송을 막습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
openvswitch: fix lockup on tx to unregistering netdev with carrier
Commit in a fixes tag attempted to fix the issue in the following
sequence of calls:
do_output
-> ovs_vport_send
-> dev_queue_xmit
-> __dev_queue_xmit
-> netdev_core_pick_tx
-> skb_tx_hash
When device is unregistering, the 'dev->real_num_tx_queues' goes to
zero and the 'while (unlikely(hash >= qcount))' loop inside the
'skb_tx_hash' becomes infinite, locking up the core forever.
But unfortunately, checking just the carrier status is not enough to
fix the issue, because some devices may still be in unregistering
state while reporting carrier status OK.
One example of such device is a net/dummy. It sets carrier ON
on start, but it doesn't implement .ndo_stop to set the carrier off.
And it makes sense, because dummy doesn't really have a carrier.
Therefore, while this device is unregistering, it's still easy to hit
the infinite loop in the skb_tx_hash() from the OVS datapath. There
might be other drivers that do the same, but dummy by itself is
important for the OVS ecosystem, because it is frequently used as a
packet sink for tcpdump while debugging OVS deployments. And when the
issue is hit, the only way to recover is to reboot.
Fix that by also checking if the device is running. The running
state is handled by the net core during unregistering, so it covers
unregistering case better, and we don't really need to send packets
to devices that are not running anyway.
While only checking the running state might be enough, the carrier
check is preserved. The running and the carrier states seem disjoined
throughout the code and different drivers. And other core functions
like __dev_direct_xmit() check both before attempting to transmit
a packet. So, it seems safer to check both flags in OVS as well.
📍 영향받는 시스템
Linux 커널 openvswitch 모듈을 사용하는 시스템 (패치 적용 전 커널 버전, 특히 해당 수정 이전 배포판)
⚔️ 공격 벡터
로컬 권한이 있는 사용자가 OVS 데이터패스에서 디바이스 등록 해제와 패킷 전송을 경쟁적으로 유발해 서비스 거부(코어 락업)를 일으킬 수 있음
🛡️ 대응 방법
배포판 제공 최신 커널로 업데이트하여 CVE-2025-21681 패치가 포함된 버전을 설치하고 재부팅
🔧 검증 코드
현재 실행 중인 커널 버전과 설치된 커널 패키지 정보를 확인하고, openvswitch 모듈 로드 여부를 점검합니다. 배포판 보안 공지에서 해당 커널 버전이 패치되었는지 대조하여 판단하세요.
uname -r && (dpkg -l linux-image-$(uname -r) 2>/dev/null || rpm -q kernel 2>/dev/null) && lsmod | grep -i openvswitch