fix(exploit): Add retry limits to unbounded exploit loops

Setup stage and spray stall loops now bail after MAX_SETUP_RETRIES
(50) and MAX_STALL_RETRIES (100) attempts respectively, preventing
infinite hangs on unresponsive devices.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
tr4m0ryp 2026-04-05 03:53:02 +02:00
parent a810516aff
commit c5d65e823c
3 changed files with 61 additions and 12 deletions

View file

@ -223,8 +223,9 @@ int checkm8_usb_request_leak(libusb_device_handle *usb);
* checkm8_stall -- Repeatedly send GET_DESCRIPTOR with variable abort
* timeout until the device responds with a short transfer and a
* successful leak request. Matches gaster's checkm8_stall().
* Returns 0 on success, -1 if MAX_STALL_RETRIES is exceeded.
*/
void checkm8_stall(libusb_device_handle *usb);
int checkm8_stall(libusb_device_handle *usb);
/*
* checkm8_no_leak -- Async GET_DESCRIPTOR with 1ms timeout and