🇰🇷 한글 설명
Linux kernel의 IPv6 라우팅에서 VRF(가상 라우팅)로부터 네트워크 인터페이스가 제거될 때 NULL 포인터 역참조 오류가 발생할 수 있습니다. ip6_rt_get_dev_rcu() 함수에서 fallback 처리가 누락되어 커널 패닉이나 시스템 충돌을 유발합니다.
💡 쉬운 설명
Linux 시스템의 네트워크 설정을 변경할 때 커널이 잘못된 메모리를 접근하려고 시도하여 시스템이 충돌할 수 있습니다. VRF 기능을 사용하는 서버에서 인터페이스 구성 변경 시 특히 위험합니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
ipv6: fix NULL pointer deref in ip6_rt_get_dev_rcu()
l3mdev_master_dev_rcu() can return NULL when the slave device is being
un-slaved from a VRF. All other callers deal with this, but we lost
the fallback to loopback in ip6_rt_pcpu_alloc() -> ip6_rt_get_dev_rcu()
with commit 4832c30d5458 ("net: ipv6: put host and anycast routes on
device with address").
KASAN: null-ptr-deref in range [0x0000000000000108-0x000000000000010f]
RIP: 0010:ip6_rt_pcpu_alloc (net/ipv6/route.c:1418)
Call Trace:
ip6_pol_route (net/ipv6/route.c:2318)
fib6_rule_lookup (net/ipv6/fib6_rules.c:115)
ip6_route_output_flags (net/ipv6/route.c:2607)
vrf_process_v6_outbound (drivers/net/vrf.c:437)
I was tempted to rework the un-slaving code to clear the flag first
and insert synchronize_rcu() before we remove the upper. But looks like
the explicit fallback to loopback_dev is an established pattern.
And I guess avoiding the synchronize_rcu() is nice, too.
📍 영향받는 시스템
Linux kernel 4.15 이상 (commit 4832c30d5458 이후, VRF 기능 활성화)
⚔️ 공격 벡터
로컬 공격자가 VRF에서 네트워크 인터페이스를 동적으로 제거하거나 특정 IPv6 패킷 라우팅을 유발하여 커널 패닉 트리거
🛡️ 대응 방법
Linux kernel을 최신 버전으로 업데이트하거나 ip6_rt_get_dev_rcu() 함수에 NULL 체크 및 loopback_dev fallback을 추가한 패치 적용
🔧 검증 코드
명령어가 route.c에서 loopback_dev fallback 코드를 찾으면 패치됨, 'patched' 출력이면 취약점이 수정된 것입니다.
grep -n 'l3mdev_master_dev_rcu\|loopback_dev' /usr/src/linux-headers-$(uname -r)/net/ipv6/route.c 2>/dev/null | head -1 || echo 'patched'