🇰🇷 한글 설명
Linux 커널의 MediaTek 이더넷 드라이버(mtk_eth_soc)에서 dummy netdev와 NAPI가 실제 네트워크 장치가 등록되기 전에 생성되지 않아 발생하는 취약점입니다. 이로 인해 장치 등록 직후 네트워크 인터페이스가 활성화될 경우 NULL 포인터 역참조로 인한 커널 경고 또는 시스템 오류가 발생할 수 있습니다.
💡 쉬운 설명
네트워크 카드가 준비되기도 전에 컴퓨터가 네트워크를 사용하려고 시도할 때 발생하는 오류입니다. 이 과정에서 시스템이 준비되지 않은 정보를 참조하려다 프로그램이 멈추거나 오류가 날 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
net: ethernet: mtk_eth_soc: allocate dummy netdev sooner
The RX rings and the shared NAPI are carried by an internal "dummy" netdev
(eth->dummy_dev). mtk_probe() creates that dummy device, and adds the
shared tx/rx NAPI to it, only after the MAC netdevs have been registered.
That order has been there since the MT7623 support was added and leaves a
window in which the netdevs are visible to the network core before the
shared NAPI and the dummy device exist.
If anything brings the first netdev up during that window (e.g. netifd
opening the WAN link the instant the interface is registered), the
first-open path runs without them. On NETSYS v2 and later SoCs
mtk_rx_alloc() -> __xdp_rxq_info_reg() then dereferences eth->dummy_dev ==
NULL:
WARNING: CPU: ... Missing net_device from driver
in net/core/xdp.c and mtk_open() fails with -ENODEV. On NETSYS v1 SoCs
(MT7621/MT7622/MT7623/MT7629) there is no page pool, so the same open
instead calls napi_enable() on a napi_struct that netif_napi_add() has not
initialised yet and dereferences a NULL napi->dev.
Allocate the dummy netdev and add the shared tx/rx NAPI to it before the
register_netdev() loop. Both the dummy-allocation failure and a
register_netdev() failure now unwind through mtk_unreg_dev(), which
unregisters the net_device notifiers and the netdevs registered so far,
stopping a concurrently-opened netdev (ndo_stop) and its NAPI before the
dummy carrier is freed.
A netdev that opened during the window can also have queued the
frame-engine reset worker (via the tx watchdog or phylink), so the probe
error path now cancels eth->pending_work before freeing the shared state,
as mtk_cleanup() already does on remove.
📍 영향받는 시스템
Linux kernel (MediaTek mtk_eth_soc 드라이버를 사용하는 MT7621, MT7622, MT7623, MT7629 및 NETSYS v2 이상 SoC 기반 시스템)
⚔️ 공격 벡터
로컬 공격자가 네트워크 인터페이스가 등록되는 즉시 인터페이스를 활성화(up)시켜 커널 오류를 유도하는 방식
🛡️ 대응 방법
해당 취약점이 수정된 최신 Linux 커널 버전으로 업데이트하여 dummy netdev와 NAPI가 장치 등록 전에 생성되도록 조치해야 합니다.
🔧 검증 코드
현재 실행 중인 커널 버전을 확인하여 해당 취약점이 패치된 버전인지 확인합니다.