🇰🇷 한글 설명
Linux 커널의 OpenVPN TCP 스트림 처리에서 대용량 병합된 패킷 추출 시 헤더 오프셋 오버플로우와 비정렬 프로토콜 헤더로 인한 패킷 손실 및 성능 저하 취약점입니다. 수정을 통해 TCP 처리 성능이 최대 74% 개선됩니다.
💡 쉬운 설명
OpenVPN을 사용하는 시스템에서 특수한 네트워크 패킷을 받을 때 커널이 패킷을 올바르게 처리하지 못해 데이터 손실이나 성능 저하가 발생할 수 있습니다. 이는 주로 암호화된 VPN 터널 설정에 영향을 미칩니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
ovpn: tcp - fix packet extraction from stream
When processing TCP stream data in ovpn_tcp_recv, we receive large
cloned skbs from __strp_rcv that may contain multiple coalesced packets.
The current implementation has two bugs:
1. Header offset overflow: Using pskb_pull with large offsets on
coalesced skbs causes skb->data - skb->head to exceed the u16 storage
of skb->network_header. This causes skb_reset_network_header to fail
on the inner decapsulated packet, resulting in packet drops.
2. Unaligned protocol headers: Extracting packets from arbitrary
positions within the coalesced TCP stream provides no alignment
guarantees for the packet data causing performance penalties on
architectures without efficient unaligned access. Additionally,
openvpn's 2-byte length prefix on TCP packets causes the subsequent
4-byte opcode and packet ID fields to be inherently misaligned.
Fix both issues by allocating a new skb for each openvpn packet and
using skb_copy_bits to extract only the packet content into the new
buffer, skipping the 2-byte length prefix. Also, check the length before
invoking the function that performs the allocation to avoid creating an
invalid skb.
If the packet has to be forwarded to userspace the 2-byte prefix can be
pushed to the head safely, without misalignment.
As a side effect, this approach also avoids the expensive linearization
that pskb_pull triggers on cloned skbs with page fragments. In testing,
this resulted in TCP throughput improvements of up to 74%.
📍 영향받는 시스템
OpenVPN TCP 모드를 사용하는 Linux 커널 (버전 관계없이 취약점 수정 이전 버전)
⚔️ 공격 벡터
OpenVPN 클라이언트/서버에 특수하게 구성된 TCP 스트림을 전송하여 커널 패킷 처리 메커니즘을 교란
🛡️ 대응 방법
Linux 커널을 CVE 패치가 포함된 최신 버전으로 업데이트 (배포판 보안 업데이트 적용)
🔧 검증 코드
커널 버전과 OVPN 설정 여부를 확인하여 취약점 패치 적용 여부를 판단합니다. 최신 커널 버전이면 안전합니다.
uname -r && grep -i ovpn /boot/config-$(uname -r) 2>/dev/null | head -5