From: Simon Horman <horms@kernel.org>
To: Zhao Feng <zhaofeng2@cmss.chinamobile.com>
Cc: netdev@vger.kernel.org, krzysztof.kozlowski@linaro.org,
linux-kernel@vger.kernel.org,
syzbot+1c5368988052dc2d8201@syzkaller.appspotmail.com,
stable@vger.kernel.org
Subject: Re: [PATCH v2 2/2] nfc: pn533: add timeout to USB frame send completion wait
Date: Wed, 28 Oct 2026 15:40:59 +0000 [thread overview]
Message-ID: <20261028154059.GZ257209@horms.kernel.org> (raw)
In-Reply-To: <20261027070136.1339-3-zhaofeng2@cmss.chinamobile.com>
On Tue, Oct 27, 2026 at 03:01:35PM +0800, Zhao Feng wrote:
> pn533_usb_send_frame() waits unboundedly for the out URB to complete.
> A device that never completes the transfer makes the task sleep
> forever in TASK_UNINTERRUPTIBLE while holding the command mutex, as
> reported by syzbot (hung task in pn533_usb_send_frame).
>
> Use a 1 second timeout instead. On timeout, kill the URB and return
> -ETIMEDOUT so the command in progress fails gracefully instead of
> hanging the task.
>
> The transfer may complete between the timeout expiring and
> usb_kill_urb(); in that case urb->status is 0 after the kill and the
> send proceeds normally instead of reporting a spurious failure,
> mirroring what usb_start_wait_urb() does.
>
> Fixes: 9dab880d675b ("nfc: pn533: Wait for out_urb's completion in pn533_usb_send_frame()")
> Reported-by: syzbot+1c5368988052dc2d8201@syzkaller.appspotmail.com
> Closes: https://syzbot.org/bug?extid=1c5368988052dc2d8201
> Signed-off-by: Zhao Feng <zhaofeng2@cmss.chinamobile.com>
> Cc: <stable@vger.kernel.org>
> ---
> v2: check urb->status after killing the URB on timeout and carry on if
> the transfer completed in the race window; add Fixes tag and Cc
> stable; the pn533_wq_cmd() error handling fix is now patch 1/2.
> Issues reported by the Sashiko AI review.
Reviewed-by: Simon Horman <horms@kernel.org>
prev parent reply other threads:[~2026-10-28 15:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-27 7:01 [PATCH v2 0/2] nfc: pn533: fix hung task on stalled USB send Zhao Feng
2026-10-27 7:01 ` [PATCH v2 1/2] nfc: pn533: complete failed queued commands and keep queue moving Zhao Feng
2026-10-28 15:40 ` Simon Horman
2026-10-29 2:02 ` Zhao Feng
2026-10-27 7:01 ` [PATCH v2 2/2] nfc: pn533: add timeout to USB frame send completion wait Zhao Feng
2026-10-28 15:40 ` Simon Horman [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=20261028154059.GZ257209@horms.kernel.org \
--to=horms@kernel.org \
--cc=krzysztof.kozlowski@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=syzbot+1c5368988052dc2d8201@syzkaller.appspotmail.com \
--cc=zhaofeng2@cmss.chinamobile.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®