Re: [PATCH v3] USB: serial: io_edgeport: cap received transmit credits

From: Johan Hovold

Date: Wed Jul 22 2026 - 05:27:52 EST


On Tue, Jul 14, 2026 at 07:42:30PM +0900, Sunho Park wrote:
> The interrupt-status packet reports transmit credits returned by the
> device. edge_interrupt_callback() adds the 16-bit value to txCredits
> without checking maxTxCredits.
>
> edge_write() uses txCredits minus the software FIFO count as the amount
> of data that fits. Since the FIFO is allocated with maxTxCredits bytes,
> txCredits exceeding maxTxCredits can cause OOB write in ring buffer.
>
> Cap accumulated credits at maxTxCredits. Conforming devices should never
> hit the cap.
>
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> Cc: stable@xxxxxxxxxxxxxxx
> Assisted-by: Codex:GPT-5
> Signed-off-by: Sunho Park <shpark061104@xxxxxxxxx>
> ---
> V2 -> V3: Added missing revision history (no code changes)
> V1 -> V2: Replaced min_t() with min()
>
> v2: https://lore.kernel.org/linux-usb/20260714101316.823942-1-shpark061104@xxxxxxxxx/
> v1: https://lore.kernel.org/linux-usb/20260714093424.737303-1-shpark061104@xxxxxxxxx/

Applied, thanks.

Johan