mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Oliver Neukum <oneukum@suse.com>
To: Alan Stern <stern@rowland.harvard.edu>,
	syzbot <syzbot+25ba18e2c5040447585d@syzkaller.appspotmail.com>
Cc: greearb@candelatech.com, hdanton@sina.com,
	linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
	michal.pecio@gmail.com, oneukum@suse.com,
	syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] [usb?] INFO: task hung in usb_bulk_msg (2)
Date: Mon, 9 Feb 2026 11:03:09 +0100	[thread overview]
Message-ID: <8e1c7ac5-e076-44b0-84b8-1b34b20f0ae1@suse.com> (raw)
In-Reply-To: <0b508f72-7248-479c-ad26-b9385e52c094@rowland.harvard.edu>

On 09.02.26 02:26, Alan Stern wrote:

> +	expire = (timeout > 0) ? msecs_to_jiffies(timeout) :
> +			MAX_SCHEDULE_TIMEOUT;
> +	if (expire <= msecs_to_jiffies(MAX_UNINTERRUPTIBLE_TIMEOUT_MS))
> +		rc = (wait_for_completion_timeout(&ctx.done, expire) > 0);
> +	else
> +		rc = (wait_for_completion_interruptible_timeout(
> +				&ctx.done, expire) > 0);
> +	if (!rc) {
>   		usb_kill_urb(urb);
>   		retval = (ctx.status == -ENOENT ? -ETIMEDOUT : ctx.status);

Hi,

is this a proof of concept or a test of the real fix?

I am afraid this is highly problematic.

1. You'll hit every user of the API. These are probably not ready to handle signals. This includes usb_bulk_message() and the interrupt version.
2. wait_for_completion_interruptible_timeout() reacts to _any_ signal. Do you really want to abort for SIGIO or SIGWINCH right after urb submission?
3. The error handling is broken. You cannot tell a true timeout and a signal apart.

It seems to me that really want a clean API introducing usb_X_message_killable()

	Regards
		Oliver

  


      parent reply	other threads:[~2026-02-09 10:03 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-08  6:34 syzbot
2026-02-08  8:55 ` Hillf Danton
2026-02-08 14:47   ` Alan Stern
2026-02-08 15:03     ` syzbot
2026-02-08 15:17       ` Alan Stern
2026-02-08 15:17         ` syzbot
2026-02-08 15:19           ` Alan Stern
2026-02-08 15:50             ` syzbot
2026-02-08 20:10               ` Alan Stern
2026-02-08 20:10                 ` syzbot
2026-02-08 20:13                   ` Alan Stern
2026-02-08 20:34                     ` syzbot
2026-02-08 21:32                       ` Alan Stern
2026-02-08 21:53                         ` syzbot
2026-02-09  1:26                           ` Alan Stern
2026-02-09  1:46                             ` syzbot
2026-02-09 16:34                               ` Alan Stern
2026-02-09 17:30                                 ` syzbot
2026-02-13 21:30                                   ` Alan Stern
2026-02-13 21:49                                     ` syzbot
2026-02-09 10:03                             ` Oliver Neukum [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=8e1c7ac5-e076-44b0-84b8-1b34b20f0ae1@suse.com \
    --to=oneukum@suse.com \
    --cc=greearb@candelatech.com \
    --cc=hdanton@sina.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=michal.pecio@gmail.com \
    --cc=stern@rowland.harvard.edu \
    --cc=syzbot+25ba18e2c5040447585d@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.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®