🇰🇷 한글 설명
Linux 커널의 mxl862xx 드라이버에서 MDIO CRC 오류 발생 시 DSA 포트를 순회하며 CPU 포트 통로를 닫는 과정에서 Use-After-Free 취약점이 발견되었습니다. 장치 제거 과정에서 스위치가 등록 해제되기 전에 작업이 취소되지 않아, 이미 해제된 메모리 영역에 접근할 수 있는 문제가 있습니다.
💡 쉬운 설명
장치를 제거하는 도중에 오류가 발생하면, 이미 사라진 부품의 정보를 다시 읽으려고 시도하여 시스템이 충돌하거나 보안 문제가 생길 수 있는 오류입니다. 이를 방지하기 위해 장치가 꺼지는 중인지 확인하는 안전장치가 필요합니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
net: dsa: mxl862xx: fix use-after-free of DSA ports in crc_err_work
Upon an MDIO CRC error mxl862xx_crc_err_work_fn() walks the DSA ports
and closes the CPU port conduits:
dsa_switch_for_each_cpu_port(dp, priv->ds)
dev_close(dp->conduit);
mxl862xx_remove() unregisters the switch before cancelling this work:
set_bit(MXL862XX_FLAG_WORK_STOPPED, &priv->flags);
cancel_delayed_work_sync(&priv->stats_work);
dsa_unregister_switch(ds);
mxl862xx_host_shutdown(priv);
dsa_unregister_switch() frees the dsa_port objects. If a CRC error
schedules the work during teardown it can run after the ports have been
freed and dereference freed memory.
Guard the port walk with MXL862XX_FLAG_WORK_STOPPED, which is already set
before dsa_unregister_switch(). DSA tears the ports down under
rtnl_lock(), so checking the flag under rtnl_lock() means the work either
runs before teardown and sees valid ports, or runs afterwards, observes
the flag and skips the walk. This mirrors the host_flood_work handler,
which skips torn-down ports under rtnl_lock().
📍 영향받는 시스템
Linux kernel (mxl862xx driver components)
⚔️ 공격 벡터
MDIO CRC 오류를 유도하여 장치 제거(teardown) 과정 중 메모리 참조 오류를 발생시킴
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 MXL862XX_FLAG_WORK_STOPPED 플래그 검증 로직을 적용해야 함
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 패치 버전 이후인지 확인하십시오.