Re: [PATCH] usb: host: ehci-sched: Don't let a bogus siTD remaining length underflow

From: 'Alan Stern'

Date: Tue Nov 17 2026 - 15:34:25 EST


On Tue, Nov 17, 2026 at 09:25:10AM +0900, gichoon.han@xxxxxxxxxxx wrote:
> On Mon, Nov 16, 2026 at ..., Alan Stern wrote:
> > The type of CPU doesn't matter as much as the type of EHCI controller,
> > since you're talking about a controller hardware bug.
>
> Fair point. It is the on-chip EHCI controller of a Novatek TV SoC
> (DT compatible "nvt,NT72668-ehci"), driven by ehci-hcd through a
> vendor platform glue that is not in mainline.
>
> > Actually the bug lies in the host controller hardware. Not the driver.
>
> Agreed, I'll fix the wording.
>
> > So you have no way of knowing whether this patch really fixes the
> > problem?
>
> Not directly, no. I don't have the siTD contents from the failing
> device,

Why not?

> so the claim that the controller wrote a remaining count
> larger than the programmed length is an inference: the faulting
> memcpy() still had about 122 KB left to copy out of a full-speed
> packet, which can be at most 1023 bytes, and this subtraction is the
> only place in the path that can produce a value that large.

You make a good case, but I'd still like to see more definitive proof if
at all possible.

> What the patch does guarantee is narrower: whatever the controller
> writes into the siTD, ehci-hcd never hands a class driver an
> actual_length larger than the requested length. The crash itself is
> already prevented on the ALSA side.
>
> If you think that is not enough to justify the change without
> hardware confirmation, I'm fine with dropping it. Otherwise I'll
> send a v2 with the controller identified and the wording fixed.

Go ahead and send v2; I'll probably okay it. And do try to get a real
smoking gun on the failing device.

Alan Stern