🔍 CVE-2024-26596

5.5
CVSS Score
MEDIUM
2024-02-23
2026-05-12 12:16
✅ 완료

🇰🇷 한글 설명

Linux 커널의 DSA(분산 스위치 아키텍처) 드라이버에서 netdev_priv() 함수를 타입 검사 전에 역참조하여 메모리 접근 오류가 발생하는 취약점입니다. dummy 인터페이스의 특정 네트워크 이벤트 처리 중 KASAN slab-out-of-bounds 오류를 유발합니다.

💡 쉬운 설명

Linux 커널이 네트워크 인터페이스 설정 변경 시 잘못된 메모리 위치를 접근하여 시스템이 중단될 수 있습니다. 일반 사용자가 dummy 인터페이스와 VLAN을 조합하여 의도적으로 이를 트리거할 수 있습니다.

🇺🇸 원문 (English)

In the Linux kernel, the following vulnerability has been resolved: net: dsa: fix netdev_priv() dereference before check on non-DSA netdevice events After the blamed commit, we started doing this dereference for every NETDEV_CHANGEUPPER and NETDEV_PRECHANGEUPPER event in the system. static inline struct dsa_port *dsa_user_to_port(const struct net_device *dev) { struct dsa_user_priv *p = netdev_priv(dev); return p->dp; } Which is obviously bogus, because not all net_devices have a netdev_priv() of type struct dsa_user_priv. But struct dsa_user_priv is fairly small, and p->dp means dereferencing 8 bytes starting with offset 16. Most drivers allocate that much private memory anyway, making our access not fault, and we discard the bogus data quickly afterwards, so this wasn't caught. But the dummy interface is somewhat special in that it calls alloc_netdev() with a priv size of 0. So every netdev_priv() dereference is invalid, and we get this when we emit a NETDEV_PRECHANGEUPPER event with a VLAN as its new upper: $ ip link add dummy1 type dummy $ ip link add link dummy1 name dummy1.100 type vlan id 100 [ 43.309174] ================================================================== [ 43.316456] BUG: KASAN: slab-out-of-bounds in dsa_user_prechangeupper+0x30/0xe8 [ 43.323835] Read of size 8 at addr ffff3f86481d2990 by task ip/374 [ 43.330058] [ 43.342436] Call trace: [ 43.366542] dsa_user_prechangeupper+0x30/0xe8 [ 43.371024] dsa_user_netdevice_event+0xb38/0xee8 [ 43.375768] notifier_call_chain+0xa4/0x210 [ 43.379985] raw_notifier_call_chain+0x24/0x38 [ 43.384464] __netdev_upper_dev_link+0x3ec/0x5d8 [ 43.389120] netdev_upper_dev_link+0x70/0xa8 [ 43.393424] register_vlan_dev+0x1bc/0x310 [ 43.397554] vlan_newlink+0x210/0x248 [ 43.401247] rtnl_newlink+0x9fc/0xe30 [ 43.404942] rtnetlink_rcv_msg+0x378/0x580 Avoid the kernel oops by dereferencing after the type check, as customary.

📍 영향받는 시스템

Linux kernel 전체, 특히 DSA 드라이버를 포함한 배포판(Debian, Ubuntu, RedHat 등)의 영향받은 커널 버전

⚔️ 공격 벡터

로컬 사용자가 'ip link add dummy1 type dummy' 후 'ip link add link dummy1 name dummy1.100 type vlan id 100' 명령을 실행하여 kernel panic 유발

🛡️ 대응 방법

Linux kernel 패치 적용 또는 최신 커널 버전으로 업그레이드 수행

🔧 검증 코드

현재 커널 버전 확인 후 설치된 linux-image 패키지의 버전을 확인하여 패치 여부 판단

Shell / Script
uname -r | grep -E '^[0-9]+\.[0-9]+' && dpkg -l 'linux-image*' 2>/dev/null | grep -E 'linux-image' | tail -1

📊 CVSS Vector String

CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H

💻 영향받는 소프트웨어

Linux Kernel