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] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 11 Aug 2023 08:40:16 -0700
From:   Dave Jiang <dave.jiang@...el.com>
To:     Yajun Deng <yajun.deng@...ux.dev>, <vkoul@...nel.org>,
        <bhelgaas@...gle.com>
CC:     <dmaengine@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] dmaengine: ioat: fixing the wrong chancnt



On 8/11/23 01:16, Yajun Deng wrote:
> The chancnt would be updated in __dma_async_device_channel_register(),
> but it was assigned in ioat_enumerate_channels(). Therefore chancnt has
> the wrong value.
> 
> Clear chancnt before calling dma_async_device_register().
> 
> Signed-off-by: Yajun Deng <yajun.deng@...ux.dev>

Thank you for the patch Yajun.

While this may work, it clobbers the chancnt read from the hardware. I 
think the preferable fix is to move the value read from the hardware in 
ioat_enumerate_channels() and its current usages to 'struct 
ioatdma_device' and leave dma->chancnt unchanged in that function so 
that zeroing it later is not needed.

Also, have you tested this patch or is this just from visual inspection?

And need a fixes tag.

> ---
>   drivers/dma/ioat/init.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/dma/ioat/init.c b/drivers/dma/ioat/init.c
> index c4602bfc9c74..928fc8a83a36 100644
> --- a/drivers/dma/ioat/init.c
> +++ b/drivers/dma/ioat/init.c
> @@ -536,8 +536,11 @@ static int ioat_probe(struct ioatdma_device *ioat_dma)
>   
>   static int ioat_register(struct ioatdma_device *ioat_dma)
>   {
> -	int err = dma_async_device_register(&ioat_dma->dma_dev);
> +	int err;
> +
> +	ioat_dma->dma_dev.chancnt = 0;
>   
> +	err = dma_async_device_register(&ioat_dma->dma_dev);
>   	if (err) {
>   		ioat_disable_interrupts(ioat_dma);
>   		dma_pool_destroy(ioat_dma->completion_pool);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ