diff options
| author | 2026-09-15 20:54:30 -0400 | |
|---|---|---|
| committer | 2026-11-24 10:18:05 -0500 | |
| commit | 5fff1fe02db4a5812901fed9643b6f79a5fb02fd (patch) | |
| tree | f3507f996045e0fe4134e811034d9b75570e7025 /COPYING | |
| parent | 4b50afb9963076a3218aec368ae9906f94345569 (diff) | |
| download | libirecovery-5fff1fe02db4a5812901fed9643b6f79a5fb02fd.tar.gz libirecovery-5fff1fe02db4a5812901fed9643b6f79a5fb02fd.tar.bz2 | |
Fix use-after-free, leak and hang in libusb async-cancel transfer
irecv_async_usb_control_transfer_with_cancel()'s libusb path:
- freed the setup buffer after libusb_cancel_transfer(), while the
transfer could still be in flight, even though
LIBUSB_TRANSFER_FREE_BUFFER had already handed it to libusb;
- never called libusb_free_transfer(), leaking the transfer on every
call;
- waited for ret == LIBUSB_TRANSFER_CANCELLED, which never happens if
the transfer completes before the cancel lands.
libusb now owns the buffer and frees it in libusb_free_transfer(), which
runs on every path. async_cb sets a completed flag, which the wait
passes to libusb_handle_events_completed(). LIBUSB_ERROR_NOT_FOUND from
libusb_cancel_transfer() only means the transfer already finished, so
it is no longer returned as an error.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'COPYING')
0 files changed, 0 insertions, 0 deletions
