From: Frank Li <Frank.li@oss.nxp.com>
To: sashiko-reviews@lists.linux.dev
Cc: "Benoît Monin" <benoit.monin@bootlin.com>,
vkoul@kernel.org, Frank.Li@kernel.org, dmaengine@vger.kernel.org,
imx@lists.linux.dev
Subject: Re: [PATCH v6 1/2] dmaengine: fsl-edma: Implement device_prep_peripheral_dma_vec
Date: Fri, 10 Jul 2026 10:18:50 -0500 [thread overview]
Message-ID: <alENWvKlCNk_EJBd@SMW015318> (raw)
In-Reply-To: <20260710122359.674951F000E9@smtp.kernel.org>
On Fri, Jul 10, 2026 at 12:23:58PM +0000, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 6 potential issue(s) to consider:
>
> New issues:
> - [High] Missing validation for maximum segment transfer length causes silent 16-bit truncation of the loop iteration count.
>
> Pre-existing issues:
> - [Critical] Unconditional division and modulo by zero occur during DMA_DEV_TO_DEV transfers due to hardcoded zero offsets.
> - [Critical] Missing `is_multi_fifo` and `port_window_size` handling causes the peripheral address pointer to permanently walk backwards.
> - [High] Missing validation for `nb == 0` leads to a zero-length flexible array allocation and a subsequent out-of-bounds access.
> - [High] Missing validation for slave configuration parameters allows clients to trigger a divide-by-zero crash.
> - [High] Calling `dma_map_resource` with `DMA_NONE` triggers a BUG_ON in the DMA mapping subsystem.
> --
>
...
>
> > + nbytes = j * width;
> > + break;
> > + }
> > + }
> > + /* Set burst size as 1 if there's no suitable one */
> > + if (j == 1)
> > + nbytes = width;
> > + }
> > +
> > + iter = vecs[i].len / nbytes;
>
> [Severity: High]
> Does this properly handle vectors that exceed the hardware's maximum segment
> size?
>
> The dma_vec API passes raw vector lengths directly from the client, and
> iter is a u16. If vecs[i].len / nbytes exceeds 65535, will this silently
> truncate and lead to a partial transfer and data corruption?
Please check this problem
Frank
>
> [ ... ]
>
> --
> Sashiko AI review · https://sashiko.dev/#/patchset/20260710-fsl-edma-dyn-sg-v6-0-831b96be3f31@bootlin.com?part=1
next prev parent reply other threads:[~2026-07-10 15:18 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-10 12:06 [PATCH v6 0/2] dmaengine: fsl-edma: Scatter/gather improvements Benoît Monin
2026-07-10 12:07 ` [PATCH v6 1/2] dmaengine: fsl-edma: Implement device_prep_peripheral_dma_vec Benoît Monin
2026-07-10 12:23 ` sashiko-bot
2026-07-10 15:18 ` Frank Li [this message]
2026-07-10 12:07 ` [PATCH v6 2/2] dmaengine: fsl-edma: Support dynamic scatter/gather chaining Benoît Monin
2026-07-10 12:22 ` sashiko-bot
2026-07-10 15:22 ` Frank Li
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alENWvKlCNk_EJBd@SMW015318 \
--to=frank.li@oss.nxp.com \
--cc=Frank.Li@kernel.org \
--cc=benoit.monin@bootlin.com \
--cc=dmaengine@vger.kernel.org \
--cc=imx@lists.linux.dev \
--cc=sashiko-reviews@lists.linux.dev \
--cc=vkoul@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox