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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220819131659.GD11901@duo.ucw.cz>
Date:   Fri, 19 Aug 2022 15:16:59 +0200
From:   Pavel Machek <pavel@...x.de>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:     linux-kernel@...r.kernel.org, stable@...r.kernel.org,
        Miaoqian Lin <linmq006@...il.com>,
        Mark Brown <broonie@...nel.org>,
        Sasha Levin <sashal@...nel.org>
Subject: Re: [PATCH 5.15 564/779] ASoC: mediatek: mt8173: Fix refcount leak
 in mt8173_rt5650_rt5676_dev_probe

Hi!
> From: Miaoqian Lin <linmq006@...il.com>
> 
> [ Upstream commit ae4f11c1ed2d67192fdf3d89db719ee439827c11 ]
> 
> of_parse_phandle() returns a node pointer with refcount
> incremented, we should use of_node_put() on it when not need anymore.
> Fix missing of_node_put() in error paths.

Is this correct?

> +++ b/sound/soc/mediatek/mt8173/mt8173-rt5650-rt5676.c
> @@ -256,14 +256,16 @@ static int mt8173_rt5650_rt5676_dev_probe(struct platform_device *pdev)
>  	if (!mt8173_rt5650_rt5676_dais[DAI_LINK_CODEC_I2S].codecs[0].of_node) {
>  		dev_err(&pdev->dev,
>  			"Property 'audio-codec' missing or invalid\n");
> -		return -EINVAL;
> +		ret = -EINVAL;
> +		goto put_node;
>  	}
...
>  		dev_err(&pdev->dev, "%s snd_soc_register_card fail %d\n",
>  			__func__, ret);
>  
> +put_node:
>  	of_node_put(platform_node);
>  	return ret;
>  }

In success case, platform_node is stored:

		dai_link->platforms->of_node = platform_node;

I guess we should not be doing put in that case.

Best regards,
								Pavel
-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

Download attachment "signature.asc" of type "application/pgp-signature" (196 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ