From: Simon Horman <horms@kernel.org>
To: Matvey Valigura <valigurasm@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Chas Williams <3chas3@gmail.com>,
Duncan Sands <duncan.sands@free.fr>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
netdev@vger.kernel.org,
syzbot+9ca2c9f85bd8b5e46516@syzkaller.appspotmail.com,
stable@vger.kernel.org
Subject: Re: [PATCH] usb: atm: use request_firmware_direct() for firmware probing
Date: Tue, 29 Sep 2026 15:27:17 +0100 [thread overview]
Message-ID: <20260929142717.GV13925@horms.kernel.org> (raw)
In-Reply-To: <20260924050654.15347-1-valigurasm@gmail.com>
On Thu, Sep 24, 2026 at 08:06:54AM +0300, Matvey Valigura wrote:
> When disconnecting a device while firmware is not present on the system,
> usbatm_usb_disconnect() waits for the heavy_init thread to finish:
> wait_for_completion(&instance->thread_exited);
>
> If CONFIG_FW_LOADER_USER_HELPER_FALLBACK is enabled, missing firmware
> causes request_firmware() to fall back to sysfs/udevd. This creates a
> circular dependency during disconnect:
> 1. usb_disconnect() holds device_lock(&udev->dev).
> 2. usbatm_usb_disconnect() waits for instance->thread to exit.
> 3. instance->thread waits for request_firmware() sysfs fallback.
> 4. udevd receives the firmware uevent and attempts to read sysfs
> attributes (e.g. serial), blocking on device_lock(&udev->dev).
>
> Furthermore, the fallback wait uses wait_for_completion_killable_timeout(),
> which ignores the non-fatal SIGTERM signal sent by usbatm_usb_disconnect().
> Because speedtch and cxacru probe multiple candidate firmware files
> sequentially, each file stalls for the 60-second fallback timeout,
> triggering hung task timeouts (>120s) reported by syzbot.
>
> Switch to request_firmware_direct() to probe firmware files directly from
> the filesystem without falling back to user-mode helper.
>
> Reported-by: syzbot+9ca2c9f85bd8b5e46516@syzkaller.appspotmail.com
> Closes: https://syzkaller.appspot.com/bug?extid=9ca2c9f85bd8b5e46516
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> Cc: stable@vger.kernel.org
> Signed-off-by: Matvey Valigura <valigurasm@gmail.com>
> ---
> drivers/usb/atm/cxacru.c | 2 +-
> drivers/usb/atm/speedtch.c | 6 +++---
> 2 files changed, 4 insertions(+), 4 deletions(-)
I am assuming that in practice users do not load firmware for these devices
from user-space.
Reviewed-by: Simon Horman <horms@kernel.org>
next prev parent reply other threads:[~2026-09-29 14:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-24 5:06 Matvey Valigura
2026-09-29 14:27 ` Simon Horman [this message]
2026-09-29 23:50 ` patchwork-bot+netdevbpf
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=20260929142717.GV13925@horms.kernel.org \
--to=horms@kernel.org \
--cc=3chas3@gmail.com \
--cc=duncan.sands@free.fr \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=syzbot+9ca2c9f85bd8b5e46516@syzkaller.appspotmail.com \
--cc=valigurasm@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®