Re: [PATCH v2] fpga: altera-cvp: Avoid out-of-bounds read in trailing byte write

Xu Yilun <[email protected]> Mon, 3 Aug 2026 11:12:41 +0800
Newsgroups org.kernel.vger.linux-fpga
Message-ID <anAHKb7kk/77pdTO@yilunxu-OptiPlex-7050>
On Thu, Jul 23, 2026 at 08:19:12AM +0000, Daisuke Matsuda wrote:
> From: Daisuke Matsuda <[email protected]>
> 
> The trailing byte path in altera_cvp_send_block() dereferences a u32
> pointer even when only 1-3 bytes remain in the input buffer. If the buffer
> ends at a page or scatterlist boundary, this can read past the valid image
> data and fault.
> 
> Copy the remaining bytes into a zero-initialized u32 before writing the
> final word so only valid bytes are read from the input buffer.
> 
> Fixes: 34d1dc17ce97 ("fpga manager: Add Altera CvP driver")
> Signed-off-by: Daisuke Matsuda <[email protected]>

Reviewed-by: Xu Yilun <[email protected]>

Applied to for-next