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: <20231129172633.GG43811@kernel.org>
Date: Wed, 29 Nov 2023 17:26:33 +0000
From: Simon Horman <horms@...nel.org>
To: Subbaraya Sundeep <sbhatta@...vell.com>
Cc: netdev@...r.kernel.org, linux-kernel@...r.kernel.org, kuba@...nel.org,
	davem@...emloft.net, pabeni@...hat.com, edumazet@...gle.com,
	sgoutham@...vell.com, gakula@...vell.com, hkelam@...vell.com,
	lcherian@...vell.com, jerinj@...vell.com
Subject: Re: [PATCH v2 net] octeontx2-pf: Add missing mutex lock in
 otx2_get_pauseparam

On Wed, Nov 29, 2023 at 10:53:42AM +0530, Subbaraya Sundeep wrote:
> All the mailbox messages sent to AF needs to be guarded
> by mutex lock. Add the missing lock in otx2_get_pauseparam
> function.
> 
> Fixes: 75f36270990c ("octeontx2-pf: Support to enable/disable pause frames via ethtool")
> Signed-off-by: Subbaraya Sundeep <sbhatta@...vell.com>
> ---
> v2 changes:
>  Added maintainers of AF driver too

Hi Subbaraya,

I was expecting an update to locking in otx2_dcbnl_ieee_setpfc()
Am I missing something here?

Link: https://lore.kernel.org/all/CO1PR18MB4666C2C1D1284F425E4C9F38A183A@CO1PR18MB4666.namprd18.prod.outlook.com/

> 
>  drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c
> index 9efcec5..53f6258 100644
> --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c
> +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c
> @@ -334,9 +334,12 @@ static void otx2_get_pauseparam(struct net_device *netdev,
>  	if (is_otx2_lbkvf(pfvf->pdev))
>  		return;
>  
> +	mutex_lock(&pfvf->mbox.lock);
>  	req = otx2_mbox_alloc_msg_cgx_cfg_pause_frm(&pfvf->mbox);
> -	if (!req)
> +	if (!req) {
> +		mutex_unlock(&pfvf->mbox.lock);
>  		return;
> +	}
>  
>  	if (!otx2_sync_mbox_msg(&pfvf->mbox)) {
>  		rsp = (struct cgx_pause_frm_cfg *)
> @@ -344,6 +347,7 @@ static void otx2_get_pauseparam(struct net_device *netdev,
>  		pause->rx_pause = rsp->rx_pause;
>  		pause->tx_pause = rsp->tx_pause;
>  	}
> +	mutex_unlock(&pfvf->mbox.lock);
>  }
>  
>  static int otx2_set_pauseparam(struct net_device *netdev,
> -- 
> 2.7.4
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ