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: <Zs2uYVvjcHFZoVqX@lzaremba-mobl.ger.corp.intel.com>
Date: Tue, 27 Aug 2024 12:45:53 +0200
From: Larysa Zaremba <larysa.zaremba@...el.com>
To: Maxime Chevallier <maxime.chevallier@...tlin.com>
CC: <davem@...emloft.net>, <netdev@...r.kernel.org>,
	<linux-kernel@...r.kernel.org>, <thomas.petazzoni@...tlin.com>, Andrew Lunn
	<andrew@...n.ch>, Jakub Kicinski <kuba@...nel.org>, Eric Dumazet
	<edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>, Russell King
	<linux@...linux.org.uk>, <linux-arm-kernel@...ts.infradead.org>, "Christophe
 Leroy" <christophe.leroy@...roup.eu>, Herve Codina
	<herve.codina@...tlin.com>, Florian Fainelli <f.fainelli@...il.com>, Heiner
 Kallweit <hkallweit1@...il.com>, Vladimir Oltean <vladimir.oltean@....com>,
	Köry Maincent <kory.maincent@...tlin.com>, Marek
 Behún <kabel@...nel.org>, Oleksij Rempel
	<o.rempel@...gutronix.de>, Simon Horman <horms@...nel.org>,
	<mwojtas@...omium.org>, Dan Carpenter <dan.carpenter@...aro.org>, "Romain
 Gantois" <romain.gantois@...tlin.com>
Subject: Re: [PATCH net-next] net: ethtool: cable-test: Release RTNL when the
 PHY isn't found

On Tue, Aug 27, 2024 at 11:23:13AM +0200, Maxime Chevallier wrote:
> Use the correct logic to check for the presence of a PHY device, and
> jump to a label that correctly releases RTNL in case of an error, as we
> are holding RTNL at that point.
> 
> Fixes: 3688ff3077d3 ("net: ethtool: cable-test: Target the command to the requested PHY")
> Closes: https://lore.kernel.org/netdev/20240827104825.5cbe0602@fedora-3.home/T/#m6bc49cdcc5cfab0d162516b92916b944a01c833f
> Signed-off-by: Maxime Chevallier <maxime.chevallier@...tlin.com>
> Reported-by: Dan Carpenter <dan.carpenter@...aro.org>

Your SoB has to be at the very end. The patch itself looks correct.

Reviewed-by: Larysa Zaremba <larysa.zaremba@...el.com>

> ---
> 
> I'm targetting this patch to net-next as this is where the commit it fixes lives.
> 
>  net/ethtool/cabletest.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/net/ethtool/cabletest.c b/net/ethtool/cabletest.c
> index ff2fe3566ace..371bdc1598ce 100644
> --- a/net/ethtool/cabletest.c
> +++ b/net/ethtool/cabletest.c
> @@ -343,9 +343,9 @@ int ethnl_act_cable_test_tdr(struct sk_buff *skb, struct genl_info *info)
>  	phydev = ethnl_req_get_phydev(&req_info,
>  				      tb[ETHTOOL_A_CABLE_TEST_TDR_HEADER],
>  				      info->extack);
> -	if (!IS_ERR_OR_NULL(phydev)) {
> +	if (IS_ERR_OR_NULL(phydev)) {
>  		ret = -EOPNOTSUPP;
> -		goto out_dev_put;
> +		goto out_rtnl;
>  	}
>  
>  	ops = ethtool_phy_ops;
> -- 
> 2.45.2
> 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ