From: Stephen Boyd <sboyd@kernel.org>
To: Chanwoo Choi <cw00.choi@samsung.com>,
Krzysztof Kozlowski <krzk@kernel.org>,
Kukjin Kim <kgene@kernel.org>,
Michael Turquette <mturquette@baylibre.com>,
Sylwester Nawrocki <s.nawrocki@samsung.com>,
Tomasz Figa <tomasz.figa@gmail.com>,
linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org
Cc: stable@vger.kernel.org
Subject: Re: [PATCH v2 2/2] clk: samsung: exynos5: Fix kfree() of const memory on setting driver_override
Date: Thu, 21 Feb 2019 13:33:12 -0800 [thread overview]
Message-ID: <155078479299.77512.7336673875297969172@swboyd.mtv.corp.google.com> (raw)
In-Reply-To: <1550749552-8133-3-git-send-email-krzk@kernel.org>
Quoting Krzysztof Kozlowski (2019-02-21 03:45:52)
> Platform driver driver_override field should not be initialized from
> const memory because the core later kfree() it. If driver_override is
> manually set later through sysfs, kfree() of old value leads to:
>
> $ echo "new_value" > /sys/bus/platform/drivers/.../driver_override
>
> kernel BUG at ../mm/slub.c:3960!
> Internal error: Oops - BUG: 0 [#1] PREEMPT SMP ARM
> ...
> (kfree) from [<c058e8c0>] (platform_set_driver_override+0x84/0xac)
> (platform_set_driver_override) from [<c058e908>] (driver_override_store+0x20/0x34)
> (driver_override_store) from [<c031f778>] (kernfs_fop_write+0x100/0x1dc)
> (kernfs_fop_write) from [<c0296de8>] (__vfs_write+0x2c/0x17c)
> (__vfs_write) from [<c02970c4>] (vfs_write+0xa4/0x188)
> (vfs_write) from [<c02972e8>] (ksys_write+0x4c/0xac)
> (ksys_write) from [<c0101000>] (ret_fast_syscall+0x0/0x28)
>
> The clk-exynos5-subcmu driver uses override only for the purpose of
> creating meaningful names for children devices (matching names of power
> domains, e.g. DISP, MFC). The driver_override was not developed for
> this purpose so just switch to default names of devices to fix the
> issue.
>
> Fixes: b06a532bf1fa ("clk: samsung: Add Exynos5 sub-CMU clock driver")
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
> ---
Applied to clk-next
prev parent reply other threads:[~2019-02-21 21:33 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-21 11:45 [PATCH v2 0/2] clk: samsung: Fix kfree() of const memory on setting driver_override Krzysztof Kozlowski
2019-02-21 11:45 ` [PATCH v2 1/2] clk: samsung: exynos5: Fix possible NULL pointer exception on platform_device_alloc() failure Krzysztof Kozlowski
2019-02-21 15:43 ` Geert Uytterhoeven
2019-02-21 21:33 ` Stephen Boyd
2019-02-21 11:45 ` [PATCH v2 2/2] clk: samsung: exynos5: Fix kfree() of const memory on setting driver_override Krzysztof Kozlowski
2019-02-21 15:44 ` Geert Uytterhoeven
2019-02-21 21:33 ` Stephen Boyd [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=155078479299.77512.7336673875297969172@swboyd.mtv.corp.google.com \
--to=sboyd@kernel.org \
--cc=cw00.choi@samsung.com \
--cc=kgene@kernel.org \
--cc=krzk@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=s.nawrocki@samsung.com \
--cc=stable@vger.kernel.org \
--cc=tomasz.figa@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).