🇰🇷 한글 설명
Linux 커널의 nexthop 처리 과정에서 IPv6 nexthop을 IPv4로 교체할 때 그룹의 has_v4 플래그가 업데이트되지 않는 취약점입니다. 이로 인해 잘못된 경로 설정이 허용되어 NULL 포인터 역참조가 발생하고 시스템 패닉(커널 충돌)이 유발될 수 있습니다.
💡 쉬운 설명
네트워크 경로를 설정할 때 IPv6에서 IPv4로 변경하면 시스템이 이를 제대로 인식하지 못하는 오류가 있습니다. 이 오류를 이용하면 시스템이 갑자기 멈추거나 꺼지는 현상이 발생할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
nexthop: fix IPv6 route referencing IPv4 nexthop
syzbot reported a panic [1] [2].
When an IPv6 nexthop is replaced with an IPv4 nexthop, the has_v4 flag
of all groups containing this nexthop is not updated. This is because
nh_group_v4_update is only called when replacing AF_INET to AF_INET6,
but the reverse direction (AF_INET6 to AF_INET) is missed.
This allows a stale has_v4=false to bypass fib6_check_nexthop, causing
IPv6 routes to be attached to groups that effectively contain only AF_INET
members. Subsequent route lookups then call nexthop_fib6_nh() which
returns NULL for the AF_INET member, leading to a NULL pointer
dereference.
Fix by calling nh_group_v4_update whenever the family changes, not just
AF_INET to AF_INET6.
Reproducer:
# AF_INET6 blackhole
ip -6 nexthop add id 1 blackhole
# group with has_v4=false
ip nexthop add id 100 group 1
# replace with AF_INET (no -6), has_v4 stays false
ip nexthop replace id 1 blackhole
# pass stale has_v4 check
ip -6 route add 2001:db8::/64 nhid 100
# panic
ping -6 2001:db8::1
[1] https://syzkaller.appspot.com/bug?id=e17283eb2f8dcf3dd9b47fe6f67a95f71faadad0
[2] https://syzkaller.appspot.com/bug?id=8699b6ae54c9f35837d925686208402949e12ef3
📍 영향받는 시스템
Linux Kernel (IPv6 nexthop 관련 기능 사용 시)
⚔️ 공격 벡터
로컬 사용자가 특수하게 조작된 IPv6/IPv4 nexthop 교체 명령을 실행하여 커널 패닉 유도
🛡️ 대응 방법
IPv6에서 IPv4로의 주소 체계 변경 시에도 nh_group_v4_update가 호출되도록 커널 패치 적용
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 최신 패치 버전인지 확인