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]
Message-ID: <YFN3X6q8dzEaUp27@silpixa00400314>
Date:   Thu, 18 Mar 2021 15:53:03 +0000
From:   Giovanni Cabiddu <giovanni.cabiddu@...el.com>
To:     Tong Zhang <ztong0001@...il.com>
Cc:     Herbert Xu <herbert@...dor.apana.org.au>,
        "David S. Miller" <davem@...emloft.net>,
        Andy Shevchenko <andy.shevchenko@...il.com>,
        Wojciech Ziemba <wojciech.ziemba@...el.com>,
        Fiona Trahe <fiona.trahe@...el.com>, qat-linux@...el.com,
        linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 1/2] crypto: qat - dont release uninitialized resources

On Fri, Mar 12, 2021 at 11:22:02AM -0500, Tong Zhang wrote:
> adf_vf_isr_resource_alloc() is not unwinding correctly when error
> happens and it trys to release uninitialized resources.
> To fix this, only release initialized resources.
> 
> [    1.792845] Trying to free already-free IRQ 11
> [    1.793091] WARNING: CPU: 0 PID: 182 at kernel/irq/manage.c:1821 free_irq+0x202/0x380
> [    1.801340] Call Trace:
> [    1.801477]  adf_vf_isr_resource_free+0x32/0xb0 [intel_qat]
> [    1.801785]  adf_vf_isr_resource_alloc+0x14d/0x150 [intel_qat]
> [    1.802105]  adf_dev_init+0xba/0x140 [intel_qat]
> 
> Signed-off-by: Tong Zhang <ztong0001@...il.com>
> Reviewed-by: Andy Shevchenko <andy.shevchenko@...il.com>
I would add also a Fixes tag:
Fixes: dd0f368398ea ("crypto: qat - Add qat dh895xcc VF driver")

Minor nit, typo in commit message: dont --> don't/do not

Apart from that
Acked-by: Giovanni Cabiddu <giovanni.cabiddu@...el.com>

-- 
Giovanni

> ---
>  drivers/crypto/qat/qat_common/adf_vf_isr.c | 17 +++++++++++++----
>  1 file changed, 13 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/crypto/qat/qat_common/adf_vf_isr.c b/drivers/crypto/qat/qat_common/adf_vf_isr.c
> index 38d316a42ba6..888388acb6bd 100644
> --- a/drivers/crypto/qat/qat_common/adf_vf_isr.c
> +++ b/drivers/crypto/qat/qat_common/adf_vf_isr.c
> @@ -261,17 +261,26 @@ int adf_vf_isr_resource_alloc(struct adf_accel_dev *accel_dev)
>  		goto err_out;
>  
>  	if (adf_setup_pf2vf_bh(accel_dev))
> -		goto err_out;
> +		goto err_disable_msi;
>  
>  	if (adf_setup_bh(accel_dev))
> -		goto err_out;
> +		goto err_cleanup_pf2vf_bh;
>  
>  	if (adf_request_msi_irq(accel_dev))
> -		goto err_out;
> +		goto err_cleanup_bh;
>  
>  	return 0;
> +
> +err_cleanup_bh:
> +	adf_cleanup_bh(accel_dev);
> +
> +err_cleanup_pf2vf_bh:
> +	adf_cleanup_pf2vf_bh(accel_dev);
> +
> +err_disable_msi:
> +	adf_disable_msi(accel_dev);
> +
>  err_out:
> -	adf_vf_isr_resource_free(accel_dev);
>  	return -EFAULT;
>  }
>  EXPORT_SYMBOL_GPL(adf_vf_isr_resource_alloc);
> -- 
> 2.25.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ