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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 20 Dec 2019 13:56:35 +0000
From:   "Ardelean, Alexandru" <alexandru.Ardelean@...log.com>
To:     "vkoul@...nel.org" <vkoul@...nel.org>,
        "peter.ujfalusi@...com" <peter.ujfalusi@...com>
CC:     "dan.j.williams@...el.com" <dan.j.williams@...el.com>,
        "dmaengine@...r.kernel.org" <dmaengine@...r.kernel.org>,
        "s.hauer@...gutronix.de" <s.hauer@...gutronix.de>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] dmaengine: virt-dma: Fix access after free in
 vcna_complete()

On Fri, 2019-12-20 at 15:11 +0200, Peter Ujfalusi wrote:
> [External]
> 
> vchan_vdesc_fini() is freeing up 'vd' so the access to vd->tx_result is
> via already freed up memory.
> 
> Move the vchan_vdesc_fini() after invoking the callback to avoid this.
> 

Reviewed-by: Alexandru Ardelean <alexandru.ardelean@...log.com>

> Fixes: 09d5b702b0f97 ("dmaengine: virt-dma: store result on dma
> descriptor")
> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@...com>
> ---
>  drivers/dma/virt-dma.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/dma/virt-dma.c b/drivers/dma/virt-dma.c
> index ec4adf4260a0..256fc662c500 100644
> --- a/drivers/dma/virt-dma.c
> +++ b/drivers/dma/virt-dma.c
> @@ -104,9 +104,8 @@ static void vchan_complete(unsigned long arg)
>  		dmaengine_desc_get_callback(&vd->tx, &cb);
>  
>  		list_del(&vd->node);
> -		vchan_vdesc_fini(vd);
> -
>  		dmaengine_desc_callback_invoke(&cb, &vd->tx_result);
> +		vchan_vdesc_fini(vd);
>  	}
>  }
>  

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ