🇰🇷 한글 설명
DesignWare SPI 드라이버가 설정된 주파수 값을 검증하지 않아 발생하는 0으로 나누기(Divide-by-Zero) 취약점입니다. 사용자 공간의 스레드가 주파수를 0으로 설정하여 SPI 통신을 요청할 경우, 커널에서 예외가 발생하여 시스템이 중단될 수 있습니다.
💡 쉬운 설명
장치에 명령을 내릴 때 주파수 값을 0으로 잘못 입력하면 컴퓨터가 계산을 못 하고 멈춰버리는 문제입니다. 권한이 있는 사용자가 이 값을 조작하면 시스템 전체를 마비시킬 수 있습니다.
🇺🇸 원문 (English)
The DesignWare SPI driver (drivers/spi/spi_dw.c) computed the SPI BAUDR clock divider as info->clock_frequency / config->frequency without validating config->frequency.
spi_transceive is a Zephyr __syscall and its verify handler (drivers/spi/spi_handlers.c) copies the caller-supplied spi_config from userspace without checking the frequency field, so a userspace thread that has been granted access to a DesignWare SPI device kernel object can pass frequency = 0 and trigger an unsigned integer divide-by-zero in spi_dw_configure().
On Cortex-M Mainline (SCB->CCR.DIV_0_TRP is set in z_arm_fault_init()) and on ARC (a dedicated __ev_div_zero vector) this raises a CPU exception, resulting in a kernel fault and local denial of service.
The fix rejects zero frequency and frequencies above clock_frequency / 2 (the DesignWare SSI databook minimum SCKDIV of 2) with -EINVAL. The defect affects all Zephyr releases up to and including v4.4.0; exploitation requires CONFIG_USERSPACE=y and an unprivileged thread already granted SPI driver permission. There is no memory-corruption or information-disclosure impact.
📍 영향받는 시스템
Zephyr RTOS v4.4.0 및 그 이전의 모든 버전 (CONFIG_USERSPACE=y 설정 시)
⚔️ 공격 벡터
SPI 장치 접근 권한을 가진 비특권 스레드가 주파수(frequency) 값을 0으로 설정하여 spi_transceive 시스템 콜 호출
🛡️ 대응 방법
주파수 값이 0이거나 허용 범위를 벗어날 경우 -EINVAL를 반환하도록 드라이버 코드 수정 및 최신 버전 업데이트
🔧 검증 코드
출력된 버전이 v4.4.0 이하이면 해당 취약점에 노출된 상태입니다.
zephyr-sdk-version | grep -E 'v[0-9]+\.[0-9]+\.[0-9]+' | awk '$1 <= "v4.4.0"'
📊 CVSS Vector String
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:L
💻 영향받는 소프트웨어
IBM Security Verify Access