🇰🇷 한글 설명
Linux 커널의 dpaa2-switch 드라이버에서 펌웨어로부터 받은 num_ifs 값을 DPSW_MAX_IF(64) 범위로 검증하지 않아 발생하는 버퍼 오버플로우 취약점입니다. dpaa2_switch_fdb_get_flood_cfg() 함수에서 고정 크기 배열을 초과하는 쓰기가 발생할 수 있으며, 특히 모든 포트가 플러드 필터와 일치할 경우 제어 인터페이스 쓰기로 인한 1바이트 오버플로우가 발생합니다.
💡 쉬운 설명
Linux 시스템의 네트워크 스위치 드라이버가 펌웨어로부터 잘못된 값을 받아 메모리 범위를 침범하는 문제입니다. 이를 통해 시스템 데이터 손상이나 권한 상승을 유발할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
dpaa2-switch: validate num_ifs to prevent out-of-bounds write
The driver obtains sw_attr.num_ifs from firmware via dpsw_get_attributes()
but never validates it against DPSW_MAX_IF (64). This value controls
iteration in dpaa2_switch_fdb_get_flood_cfg(), which writes port indices
into the fixed-size cfg->if_id[DPSW_MAX_IF] array. When firmware reports
num_ifs >= 64, the loop can write past the array bounds.
Add a bound check for num_ifs in dpaa2_switch_init().
dpaa2_switch_fdb_get_flood_cfg() appends the control interface (port
num_ifs) after all matched ports. When num_ifs == DPSW_MAX_IF and all
ports match the flood filter, the loop fills all 64 slots and the control
interface write overflows by one entry.
The check uses >= because num_ifs == DPSW_MAX_IF is also functionally
broken.
build_if_id_bitmap() silently drops any ID >= 64:
if (id[i] < DPSW_MAX_IF)
bmap[id[i] / 64] |= ...
📍 영향받는 시스템
Linux kernel의 dpaa2-switch 드라이버 탑재 시스템 (ARM/PowerPC 기반 NXP 디바이스)
⚔️ 공격 벡터
악의적인 펌웨어 수정으로 num_ifs >= 64 값 전달하여 버퍼 오버플로우 유발
🛡️ 대응 방법
커널 업데이트하여 dpaa2_switch_init()의 num_ifs 범위 검증 패치 적용
🔧 검증 코드
dpaa2_switch 드라이버의 버전을 확인하여 취약점 패치가 적용된 최신 버전으로 업데이트되었는지 확인합니다. 드라이버가 로드되지 않았다면 영향을 받지 않는 시스템입니다.
modinfo dpaa2_switch 2>/dev/null | grep -i version || echo 'dpaa2_switch driver not loaded'