xairy / raw-gadget

USB Raw Gadget — a low-level interface for the Linux USB Gadget subsystem
333 stars 35 forks source link

Support O_NONBLOCK I/O #59

Open xairy opened 7 months ago

xairy commented 7 months ago

Right now, every Raw Gadget endpoint read/write ioctl submits a USB request and waits until its completion. This is done deliberately to assist with coverage-guided fuzzing by having a single syscall fully process a single USB request.

However, for other use cases, we might want to have a non-blocking operation mode, where Raw Gadget would not wait until the completion of each USB request. The original blocking mode must still be kept in the implementation.

This issue is also mentioned in the kernel documentation.