From: Keisuke Tsukuda <tkdkei@outlook.jp>
To: Saad Varshani <varshanisaad@gmail.com>,
Neill Kapron <nkapron@google.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"syzbot+300213c2b5b55c0244f4@syzkaller.appspotmail.com"
<syzbot+300213c2b5b55c0244f4@syzkaller.appspotmail.com>,
Timo Joannin <timo.joannin@gmail.com>
Subject: Re: [PATCH v7] usb: gadget: uvc: Fix deadlocks in uvcg_configfs attribute callbacks
Date: Wed, 2 Dec 2026 12:58:01 +0000 [thread overview]
Message-ID: <20261202125757.48196-1-tkdkei@outlook.jp> (raw)
In-Reply-To: <20261122013844.4743-1-varshanisaad@gmail.com>
On Sat, Nov 21, 2026 at 17:38:44 -0800, Saad Varshani wrote:
> The deadlock was happening due to a circular mutex dependency between
> configfs (frag_sem) and uvcg_extension su_mutex.
I ran the C reproducer from the syzbot report in an ARM64 QEMU guest
with CONFIG_PROVE_LOCKING=y. The test kernel's uvc_configfs.c matched
the preimage of Timo Joannin's submitted patch. Before that change, the
bmControls write reported a circular locking dependency in
uvcg_extension_bm_controls_store(), and debug_locks changed from 1 to 0.
After applying only that patch, the same reproducer completed without
that warning and debug_locks stayed at 1.
Timo's patch was committed to usb-testing as a3f3e1390f47
("usb: gadget: uvc: remove su_mutex from configfs _show/_store
callbacks"). Most of v7 overlaps it, and v7 no longer applies there.
I also compared the remaining lock changes. The format link callbacks
look up configfs items under su_mutex. The make callbacks run under
su_mutex as well, and their new format objects are not linked into
configfs until they return. Both versions protect the shared color
matching reference counts with opts->lock. I could not identify a
separate race prevented by v7's wider opts->lock scope in those paths.
Is there another reproducer for the wider lock scope? If so, a patch on
top of a3f3e1390f47 with only the remaining change would be easier to
review.
Thanks,
Keisuke
next prev parent reply other threads:[~2026-12-02 12:58 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-05 5:39 [PATCH] usb: gadget: uvc: Fix deadlock in uvcg_extension_bm_controls_store Saad Varshani
2026-11-06 2:07 ` [PATCH v2] usb: gadget: uvc: Fix deadlocks in uvcg_configfs attribute callbacks Saad Varshani
2026-11-06 3:50 ` [PATCH v3] " Saad Varshani
2026-11-06 3:57 ` [PATCH v4] " Saad Varshani
2026-11-07 4:45 ` [PATCH v5] " Saad Varshani
2026-11-07 5:15 ` [PATCH v6] " Saad Varshani
2026-11-20 8:20 ` Greg KH
2026-11-22 1:38 ` [PATCH v7] " Saad Varshani
2026-12-02 12:58 ` Keisuke Tsukuda [this message]
2026-11-20 8:22 ` [PATCH] usb: gadget: uvc: Fix deadlock in uvcg_extension_bm_controls_store Greg KH
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=20261202125757.48196-1-tkdkei@outlook.jp \
--to=tkdkei@outlook.jp \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=nkapron@google.com \
--cc=syzbot+300213c2b5b55c0244f4@syzkaller.appspotmail.com \
--cc=timo.joannin@gmail.com \
--cc=varshanisaad@gmail.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®