From: sashiko-bot@kernel.org
To: "Olivier Kaloudoff" <olivier.kaloudoff@gmail.com>,
linux-usb@vger.kernel.org
Subject: Re: [PATCH v3] usb: uas: validate status URB length before parsing the IU
Date: Wed, 14 Oct 2026 17:04:14 +0000 [thread overview]
Message-ID: <sashiko-outbox-171561@kernel.org> (raw)
In-Reply-To: <20261014165618.33800-1-olivier.kaloudoff@gmail.com>
> uas_stat_cmplt() dereferences iu->tag without verifying that the
> status URB actually carried a full IU header. The transfer buffer
> is a freshly-zeroed sense_iu, so a status URB that completes
> successfully but with a short or empty actual_length — observed in
> the wild during link-level upsets (Thunderbolt-chain xhci blips) and
> on a wedging bridge — reads back as iu_id=0/tag=0 and produces the
> misleading
>
> stat urb: no pending cmd for uas-tag 0
>
> log spam seen e.g. on an ASMT135x enclosure and a Samsung T7, right
> before the affected commands time out into the error handler.
>
> Worse, this is not just log noise: a short packet that happens to
> carry a plausible header is matched to an inflight command, and the
> untouched bytes of the zeroed buffer then stand in for fields that
> were never transferred — sense_iu.status reads as SAM_STAT_GOOD,
> falsely completing the command, and response_iu.response_code reads
> as RC_TMF_COMPLETE.
>
> Enforce the IU header minimum before parsing the tag, then enforce
> per-IU minimums before dereferencing: STATUS IUs need at least the
> status byte, RESPONSE IUs need response_code; READ_READY and
> WRITE_READY IUs legitimately carry only the 4-byte header.
>
> Signed-off-by: Olivier Kaloudoff <olivier.kaloudoff@gmail.com>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261014165618.33800-1-olivier.kaloudoff@gmail.com?part=1
prev parent reply other threads:[~2026-10-14 17:04 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-13 22:19 [PATCH] usb: uas: validate status URB length before parsing the IU Olivier Kaloudoff
2026-10-13 22:27 ` sashiko-bot
2026-10-14 4:59 ` Greg KH
2026-10-14 10:55 ` [PATCH v2] " Olivier Kaloudoff
2026-10-14 11:09 ` sashiko-bot
2026-10-14 16:56 ` [PATCH v3] " Olivier Kaloudoff
2026-10-14 17:04 ` sashiko-bot [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=sashiko-outbox-171561@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=olivier.kaloudoff@gmail.com \
--cc=sashiko-reviews@lists.linux.dev \
/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