Re: [PATCH 7/7] gpu: nova-core: falcon: check the per-block DMA offsets for overflow

From: Eliot Courtney

Date: Thu Nov 05 2026 - 08:06:26 EST


On Tue Nov 3, 2026 at 7:22 PM JST, Alexandre Courbot wrote:
> From: John Hubbard <jhubbard@xxxxxxxxxx>
>
> Each block of a falcon DMA transfer is addressed by the start offset of
> the transfer plus the block's position. The two additions were plain, so
> a source or destination offset near the top of the 32-bit range would
> have wrapped or panicked rather than failing the transfer.
>
> Add the two with checked arithmetic and fail the transfer with EOVERFLOW
> when a sum does not fit.
>
> Assisted-by: LLM
> Signed-off-by: John Hubbard <jhubbard@xxxxxxxxxx>
> [acourbot: split out of the DMA helper patch of v3.]
> Signed-off-by: Alexandre Courbot <acourbot@xxxxxxxxxx>
> ---

Reviewed-by: Eliot Courtney <ecourtney@xxxxxxxxxx>