2021-10-27 18:02:42

by Kishon Vijay Abraham I

[permalink] [raw]
Subject: [RESEND PATCH v2 0/2] dmaengine: ti: k3-udma: Fix NULL pointer dereference error

NULL pointer de-reference error was observed when all the PCIe endpoint
functions (22 function in J721E) request a DMA channel. The issue was
specfically observed in BCDMA (Block copy DMA) but the issue is
applicable in PKTDMA as well.

Changes from v1:
1) Split the patch for BCDMA and PKTDMA separately
2) Fixed the return value of udma_get_rflow() to 0.
3) Removed the fixes tag as the patches does not directly apply to the
commits.

v1 => https://lore.kernel.org/r/[email protected]

Kishon Vijay Abraham I (2):
dmaengine: ti: k3-udma: Fix NULL pointer dereference error for BCDMA
dmaengine: ti: k3-udma: Fix NULL pointer dereference error for PKTDMA

drivers/dma/ti/k3-udma.c | 32 ++++++++++++++++++++++++++------
1 file changed, 26 insertions(+), 6 deletions(-)

--
2.17.1


2021-10-27 22:26:01

by Péter Ujfalusi

[permalink] [raw]
Subject: Re: [RESEND PATCH v2 0/2] dmaengine: ti: k3-udma: Fix NULL pointer dereference error

Hi Kishon,

On 27/10/2021 08:56, Kishon Vijay Abraham I wrote:
> NULL pointer de-reference error was observed when all the PCIe endpoint
> functions (22 function in J721E) request a DMA channel. The issue was
> specfically observed in BCDMA (Block copy DMA) but the issue is
> applicable in PKTDMA as well.

Nice catch, interesting that it did not materialized before.

Can you re-word the patch subjects and commit messages accordingly?

This is not really BCDMA/PKTDMA issue but a missed uc->Xchan = NULL;
which would cause the de-reference error.

> Changes from v1:
> 1) Split the patch for BCDMA and PKTDMA separately
> 2) Fixed the return value of udma_get_rflow() to 0.
> 3) Removed the fixes tag as the patches does not directly apply to the
> commits.
>
> v1 => https://lore.kernel.org/r/[email protected]
>
> Kishon Vijay Abraham I (2):
> dmaengine: ti: k3-udma: Fix NULL pointer dereference error for BCDMA

dmaengine: ti: k3-udma: Set bchan to NULL if a channel request fail

> dmaengine: ti: k3-udma: Fix NULL pointer dereference error for PKTDMA

dmaengine: ti: k3-udma: Set rchan/tchan to NULL if a channel request fail

This is also applicable for UDMA which only have rchan and tchan.

>
> drivers/dma/ti/k3-udma.c | 32 ++++++++++++++++++++++++++------
> 1 file changed, 26 insertions(+), 6 deletions(-)
>

--
Péter