lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Mon, 1 Feb 2021 15:30:59 +0530
From:   Vinod Koul <vkoul@...nel.org>
To:     Guanhua Gao <guanhua.gao@....com>
Cc:     Dan Williams <dan.j.williams@...el.com>, dmaengine@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] dmaengine: fsl-dpaa2-qdma: Fix the size of dma pools

On 17-12-20, 17:23, Guanhua Gao wrote:
> In case of long format of qDMA command descriptor, there are one frame
> descriptor, three entries in the frame list and two data entries. So the
> size of dma_pool_create for these three fields should be the same with
> the total size of entries respectively, or the contents may be overwritten
> by the next allocated descriptor.
> 
> Signed-off-by: Guanhua Gao <guanhua.gao@....com>
> ---
>  drivers/dma/fsl-dpaa2-qdma/dpaa2-qdma.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/dma/fsl-dpaa2-qdma/dpaa2-qdma.c b/drivers/dma/fsl-dpaa2-qdma/dpaa2-qdma.c
> index 4ec909e..bc5baa6 100644
> --- a/drivers/dma/fsl-dpaa2-qdma/dpaa2-qdma.c
> +++ b/drivers/dma/fsl-dpaa2-qdma/dpaa2-qdma.c
> @@ -38,15 +38,17 @@ static int dpaa2_qdma_alloc_chan_resources(struct dma_chan *chan)
>  	if (!dpaa2_chan->fd_pool)
>  		goto err;
>  
> -	dpaa2_chan->fl_pool = dma_pool_create("fl_pool", dev,
> -					      sizeof(struct dpaa2_fl_entry),
> -					      sizeof(struct dpaa2_fl_entry), 0);
> +	dpaa2_chan->fl_pool =
> +		dma_pool_create("fl_pool", dev,
> +				 sizeof(struct dpaa2_fl_entry) * 3,
> +				 sizeof(struct dpaa2_fl_entry), 0);
> +

Can you add comments here as well (like you have for changelog above)
describing why we need 3 times dpaa2_fl_entry


>  	if (!dpaa2_chan->fl_pool)
>  		goto err_fd;
>  
>  	dpaa2_chan->sdd_pool =
>  		dma_pool_create("sdd_pool", dev,
> -				sizeof(struct dpaa2_qdma_sd_d),
> +				sizeof(struct dpaa2_qdma_sd_d) * 2,
>  				sizeof(struct dpaa2_qdma_sd_d), 0);
>  	if (!dpaa2_chan->sdd_pool)
>  		goto err_fl;
> -- 
> 2.7.4

-- 
~Vinod

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ