Re: [PATCH] usb: gadget: printer: clear current RX request on unbind

0 views
Skip to first unread message

Greg Kroah-Hartman

unread,
Oct 24, 2026, 2:09:32 AM (yesterday) Oct 24
to Elliot Alderson, linu...@vger.kernel.org, linux-...@vger.kernel.org, syzbot+ffc483...@syzkaller.appspotmail.com, syzkall...@googlegroups.com
On Sat, Oct 24, 2026 at 03:51:46PM +1000, Elliot Alderson wrote:
> printer_func_unbind() frees current_rx_req but leaves the pointer in
> printer_dev. A later unbind can then pass the stale pointer to
> printer_req_free() again. Clear the saved request and its associated read
> state before freeing it.
>
> Fixes: b185f01a9ab7 ("usb: gadget: printer: factor out f_printer")
> Reported-by: syzbot+ffc483...@syzkaller.appspotmail.com
> Link: https://syzkaller.appspot.com/bug?extid=ffc483dc87891d3c107b
> Signed-off-by: Eduard Zateev <hacker...@gmail.com>
> ---
> drivers/usb/gadget/function/f_printer.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/gadget/function/f_printer.c
> b/drivers/usb/gadget/function/f_printer.c
> index 1857d786110..11471bd065c 100644
> --- a/drivers/usb/gadget/function/f_printer.c
> +++ b/drivers/usb/gadget/function/f_printer.c
> @@ -1462,8 +1462,11 @@ static void printer_func_unbind(struct
> usb_configuration *c,
> printer_req_free(dev->in_ep, req);
> }
>
> - if (dev->current_rx_req != NULL)
> - printer_req_free(dev->out_ep, dev->current_rx_req);
> + req = dev->current_rx_req;
> + dev->current_rx_req = NULL;
> + dev->current_rx_bytes = 0;
> + dev->current_rx_buf = NULL;
> + printer_req_free(dev->out_ep, req);
>
> while (!list_empty(&dev->rx_reqs)) {
> req = container_of(dev->rx_reqs.next,
> --
> 2.55.0

Hi,

This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him
a patch that has triggered this response. He used to manually respond
to these common problems, but in order to save his sanity (he kept
writing the same thing over and over, yet to different people), I was
created. Hopefully you will not take offence and will fix the problem
in your patch and resubmit it so that it can be accepted into the Linux
kernel tree.

You are receiving this message because of the following common error(s)
as indicated below:

- You have marked a patch with a "Fixes:" tag for a commit that is in an
older released kernel, yet you do not have a cc: stable line in the
signed-off-by area at all, which means that the patch will not be
applied to any older kernel releases. To properly fix this, please
follow the documented rules in the
Documentation/process/stable-kernel-rules.rst file for how to resolve
this.

If you wish to discuss this problem further, or you have questions about
how to resolve this issue, please feel free to respond to this email and
Greg will reply once he has dug out from the pending patches received
from other developers.

thanks,

greg k-h's patch email bot

Elliot Alderson

unread,
Oct 24, 2026, 1:17:51 PM (yesterday) Oct 24
to Greg Kroah-Hartman, linu...@vger.kernel.org, linux-...@vger.kernel.org, syzbot+ffc483...@syzkaller.appspotmail.com, syzkall...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages