Zephyr саусақ ізі сенсоры драйверінде қашықтан код орындау
Zephyr
Қысқаша
Zephyr жүйесінде Grow R502-A саусақ ізі сенсорының драйвері қабылдау күту уақыты аяқталғаннан кейін стек буферіне сілтемені сақтайды, сондықтан кешіккен UART байттары ағын қайта пайдаланған стек жадына жазылуы мүмкін. Саусақ ізі модулін ауыстыратын немесе оның атынан әрекет ететін физикалық қолжетімділігі бар шабуылдаушы жүйеге кірмей және пайдаланушы әрекетінсіз осыны тудырып, шабуылдаушы таңдаған байттарды жаза алады, бұл құрылғыны істен шығарып, басқару ағынын басып алуға мүмкіндік беруі ықтимал.
Түйіндемені дереккөздер негізінде ЖИ жасаған және ол автоматты түрде аударылған.
Түзету
Түзетілген нұсқалар: 4.3.24.5.0
Зардап шегетін нұсқалар
| zephyr | бастап 3.7.0 → түзетілді 4.3.2 бастап 4.4.0 → түзетілді 4.5.0 |
Түпнұсқа сипаттама (EN)
Түпнұсқа тақырып: Zephyr remote code execution in fingerprint sensor driver
The Grow R502-A fingerprint sensor driver (drivers/sensor/grow_r502a/grow_r502a.c) points drv_data->rx_buf.data at an rx_packet buffer on the caller's stack and enables the UART RX interrupt before waiting 1500 ms for a reply. When the wait timed out, transceive_packet() returned -ETIMEDOUT but left the RX interrupt enabled and rx_buf.data still pointing at the caller's buffer. Once the caller's frame has returned, any bytes that arrive late on the UART are written by the interrupt handler uart_cb_handler() through the dangling pointer into stack memory that the thread has since reused. The bytes come from the device on the other end of the UART. An attacker with physical access who replaces or impersonates the fingerprint module can trigger this by delaying a reply past the timeout and then sending a packet. A slow or faulty genuine module can also trigger it by accident. The result is a write of attacker-chosen bytes into a live thread stack. The write length comes from the header of the late packet. Commit 96968fac22b, which landed together with this fix, bounds it to a header plus CONFIG_R502A_DATA_PKT_SIZE bytes; affected releases do not have that bound. This can crash the device and may allow control-flow hijacking, depending on what occupies the reused stack region. The fix disables the RX interrupt, resets the RX semaphore and clears rx_buf.data on timeout, and the interrupt handler now refuses to write when no receive buffer is armed.