From 5a2494d63e1c815d754712903286fbc85d7dc7d3 Mon Sep 17 00:00:00 2001 From: debian Date: Sun, 29 Nov 2026 12:50:20 -0300 Subject: [PATCH] fix(checkm8): treat a DNLOAD timeout in stage 1 as delivered, not failed usbipd drops the STATUS ACK of a DNLOAD, so the transfer reports TIMEOUT although the device consumed every byte; send_dfu_finalize() and send_payload_chunks() already rely on that. The new exact-length check treated TIMEOUT as a hard error, which would have failed stage 1 on usbipd -- the transport the stage was rewritten for. --- src/exploit/checkm8_stages.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/exploit/checkm8_stages.c b/src/exploit/checkm8_stages.c index bf8968d..29bb63b 100644 --- a/src/exploit/checkm8_stages.c +++ b/src/exploit/checkm8_stages.c @@ -333,6 +333,18 @@ static int stage1_dnload_exact(libusb_device_handle *usb, uint16_t len) free(buf); if (ret < 0) { + /* + * On usbipd the STATUS ACK of a DNLOAD is dropped and surfaces as + * TIMEOUT even though the device consumed every byte; + * send_dfu_finalize() and send_payload_chunks() rely on the same + * property, so a TIMEOUT is not a failed transfer. Failing here + * would break stage 1 on the one transport that needs it most. + */ + if (ret == LIBUSB_ERROR_TIMEOUT) { + log_warn("stage1_dnload_exact: DNLOAD(%u) timed out after " + "sending the block -- continuing", len); + return 0; + } log_error("stage1_dnload_exact: DNLOAD(%u) failed: %s", len, libusb_strerror(ret)); return -1;