🇰🇷 한글 설명
리눅스 커널의 TCP 스택에서 네트워크 네임스페이스(netns) 삭제 시 secpath를 적절히 해제하지 않아 발생하는 문제입니다. 이로 인해 xfrm_state에 대한 참조가 남아있게 되어 커널 경고(WARN)가 발생하거나 리소스 관리에 문제가 생길 수 있습니다.
💡 쉬운 설명
네트워크 설정을 삭제할 때 사용하던 데이터 조각이 메모리에 미처 지워지지 않고 남아있는 버그입니다. 이로 인해 시스템이 예상치 못한 경고를 내보내거나 메모리 관리 오류가 발생할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
tcp: drop secpath at the same time as we currently drop dst
Xiumei reported hitting the WARN in xfrm6_tunnel_net_exit while
running tests that boil down to:
- create a pair of netns
- run a basic TCP test over ipcomp6
- delete the pair of netns
The xfrm_state found on spi_byaddr was not deleted at the time we
delete the netns, because we still have a reference on it. This
lingering reference comes from a secpath (which holds a ref on the
xfrm_state), which is still attached to an skb. This skb is not
leaked, it ends up on sk_receive_queue and then gets defer-free'd by
skb_attempt_defer_free.
The problem happens when we defer freeing an skb (push it on one CPU's
defer_list), and don't flush that list before the netns is deleted. In
that case, we still have a reference on the xfrm_state that we don't
expect at this point.
We already drop the skb's dst in the TCP receive path when it's no
longer needed, so let's also drop the secpath. At this point,
tcp_filter has already called into the LSM hooks that may require the
secpath, so it should not be needed anymore. However, in some of those
places, the MPTCP extension has just been attached to the skb, so we
cannot simply drop all extensions.
📍 영향받는 시스템
Linux Kernel (TCP/XFRM 관련 모듈 사용 환경)
⚔️ 공격 벡터
로컬 공격자가 특정 네트워크 네임스페이스와 TCP/ipcomp6 설정을 생성하고 삭제하는 과정을 반복하여 유도
🛡️ 대응 방법
리눅스 커널을 최신 보안 패치가 적용된 버전으로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 패치 버전 이후인지 확인