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

From: Greg Kroah-Hartman

Date: Tue Jul 14 2026 - 08:19:26 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()

Please slow down and don't send patches right after each other. There
might have been other review comments...