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: <6eeced40-7951-ca0d-1bcd-62e1d329ca96@huawei.com>
Date:   Fri, 17 Nov 2023 10:07:00 +0800
From:   Weili Qian <qianweili@...wei.com>
To:     Chen Ni <nichen@...as.ac.cn>, <wangzhou1@...ilicon.com>,
        <herbert@...dor.apana.org.au>, <davem@...emloft.net>,
        <xuzaibo@...wei.com>, <tanshukun1@...wei.com>
CC:     <linux-crypto@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] crypto: hisilicon - Add check for pci_find_ext_capability



On 2023/11/9 10:13, Chen Ni wrote:
> Add check for pci_find_ext_capability() and return the error if it
> fails in order to transfer the error.
> 
> Fixes: 6c6dd5802c2d ("crypto: hisilicon/qm - add controller reset interface")
> Signed-off-by: Chen Ni <nichen@...as.ac.cn>
> ---
>  drivers/crypto/hisilicon/qm.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/crypto/hisilicon/qm.c b/drivers/crypto/hisilicon/qm.c
> index 18599f3634c3..adbab1286d4a 100644
> --- a/drivers/crypto/hisilicon/qm.c
> +++ b/drivers/crypto/hisilicon/qm.c
> @@ -3967,6 +3967,9 @@ static int qm_set_vf_mse(struct hisi_qm *qm, bool set)
>  	int i;
>  
>  	pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_SRIOV);
> +	if (!pos)
> +		return -ENODEV;
> +

Thanks for your patch. The function qm_set_vf_mse() is called only after SRIOV
is enabled, so function pci_find_ext_capability() does not return 0. This check
makes no sense.

Thanks,
Weili
>  	pci_read_config_word(pdev, pos + PCI_SRIOV_CTRL, &sriov_ctrl);
>  	if (set)
>  		sriov_ctrl |= PCI_SRIOV_CTRL_MSE;
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ