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] [day] [month] [year] [list]
Date:   Thu, 12 May 2022 11:09:27 +0800
From:   Wei Xu <xuwei5@...ilicon.com>
To:     Miaoqian Lin <linmq006@...il.com>,
        Russell King <linux@...linux.org.uk>,
        Kevin Hilman <khilman@...aro.org>,
        Haojian Zhuang <haojian.zhuang@...aro.org>,
        Zhangfei Gao <zhangfei.gao@...aro.org>,
        <linux-arm-kernel@...ts.infradead.org>,
        <linux-kernel@...r.kernel.org>, <xuwei5@...ilicon.com>
Subject: Re: [PATCH] ARM: hisi: Fix refcount leak in hi3xxx_smp_prepare_cpus

Hi Miaoqian,

On 2022/5/12 10:58, Miaoqian Lin wrote:
> of_find_compatible_node() returns a node pointer with refcount
> incremented, we should use of_node_put() on it when done.
> Add missing of_node_put() to avoid refcount leak.
> 
> Fixes: a9434e96d9f0 ("ARM: hi3xxx: add smp support")
> Signed-off-by: Miaoqian Lin <linmq006@...il.com>
> ---
>  arch/arm/mach-hisi/platsmp.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/arch/arm/mach-hisi/platsmp.c b/arch/arm/mach-hisi/platsmp.c
> index a56cc64deeb8..15e63b72df3a 100644
> --- a/arch/arm/mach-hisi/platsmp.c
> +++ b/arch/arm/mach-hisi/platsmp.c
> @@ -68,13 +68,16 @@ static void __init hi3xxx_smp_prepare_cpus(unsigned int max_cpus)
>  		ctrl_base = of_iomap(np, 0);
>  		if (!ctrl_base) {
>  			pr_err("failed to map address\n");
> +			of_node_put(np);
>  			return;
>  		}
>  		if (of_property_read_u32(np, "smp-offset", &offset) < 0) {
>  			pr_err("failed to find smp-offset property\n");
> +			of_node_put(np);
>  			return;
>  		}
>  		ctrl_base += offset;
> +		of_node_put(np);
>  	}
>  }
>  
> 

Thanks!
But a similar patch[1] has been applied.

[1]: https://www.spinics.net/lists/arm-kernel/msg975425.html

Best Regards,
Wei 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ