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: <0a5588c2-bac5-4d9a-a726-57c6d22341ff@linux.dev>
Date: Mon, 1 Sep 2025 23:18:15 +0100
From: Vadim Fedorenko <vadim.fedorenko@...ux.dev>
To: Rosen Penev <rosenp@...il.com>, netdev@...r.kernel.org
Cc: Sunil Goutham <sgoutham@...vell.com>, Andrew Lunn
 <andrew+netdev@...n.ch>, "David S. Miller" <davem@...emloft.net>,
 Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>,
 Paolo Abeni <pabeni@...hat.com>, David Daney <david.daney@...ium.com>,
 "moderated list:ARM/CAVIUM THUNDER NETWORK DRIVER"
 <linux-arm-kernel@...ts.infradead.org>,
 open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH net] net: thunder_bgx: decrement cleanup index before use

On 01/09/2025 22:33, Rosen Penev wrote:
> All paths in probe that call goto defer do so before assigning phydev
> and thus it makes sense to cleanup the prior index. It also fixes a bug
> where index 0 does not get cleaned up.
> 
> Fixes: b7d3e3d3d21a ("net: thunderx: Don't leak phy device references on -EPROBE_DEFER condition.")
> Signed-off-by: Rosen Penev <rosenp@...il.com>
> ---
>   drivers/net/ethernet/cavium/thunder/thunder_bgx.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/cavium/thunder/thunder_bgx.c b/drivers/net/ethernet/cavium/thunder/thunder_bgx.c
> index 21495b5dce25..90c718af06c1 100644
> --- a/drivers/net/ethernet/cavium/thunder/thunder_bgx.c
> +++ b/drivers/net/ethernet/cavium/thunder/thunder_bgx.c
> @@ -1515,11 +1515,11 @@ static int bgx_init_of_phy(struct bgx *bgx)
>   	 * for phy devices we may have already found.
>   	 */
>   	while (lmac) {
> +		lmac--;
>   		if (bgx->lmac[lmac].phydev) {
>   			put_device(&bgx->lmac[lmac].phydev->mdio.dev);
>   			bgx->lmac[lmac].phydev = NULL;
>   		}
> -		lmac--;
>   	}
>   	of_node_put(node);
>   	return -EPROBE_DEFER;

Reviewed-by: Vadim Fedorenko <vadim.fedorenko@...ux.dev>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ