🇰🇷 한글 설명
Linux 커널의 AMT(AMT 프로토콜) 구현에서 skb 헤더 포인터를 캐싱한 후, 헤더를 재할당할 수 있는 헬퍼 함수를 호출하여 발생하는 Use-After-Free 취약점입니다. 헤더를 당기는(pull) 과정에서 기존 헤더 메모리가 해제될 수 있음에도 불구하고 이전 포인터를 계속 참조하여 메모리 오류를 유발합니다.
💡 쉬운 설명
데이터를 처리하는 과정에서 메모리 주소를 미리 저장해 두었는데, 중간에 데이터 위치가 바뀌면서 저장해둔 주소가 쓸모없게 되어 발생하는 오류입니다. 이로 인해 시스템이 충돌하거나 해커가 악성 코드를 실행할 위험이 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
amt: re-read skb header pointers after every pull
Several AMT receive and transmit paths cache a pointer into the skb head
(ip_hdr(), ipv6_hdr(), eth_hdr() or the AMT message header) and then call
a helper that can reallocate that head before the cached pointer is used
again. pskb_may_pull(), ip_mc_may_pull(), ipv6_mc_may_pull(),
iptunnel_pull_header(), ip_mc_check_igmp() and ipv6_mc_check_mld() can all
free the old head and move the data, so a pointer taken before the call
dangles afterwards and the later access is a use-after-free of the freed
head.
The affected sites are:
amt_rcv() caches ip_hdr() before amt_parse_type() pulls, then reads
iph->saddr.
amt_dev_xmit() caches ip_hdr()/ipv6_hdr() before ip_mc_check_igmp()/
ipv6_mc_check_mld() and pskb_may_pull(), then reads the group address.
amt_multicast_data_handler() caches eth_hdr() before pskb_may_pull(),
then writes the L2 header.
amt_membership_query_handler() caches the AMT header, the outer and
inner eth_hdr() and ip_hdr() before iptunnel_pull_header() and several
pulls, then reads and writes them.
amt_igmpv3_report_handler() and amt_mldv2_report_handler() cache
ip_hdr()/ipv6_hdr() and the current group record and read the record
count from the report header inside the record loop, across the
*_mc_may_pull() calls.
amt_update_handler() caches ip_hdr() and the AMT membership-update
header before pskb_may_pull(), iptunnel_pull_header(),
ip_mc_check_igmp() and the report handler, then reads iph->daddr and
amtmu->nonce / amtmu->response_mac.
Fix each site by either snapshotting the scalar that is used after the
pull before the first pull runs, or re-deriving the header pointer from
the skb after the last pull that can move the head. Values that are
stable across the pull (source and group address, the response MAC and
nonce, the record count, the outer source MAC) are snapshotted; pointers
that are written through or read repeatedly are re-derived.
📍 영향받는 시스템
AMT 프로토콜을 사용하는 Linux 커널 버전
⚔️ 공격 벡터
조작된 AMT 패킷을 전송하여 커널 내 메모리 재할당을 유도하고 잘못된 포인터를 참조하게 함
🛡️ 대응 방법
커널 패치를 적용하여 헤더를 다시 읽거나 필요한 값을 미리 복사하도록 업데이트
🔧 검증 코드
현재 실행 중인 커널 버전을 확인하여 취약점이 해결된 최신 패치 버전인지 확인합니다.