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]
Date:   Sun, 20 Oct 2019 19:06:24 -0700
From:   Bjorn Andersson <bjorn.andersson@...aro.org>
To:     Chris Goldsworthy <cgoldswo@...eaurora.org>
Cc:     robh+dt@...nel.org, devicetree@...r.kernel.org,
        stable@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-arm-msm@...r.kernel.org, linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH] of: reserved_mem: add missing of_node_put() for proper
 ref-counting

On Sat 19 Oct 18:57 PDT 2019, Chris Goldsworthy wrote:

> Commit d698a388146c ("of: reserved-memory: ignore disabled memory-region
> nodes") added an early return in of_reserved_mem_device_init_by_idx(), but
> didn't call of_node_put() on a device_node whose ref-count was incremented
> in the call to of_parse_phandle() preceding the early exit.
> 
> Fixes: d698a388146c ("of: reserved-memory: ignore disabled memory-region nodes")
> Signed-off-by: Chris Goldsworthy <cgoldswo@...eaurora.org>
> To: Rob Herring <robh+dt@...nel.org>
> Cc: devicetree@...r.kernel.org
> Cc: stable@...r.kernel.org
> Cc: linux-kernel@...r.kernel.org
> Cc: linux-arm-msm@...r.kernel.org
> Cc: linux-arm-kernel@...ts.infradead.org

Cc stable@ is used to assist in making sure your patch is backported to
stable kernels, other than that the purpose Cc here is to indicate that
specific people have been requested to comment on your patch.

So please skip these from the commit message in the future (for this
one, wait and see if Rob is willing to trim them as he applies the
patch).


Reviewed-by: Bjorn Andersson <bjorn.andersson@...aro.org>

Regards,
Bjorn

> ---
>  drivers/of/of_reserved_mem.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c
> index 7989703..6bd610e 100644
> --- a/drivers/of/of_reserved_mem.c
> +++ b/drivers/of/of_reserved_mem.c
> @@ -324,8 +324,10 @@ int of_reserved_mem_device_init_by_idx(struct device *dev,
>  	if (!target)
>  		return -ENODEV;
>  
> -	if (!of_device_is_available(target))
> +	if (!of_device_is_available(target)) {
> +		of_node_put(target);
>  		return 0;
> +	}
>  
>  	rmem = __find_rmem(target);
>  	of_node_put(target);
> -- 
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> a Linux Foundation Collaborative Project
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ