[PATCH 10/10] remoteproc: imx_dsp_rproc: Fix off-by-one bitmask for trailing bytes

Peng Fan (OSS) peng.fan at oss.nxp.com
Mon Nov 23 19:26:34 PST 2026


On Mon, 23 Nov 2026 17:20:54 +0000 Lee Jones <lee at kernel.org> wrote:

> When size is not a multiple of 4, both imx_dsp_rproc_memcpy() and
> imx_dsp_rproc_memset() compute affected_mask as GENMASK(8 * r, 0) for
> the remaining r bytes (1 <= r <= 3).  Because GENMASK(h, l) is inclusive
> of bit h, GENMASK(8 * r, 0) sets 8 * r + 1 bits and clears or overwrites
> the least-significant bit of the first byte past the end of the target
> region during the 32-bit read-modify-write.
> 
> Use GENMASK(8 * r - 1, 0) to mask exclusively the r trailing bytes.
> 
> Fixes: 408ec1ff0caa ("remoteproc: imx_dsp_rproc: Add custom memory copy implementation for i.MX DSP Cores")
> Closes: https://sashiko.dev/#/bug/linux-2e407b68-a7e9-42ff-a613-e61b47a4461b
> Cc: stable at vger.kernel.org
> Signed-off-by: Lee Jones <lee at kernel.org>

Reviewed-by: Peng Fan <peng.fan at nxp.com>



More information about the linux-arm-kernel mailing list