mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mike Isely <isely@isely.net>
To: Szymon Wilczek <szymonwilczek@gmx.com>
Cc: mchehab@kernel.org, linux-media@vger.kernel.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	syzkaller-bugs@googlegroups.com,
	syzbot+405dcd13121ff75a9e16@syzkaller.appspotmail.com,
	Mike Isely at pobox <isely@pobox.com>
Subject: Re: [PATCH] media: pvrusb2: fix URB leak in pvr2_send_request_ex
Date: Sat, 20 Dec 2025 14:03:56 -0600 (CST)	[thread overview]
Message-ID: <c3ced43d-ca75-b4eb-96d2-9629f6e1f112@isely.net> (raw)
In-Reply-To: <20251220182419.390675-1-szymonwilczek@gmx.com>


Acked-By: Mike Isely <isely@pobox.com>

On Sat, 20 Dec 2025, Szymon Wilczek wrote:

> When pvr2_send_request_ex() submits a write URB successfully but fails to submit the read URB (e.g. returns -ENOMEM), it returns immediately without waiting for the write URB to complete. Since the driver reuses the same URB structure, a subsequent call to pvr2_send_request_ex() attempts to submit the still-active write URB, triggering a 'URB submitted while active' warning in usb_submit_urb().
> 
> Fix this by ensuring the write URB is unlinked and waited upon if the read URB submission fails.
> 
> Reported-by: syzbot+405dcd13121ff75a9e16@syzkaller.appspotmail.com
> 
> Closes: https://syzkaller.appspot.com/bug?extid=405dcd13121ff75a9e16
> Signed-off-by: Szymon Wilczek <szymonwilczek@gmx.com>
> ---
>  drivers/media/usb/pvrusb2/pvrusb2-hdw.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
> index b32bb906a9de..5807734ae26c 100644
> --- a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
> +++ b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
> @@ -3709,6 +3709,11 @@ status);
>  				   "Failed to submit read-control URB status=%d",
>  status);
>  			hdw->ctl_read_pend_flag = 0;
> +			if (hdw->ctl_write_pend_flag) {
> +				usb_unlink_urb(hdw->ctl_write_urb);
> +				while (hdw->ctl_write_pend_flag)
> +					wait_for_completion(&hdw->ctl_done);
> +			}
>  			goto done;
>  		}
>  	}
> 

      reply	other threads:[~2025-12-20 20:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-20 18:24 Szymon Wilczek
2025-12-20 20:03 ` Mike Isely [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c3ced43d-ca75-b4eb-96d2-9629f6e1f112@isely.net \
    --to=isely@isely.net \
    --cc=isely@pobox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=syzbot+405dcd13121ff75a9e16@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    --cc=szymonwilczek@gmx.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®