Re: [PATCH 2/2] usbip: identify the event handler with current_work()

From: John Ernberg

Date: Wed Nov 11 2026 - 10:58:38 EST


Hi Michael,

On 11/11/2026 12:34, Michael Grzeschik wrote:
usbip_in_eh() compares the task with worker_context, the first worker
that ever ran the event handler. Workers of the unbound usbip_event
workqueue are reaped when idle and new ones run the handler later, so the
check fails inside the event handler, and the remembered task_struct may
be reused by any other task, which then wrongly counts as the event
handler. stub_disconnect() relies on it to skip the shutdown of a device
reset from the event handler.

Ask the workqueue which work item the current task executes instead.

Signed-off-by: Michael Grzeschik <grzeschik@xxxxxxxxx>

We sent a similar patch back in August that we forgot to follow up on. [1]

Reviewed-by: John Ernberg <john.ernberg@xxxxxxxx>

[1]: https://lore.kernel.org/linux-usb/20260803104342.2790105-1-john.ernberg@xxxxxxxx/

Thanks! // John Ernberg