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]
Message-ID: <5296FD95.1010000@linaro.org>
Date:	Thu, 28 Nov 2013 09:23:49 +0100
From:	Daniel Lezcano <daniel.lezcano@...aro.org>
To:	Thierry Reding <thierry.reding@...il.com>,
	Thomas Gleixner <tglx@...utronix.de>
CC:	Arnd Bergmann <arnd@...db.de>,
	Rob Herring <rob.herring@...xeda.com>,
	devicetree@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] clocksource: Do not drop unheld reference on device node

On 10/19/2013 12:49 AM, Thierry Reding wrote:
> When booting a recent kernel on ARM with OF_DYNAMIC enabled, the kernel
> warns about the following:
>
> 	[    0.000000] ERROR: Bad of_node_put() on /timer@...04600
> 	[    0.000000] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 3.12.0-rc5-next-20131017-00077-gedfd827-dirty #406
> 	[    0.000000] [<c0015b68>] (unwind_backtrace+0x0/0xf4) from [<c00117e4>] (show_stack+0x10/0x14)
> 	[    0.000000] [<c00117e4>] (show_stack+0x10/0x14) from [<c055f734>] (dump_stack+0x9c/0xc8)
> 	[    0.000000] [<c055f734>] (dump_stack+0x9c/0xc8) from [<c03b47d4>] (of_node_release+0x90/0x9c)
> 	[    0.000000] [<c03b47d4>] (of_node_release+0x90/0x9c) from [<c03b5084>] (of_find_matching_node_and_match+0x78/0xb4)
> 	[    0.000000] [<c03b5084>] (of_find_matching_node_and_match+0x78/0xb4) from [<c07887c8>] (clocksource_of_init+0x60/0x70)
> 	[    0.000000] [<c07887c8>] (clocksource_of_init+0x60/0x70) from [<c076e99c>] (start_kernel+0x1f4/0x33c)
> 	[    0.000000] [<c076e99c>] (start_kernel+0x1f4/0x33c) from [<80008074>] (0x80008074)
>
> This is caused by clocksource_of_init() dropping a reference on the
> device node that it never took. The reference taken by the loop is
> implicitly dropped on subsequent iterations. See the implementation of
> and the comment on top of the of_find_matching_node_and_match()
> function for reference (no pun intended).
>
> Signed-off-by: Thierry Reding <treding@...dia.com>
> ---
>   drivers/clocksource/clksrc-of.c | 1 -
>   1 file changed, 1 deletion(-)
>
> diff --git a/drivers/clocksource/clksrc-of.c b/drivers/clocksource/clksrc-of.c
> index 35639cf4..b9ddd9e 100644
> --- a/drivers/clocksource/clksrc-of.c
> +++ b/drivers/clocksource/clksrc-of.c
> @@ -35,6 +35,5 @@ void __init clocksource_of_init(void)
>
>   		init_func = match->data;
>   		init_func(np);
> -		of_node_put(np);
>   	}
>   }

Applied to my tree for 3.13 fixes.


-- 
  <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ