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

From: Michael Grzeschik

Date: Wed Nov 11 2026 - 17:07:32 EST


Hi John

On 2026-11-11 4:35 PM, John Ernberg wrote:
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/

Damn, I really should have checked the usb list better before sending my change.
Please lets use your change then. I will just send my Reviewed-by and push for your contribution.

So please ignore this mail.

Thanks,
Michael

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature