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: <AM0PR05MB48665FBFDB99A8BEEBC5182CD1E50@AM0PR05MB4866.eurprd05.prod.outlook.com>
Date:   Wed, 4 Mar 2020 17:31:48 +0000
From:   Parav Pandit <parav@...lanox.com>
To:     Shannon Nelson <snelson@...sando.io>,
        "davem@...emloft.net" <davem@...emloft.net>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: RE: [PATCH net] ionic: fix vf op lock usage


> Sent: Wednesday, March 4, 2020 11:22 AM
> To: davem@...emloft.net; netdev@...r.kernel.org
> These are a couple of read locks that should be write locks.
> 
> Fixes: commit fbb39807e9ae ("ionic: support sr-iov operations")
It should be,

Fixes: fbb39807e9ae ("ionic: support sr-iov operations")

> Signed-off-by: Shannon Nelson <snelson@...sando.io>
> ---
>  drivers/net/ethernet/pensando/ionic/ionic_lif.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c
> b/drivers/net/ethernet/pensando/ionic/ionic_lif.c
> index 191271f6260d..c2f5b691e0fa 100644
> --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c
> +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c
> @@ -1688,7 +1688,7 @@ static int ionic_set_vf_mac(struct net_device
> *netdev, int vf, u8 *mac)
>  	if (!(is_zero_ether_addr(mac) || is_valid_ether_addr(mac)))
>  		return -EINVAL;
> 
> -	down_read(&ionic->vf_op_lock);
> +	down_write(&ionic->vf_op_lock);
> 
>  	if (vf >= pci_num_vf(ionic->pdev) || !ionic->vfs) {
>  		ret = -EINVAL;
> @@ -1698,7 +1698,7 @@ static int ionic_set_vf_mac(struct net_device
> *netdev, int vf, u8 *mac)
>  			ether_addr_copy(ionic->vfs[vf].macaddr, mac);
>  	}
> 
> -	up_read(&ionic->vf_op_lock);
> +	up_write(&ionic->vf_op_lock);
>  	return ret;
>  }
> 
> @@ -1719,7 +1719,7 @@ static int ionic_set_vf_vlan(struct net_device
> *netdev, int vf, u16 vlan,
>  	if (proto != htons(ETH_P_8021Q))
>  		return -EPROTONOSUPPORT;
> 
> -	down_read(&ionic->vf_op_lock);
> +	down_write(&ionic->vf_op_lock);
> 
>  	if (vf >= pci_num_vf(ionic->pdev) || !ionic->vfs) {
>  		ret = -EINVAL;
> @@ -1730,7 +1730,7 @@ static int ionic_set_vf_vlan(struct net_device
> *netdev, int vf, u16 vlan,
>  			ionic->vfs[vf].vlanid = vlan;
>  	}
> 
> -	up_read(&ionic->vf_op_lock);
> +	up_write(&ionic->vf_op_lock);
>  	return ret;
>  }
> 
> --
> 2.17.1

I missed to review this after Christmas break.

Reviewed-by: Parav Pandit <parav@...lanox.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ