🇰🇷 한글 설명
Broadcom AFBR-S50 거리 센서 드라이버에서 센서 데이터 평가가 실패할 때 RTIO 요청이 두 번 완료 처리되는 결함입니다. 오류 분기가 return 없이 함수 끝으로 떨어지면서 같은 구조체가 rtio_iodev_sqe_err()와 rtio_iodev_sqe_ok()로 이중 해제되어 메모리 풀 손상과 가용성 저하를 일으킵니다.
💡 쉬운 설명
센서가 잘못된 데이터를 받았을 때 하나의 요청이 두 번 처리되어 메모리 관리 정보가 꼬입니다. 그 결과 기기가 오작동하거나 멈출 수 있습니다.
🇺🇸 원문 (English)
The Broadcom AFBR-S50 time-of-flight sensor driver double-completes an RTIO submission when sensor data evaluation fails. In data_ready_work_handler() (drivers/sensor/broadcom/afbr_s50/afbr_s50.c), a non-STATUS_OK return from Argus_EvaluateData() calls handle_error_on_result(), which finalises the request with rtio_iodev_sqe_err(), but execution then fell through to the tail of the function and finalised the very same struct rtio_iodev_sqe a second time with rtio_iodev_sqe_ok(). Unlike the other error branches in the same function, this one did not return.
Both completion helpers reach rtio_executor_done() in subsys/rtio/rtio_executor.c, which returns the submission to the pool via rtio_sqe_pool_free() and, for streaming (multishot) submissions, also releases the RX buffer with rtio_release_buffer(). The second completion therefore reads a freed rtio_iodev_sqe, pushes the same mpsc node onto the submission queue while it is already on the pool free list — splicing the two lists together — and re-submits the freed request so the next measurement is written through an already-released buffer. For one-shot submissions it emits a spurious success completion carrying stale userdata and frees the same pool entry twice.
The failure branch is driven by sensor conditions rather than by host software. The vendor API documents statuses such as ERROR_ARGUS_BIAS_VOLTAGE_REINIT and ERROR_ARGUS_LASER_MONITOR_INACTIVE as transient results of harsh ambient light, so a party in front of the optical sensor can provoke the invalid-data condition without any physical contact with the board or any software access; SPI transfer errors reach the same branch. In releases before the payload.Status check was dropped, ordinary sharp distance transitions in the sensor's field of view were sufficient.
Impact is corruption of the RTIO submission pool and mempool bookkeeping: aliased submissions, writes through released buffers, and duplicate completions delivered to the application. The attacker does not control the corrupted content, so the practical consequence is memory corruption and loss of availability on devices that instantiate brcm,afbr-s50, rather than directed code execution. Only builds that enable this driver are affected.
📍 영향받는 시스템
Zephyr RTOS에서 brcm,afbr-s50 드라이버를 활성화한 빌드 (패치 이전 버전)
⚔️ 공격 벡터
센서 시야 앞에서 강한 주변광이나 급격한 거리 변화를 만들어 일시적 센서 오류를 유발하면 공격자가 기기에 직접 접근하지 않고도 조건을 재현할 수 있습니다.
🛡️ 대응 방법
Zephyr 프로젝트의 수정 커밋을 적용하여 오류 분기에 return을 추가하거나 상위 버전으로 업데이트하고, 해당 드라이버를 사용하지 않는다면 비활성화합니다.
🔧 검증 코드
출력이 없으면 해당 드라이버 소스가 없는 것이므로 영향 없음이고, 파일이 존재하면 data_ready_work_handler 내 오류 분기에 return이 있는지 직접 확인해야 합니다.
grep -rn "AFBR_S50\|afbr_s50" $ZEPHYR_BASE/drivers/sensor/broadcom/afbr_s50/afbr_s50.c 2>/dev/null | head -5