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:   Wed, 29 Mar 2017 01:16:15 +0000
From:   Kuninori Morimoto <kuninori.morimoto.gx@...esas.com>
To:     Stephen Boyd <sboyd@...eaurora.org>,
        Russell King <linux@...linux.org.uk>
CC:     Linux-Kernel <linux-kernel@...r.kernel.org>,
        Linux-ALSA <alsa-devel@...a-project.org>,
        <linux-clk@...r.kernel.org>,
        Linux-Renesas <linux-renesas-soc@...r.kernel.org>
Subject: Question about of_clk_put ?


Hi Stephen

Now, I'm using devm_get_clk_from_child() (= linux/drivers/clk/clk-devres.c)
and I got Oops if I do bind/unbind driver several times.

	[   32.008847] Unable to handle kernel paging request at virtual address d503201faa1e03e0
	[   32.017124] pgd = ffff8006f9060000
	[   32.020883] [d503201faa1e03e0] *pgd=0000000000000000
	[   32.026243] Internal error: Oops: 96000004 [#1] PREEMPT SMP
	[   32.032198] CPU: 0 PID: 934 Comm: kworker/0:2 Not tainted 4.11.0-rc3+ #1259
	[   32.039573] Hardware name: Renesas Salvator-X board based on r8a7795 (DT)
	[   32.046814] Workqueue: events deferred_probe_work_func
	[   32.052405] task: ffff8006fad2d800 task.stack: ffff8006f90b8000
	[   32.058809] PC is at __of_clk_get_from_provider+0x174/0x1b0
	[   32.064878] LR is at __of_clk_get_from_provider+0x164/0x1b0
	....
	[   32.746677] [<ffff0000083b581c>] __of_clk_get_from_provider+0x174/0x1b0
	[   32.754131] [<ffff0000083aded4>] __of_clk_get_by_name+0x104/0x140
	[   32.761058] [<ffff0000083adfd8>] of_clk_get_by_name+0x30/0x50
	[   32.767630] [<ffff0000083add1c>] devm_get_clk_from_child+0x54/0xb0
	...

I tried to find the criminal point, but, I couldn't specify where it is.
Sometimes it is NULL pointer access crashed,
sometimes it is crashed on of_clk_src_onecell_get(),
sometimes there is no Oops.
I want to solve this issue, but I want to know about of_clk_put as 1st step.

In devm_clk_get() case, it is using clk_get() <-> clk_put() pair, this is OK.
In devm_get_clk_from_child() case, it is using of_clk_get_by_name() (= __of_clk_get())
<-> clk_put() pair.
If my understand was correct, __of_clk_get() uses __clk_create_clk(),
so, its pair should be __clk_free_clk() ?
I wonder I can find of_clk_get(), but couldn't find of_clk_put().
Is using of_clk_get() <-> clk_put() OK ?

Best regards
---
Kuninori Morimoto

Powered by blists - more mailing lists