mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Keisuke Tsukuda <catnyaaan@outlook.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Alan Stern <stern@rowland.harvard.edu>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"syzbot+a83a5a1ba9ff57935171@syzkaller.appspotmail.com"
	<syzbot+a83a5a1ba9ff57935171@syzkaller.appspotmail.com>,
	"syzbot+d31109047baed8f3b590@syzkaller.appspotmail.com"
	<syzbot+d31109047baed8f3b590@syzkaller.appspotmail.com>,
	Keisuke Tsukuda <catnyaaan@outlook.com>
Subject: [PATCH v2 0/2] usb: gadget: avoid warnings during configuration transitions
Date: Tue, 8 Sep 2026 20:33:52 +0000	[thread overview]
Message-ID: <20260908203348.95825-1-tkdkei@outlook.jp> (raw)

Rapidly alternating SET_CONFIGURATION requests can overtake the
mass-storage function's asynchronous configuration work. This exposes two
states that are handled safely but currently produce kernel warnings: a
delayed-status completion after reset_config() cleared its counter, and a
class request while common->fsg is not installed.

The first patch keeps the obsolete completion as a dynamic-debug
diagnostic. The second avoids the warning only in fsg_setup(), where the
request is already rejected with -EOPNOTSUPP; warnings in other internal
f_mass_storage paths remain unchanged.

Both reports reproduce on an ARM64 Ubuntu 6.8 VM using dummy_hcd. With both
patches loaded, five 10-second, four-thread runs produced no WARNING, BUG,
or Oops. In a separate run, a kprobe observed five calls to
usb_composite_setup_continue() with delayed_status == 0 while the target
warning remained absent.

syzbot tested the v1 code on usb-testing commit
edc1518454f6439e50a9220e9a3ba09044ea8d8b and reported OK after a
50-minute run:

https://syzkaller.appspot.com/bug?extid=a83a5a1ba9ff57935171

Changes in v2:
- Add a comment in fsg_setup() explaining why fsg_is_set() must not be
  used for this check, as requested by Alan Stern.
- No executable code changes; patch 1 is unchanged.

Keisuke Tsukuda (2):
  usb: gadget: composite: avoid warning on aborted delayed status
  usb: gadget: f_mass_storage: ignore class requests while inactive

 drivers/usb/gadget/composite.c               | 2 +-
 drivers/usb/gadget/function/f_mass_storage.c | 7 ++++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

-- 
2.50.1 (Apple Git-155)

             reply	other threads:[~2026-09-08 20:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-08 20:33 Keisuke Tsukuda [this message]
2026-09-08 20:33 ` [PATCH v2 1/2] usb: gadget: composite: avoid warning on aborted delayed status Keisuke Tsukuda
2026-09-08 20:33 ` [PATCH v2 2/2] usb: gadget: f_mass_storage: ignore class requests while inactive Keisuke Tsukuda
2026-09-09  1:49   ` Alan Stern

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=20260908203348.95825-1-tkdkei@outlook.jp \
    --to=catnyaaan@outlook.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    --cc=syzbot+a83a5a1ba9ff57935171@syzkaller.appspotmail.com \
    --cc=syzbot+d31109047baed8f3b590@syzkaller.appspotmail.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®