🇰🇷 한글 설명
Linux 커널의 ovpn 모듈에서 TCP 수신(RX) 또는 송신(TX) 오류 발생 시 peer 객체의 참조 횟수(refcount)가 제대로 감소하지 않는 메모리 누수 취약점이 발견되었습니다. 두 경로에서 동시에 작업이 예약될 경우, 한쪽에서 증가시킨 참조 횟수가 해제되지 않아 peer 객체가 메모리에 계속 남게 됩니다.
💡 쉬운 설명
네트워크 통신 중 오류가 발생할 때 컴퓨터 메모리를 관리하는 숫자가 꼬여서, 사용이 끝난 데이터 공간을 비우지 못하고 계속 차지하게 되는 문제입니다. 이 현상이 반복되면 시스템의 메모리가 점차 부족해질 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
ovpn: fix peer refcount leak in TCP error paths
When either the TCP RX or TX error path calls ovpn_peer_hold() followed
by schedule_work(&peer->tcp.defer_del_work), and the work item is already
pending from the other path, schedule_work() returns false and the work
runs only once. Since ovpn_tcp_peer_del_work() calls ovpn_peer_put()
exactly once, the extra reference taken by the losing path is never
dropped, leaking the peer object.
The race window:
CPU0 (strparser/RX error): CPU1 (tcp_tx_work/TX error):
ovpn_peer_hold() <- refcnt+1 ovpn_peer_hold() <- refcnt+2
schedule_work() <- queued schedule_work() <- NO-OP
(work already pending)
ovpn_tcp_peer_del_work runs:
ovpn_peer_del()
ovpn_peer_put() <- refcnt+1
<- peer never freed
Fix by checking the return value of schedule_work() in both paths and
calling ovpn_peer_put() to drop the extra reference if the work was
already pending. ovpn_peer_hold() is kept unconditional in the TX path
as it cannot fail at that point.
📍 영향받는 시스템
Linux kernel (ovpn module 사용 환경)
⚔️ 공격 벡터
TCP 수신 및 송신 경로에서 동시에 오류를 유발하여 메모리 누수를 가속화하는 방식
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하십시오.
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 패치 버전 이후인지 확인하십시오.