🇰🇷 한글 설명
Linux 커널의 ESP(Encapsulating Security Payload) 구현 중 esp_ssg_unref() 함수에서 관리형 프래그먼트(managed frags)를 잘못 처리하는 취약점이 발견되었습니다. 이로 인해 skb가 소유하지 않은 페이지 참조를 해제하여 페이지 참조 카운트가 언더플로우될 수 있으며, 사용 중인 페이지가 조기 해제될 위험이 있습니다.
💡 쉬운 설명
컴퓨터 메모리를 관리하는 과정에서 이미 다른 곳에서 사용 중인 메모리 영역을 실수로 '사용 완료' 처리하여 삭제해 버리는 오류입니다. 이로 인해 시스템이 불안정해지거나 보안 문제가 발생할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
esp: do not unref managed frag pages in esp_ssg_unref()
esp_ssg_unref() releases the page references held on the source
scatterlist after the AEAD operation completes. It calls
skb_page_unref() on every frag page for an out-of-place transform
(req->src != req->dst), and in the error path of esp_output_tail()
(already_unref == true) on the request's own scatterlist.
This is wrong when the skb carries managed frags
(SKBFL_MANAGED_FRAG_REFS). Managed frags are owned by a zerocopy ubuf
and the skb does not hold a per-frag page reference; io_uring SEND_ZC
with a registered buffer attaches the bvec pages this way via
io_sg_from_iter(). The rest of the stack honours this invariant:
skb_release_data() skips the per-frag unref when SKBFL_MANAGED_FRAG_REFS
is set, and skb_zcopy_managed() is the guard used at the other unref
sites.
esp_ssg_unref() is missing that guard, so for a managed-frag skb it
drops a page reference the skb never acquired. This can underflow the
page reference count and free a page that is still in use.
Guard the function with skb_zcopy_managed() so both unref paths are
skipped for managed-frag skbs, matching skb_release_data().
📍 영향받는 시스템
Linux Kernel (io_uring SEND_ZC 및 managed frags를 사용하는 환경)
⚔️ 공격 벡터
io_uring의 SEND_ZC 기능을 통해 관리형 프래그먼트가 포함된 skb를 생성하여 ESP 처리 과정을 유도함
🛡️ 대응 방법
esp_ssg_unref() 함수에 skb_zcopy_managed() 가드를 추가하여 관리형 프래그먼트의 참조 해제를 방지하는 커널 패치 적용
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 패치된 최신 보안 업데이트 버전인지 확인