Linux kernel -stable discussions
 help / color / mirror / Atom feed
* [PATCH 01/12] clk: samsung: exynos5-subcmu: Detach power domain on add failure
       [not found] <20261127180416.3277544-1-lee@kernel.org>
@ 2026-11-27 18:03 ` Lee Jones
  2026-11-27 18:03 ` [PATCH 02/12] clk: samsung: exynos-arm64: Do not store ERR_PTR in data->clk Lee Jones
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: Lee Jones @ 2026-11-27 18:03 UTC (permalink / raw)
  To: lee, Krzysztof Kozlowski, Sylwester Nawrocki, Chanwoo Choi,
	Peter Griffin, Alim Akhtar, Stephen Boyd, Brian Masney,
	Jerome Brunet, Bjorn Helgaas, Danilo Krummrich,
	Uwe Kleine-König (The Capable Hub), Takashi Sakamoto,
	Marek Szyprowski, linux-samsung-soc, linux-clk, linux-arm-kernel,
	linux-kernel
  Cc: stable

exynos5_clk_register_subcmu() attaches &pdev->dev to its generic power
domain via of_genpd_add_device().  If platform_device_add() then fails,
it frees pdev via platform_device_put() without detaching it from the
power domain, leaving a dangling device pointer in the genpd device
list.

Record the return value of of_genpd_add_device() (keeping attachment
non-fatal when power domains are disabled) and call
pm_genpd_remove_device() before putting pdev if platform_device_add()
fails.

Fixes: b06a532bf1fa ("clk: samsung: Add Exynos5 sub-CMU clock driver")
Closes: https://sashiko.dev/#/bug/linux-0f461223-0d95-4e2c-b3d1-eac8e585e532
Cc: stable@vger.kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
---
 drivers/clk/samsung/clk-exynos5-subcmu.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/clk/samsung/clk-exynos5-subcmu.c b/drivers/clk/samsung/clk-exynos5-subcmu.c
index 373129847301..b0781e9f5640 100644
--- a/drivers/clk/samsung/clk-exynos5-subcmu.c
+++ b/drivers/clk/samsung/clk-exynos5-subcmu.c
@@ -137,7 +137,7 @@ static int __init exynos5_clk_register_subcmu(struct device *parent,
 {
 	struct of_phandle_args genpdspec = { .np = pd_node };
 	struct platform_device *pdev;
-	int ret;
+	int genpd_ret, ret;
 
 	pdev = platform_device_alloc("exynos5-subcmu", PLATFORM_DEVID_AUTO);
 	if (!pdev)
@@ -145,10 +145,13 @@ static int __init exynos5_clk_register_subcmu(struct device *parent,
 
 	pdev->dev.parent = parent;
 	platform_set_drvdata(pdev, (void *)info);
-	of_genpd_add_device(&genpdspec, &pdev->dev);
+	genpd_ret = of_genpd_add_device(&genpdspec, &pdev->dev);
 	ret = platform_device_add(pdev);
-	if (ret)
+	if (ret) {
+		if (!genpd_ret)
+			pm_genpd_remove_device(&pdev->dev);
 		platform_device_put(pdev);
+	}
 
 	return ret;
 }
-- 
2.56.1.839.g22a8290db9-goog


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 02/12] clk: samsung: exynos-arm64: Do not store ERR_PTR in data->clk
       [not found] <20261127180416.3277544-1-lee@kernel.org>
  2026-11-27 18:03 ` [PATCH 01/12] clk: samsung: exynos5-subcmu: Detach power domain on add failure Lee Jones
@ 2026-11-27 18:03 ` Lee Jones
  2026-11-27 18:03 ` [PATCH 03/12] clk: samsung: artpec8: Terminate PLL rate table with sentinel Lee Jones
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: Lee Jones @ 2026-11-27 18:03 UTC (permalink / raw)
  To: lee, Krzysztof Kozlowski, Sylwester Nawrocki, Chanwoo Choi,
	Peter Griffin, Alim Akhtar, Stephen Boyd, Brian Masney,
	Jerome Brunet, Dávid Virág, Sam Protsenko,
	linux-samsung-soc, linux-clk, linux-arm-kernel, linux-kernel
  Cc: stable

exynos_arm64_enable_bus_clk() assigns parent_clk to data->clk before
checking IS_ERR(parent_clk) or enabling the clock.  Because
exynos_arm64_register_cmu_pm() logs the failure and continues
registering PM callbacks, exynos_arm64_cmu_suspend() and
exynos_arm64_cmu_resume() later pass the error pointer to
clk_disable_unprepare() and clk_prepare_enable(), causing a crash.

Only store parent_clk in data->clk after IS_ERR() and
clk_prepare_enable() succeed, and release the clock reference on enable
failure.

Fixes: f05dc2024316 ("clk: samsung: exynos5433: Extract PM support to common ARM64 layer")
Closes: https://sashiko.dev/#/bug/linux-d237d28a-7387-4379-9bf4-331a7052082c
Cc: stable@vger.kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
---
 drivers/clk/samsung/clk-exynos-arm64.c | 26 +++++++++++++++++---------
 1 file changed, 17 insertions(+), 9 deletions(-)

diff --git a/drivers/clk/samsung/clk-exynos-arm64.c b/drivers/clk/samsung/clk-exynos-arm64.c
index 35d4de233cc1..360bd5d8421d 100644
--- a/drivers/clk/samsung/clk-exynos-arm64.c
+++ b/drivers/clk/samsung/clk-exynos-arm64.c
@@ -149,25 +149,33 @@ static int __init exynos_arm64_enable_bus_clk(struct device *dev,
 		struct device_node *np, const struct samsung_cmu_info *cmu)
 {
 	struct clk *parent_clk;
+	int ret;
 
 	if (!cmu->clk_name)
 		return 0;
 
-	if (dev) {
-		struct exynos_arm64_cmu_data *data;
-
+	if (dev)
 		parent_clk = clk_get(dev, cmu->clk_name);
-		data = dev_get_drvdata(dev);
-		if (data)
-			data->clk = parent_clk;
-	} else {
+	else
 		parent_clk = of_clk_get_by_name(np, cmu->clk_name);
-	}
 
 	if (IS_ERR(parent_clk))
 		return PTR_ERR(parent_clk);
 
-	return clk_prepare_enable(parent_clk);
+	ret = clk_prepare_enable(parent_clk);
+	if (ret) {
+		clk_put(parent_clk);
+		return ret;
+	}
+
+	if (dev) {
+		struct exynos_arm64_cmu_data *data = dev_get_drvdata(dev);
+
+		if (data)
+			data->clk = parent_clk;
+	}
+
+	return 0;
 }
 
 static int __init exynos_arm64_cmu_prepare_pm(struct device *dev,
-- 
2.56.1.839.g22a8290db9-goog


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 03/12] clk: samsung: artpec8: Terminate PLL rate table with sentinel
       [not found] <20261127180416.3277544-1-lee@kernel.org>
  2026-11-27 18:03 ` [PATCH 01/12] clk: samsung: exynos5-subcmu: Detach power domain on add failure Lee Jones
  2026-11-27 18:03 ` [PATCH 02/12] clk: samsung: exynos-arm64: Do not store ERR_PTR in data->clk Lee Jones
@ 2026-11-27 18:03 ` Lee Jones
  2026-11-27 18:03 ` [PATCH 04/12] clk: samsung: artpec9: Terminate PLL rate tables with sentinels Lee Jones
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: Lee Jones @ 2026-11-27 18:03 UTC (permalink / raw)
  To: lee, Jesper Nilsson, Lars Persson, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Peter Griffin, Alim Akhtar,
	Stephen Boyd, Brian Masney, Jerome Brunet, SeonGu Kang,
	Ravi Patel, Varada Pavani, Hakyeong Kim, linux-arm-kernel,
	linux-samsung-soc, linux-arm-kernel, linux-clk, linux-kernel
  Cc: stable

_samsung_clk_register_pll() sizes each PLL rate table by scanning until
it encounters an entry with .rate == 0, then copies the counted entries
into pll->rate_table.  However, artpec8_pll_audio_rates omits a
terminating zero sentinel, causing out-of-bounds reads into adjacent
read-only data and populating pll->rate_table with bogus entries.

Append a sentinel entry to artpec8_pll_audio_rates.

Fixes: bd5336e3f704 ("clk: samsung: artpec-8: Add initial clock support for ARTPEC-8 SoC")
Cc: stable@vger.kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
---
 drivers/clk/samsung/clk-artpec8.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/clk/samsung/clk-artpec8.c b/drivers/clk/samsung/clk-artpec8.c
index 0ea7c8b58674..fd35643be2e3 100644
--- a/drivers/clk/samsung/clk-artpec8.c
+++ b/drivers/clk/samsung/clk-artpec8.c
@@ -173,6 +173,7 @@ static const struct samsung_pll_rate_table artpec8_pll_audio_rates[] __initconst
 	PLL_36XX_RATE(25 * MHZ, 100000000U, 32, 2, 2, 0),
 	PLL_36XX_RATE(25 * MHZ,  98303985U, 47, 3, 2, 12184),
 	PLL_36XX_RATE(25 * MHZ,  49151992U, 47, 3, 3, 12184),
+	{ /* sentinel */ }
 };
 
 static const struct samsung_pll_clock cmu_cmu_pll_clks[] __initconst = {
-- 
2.56.1.839.g22a8290db9-goog


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 04/12] clk: samsung: artpec9: Terminate PLL rate tables with sentinels
       [not found] <20261127180416.3277544-1-lee@kernel.org>
                   ` (2 preceding siblings ...)
  2026-11-27 18:03 ` [PATCH 03/12] clk: samsung: artpec8: Terminate PLL rate table with sentinel Lee Jones
@ 2026-11-27 18:03 ` Lee Jones
  2026-11-27 18:03 ` [PATCH 05/12] clk: samsung: exynos5250: Terminate PLL rate table with sentinel Lee Jones
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: Lee Jones @ 2026-11-27 18:03 UTC (permalink / raw)
  To: lee, Jesper Nilsson, Lars Persson, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Peter Griffin, Alim Akhtar,
	Stephen Boyd, Brian Masney, Jerome Brunet, GyoungBo Min,
	Ravi Patel, linux-arm-kernel, linux-samsung-soc, linux-arm-kernel,
	linux-clk, linux-kernel
  Cc: stable

_samsung_clk_register_pll() sizes each PLL rate table by scanning until
it encounters an entry with .rate == 0, then copies the counted entries
into pll->rate_table.  However, artpec9_pll_audio_rates,
artpec9_pll_cpucl_rates, and artpec9_pll_fsys1_rates all omit a
terminating zero sentinel, causing out-of-bounds reads into adjacent
read-only data and populating pll->rate_table with bogus entries.

Append a sentinel entry to each of the 3 PLL rate tables.

Fixes: 85cc5be65b82 ("clk: samsung: artpec-9: Add initial clock support for ARTPEC-9 SoC")
Cc: stable@vger.kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
---
 drivers/clk/samsung/clk-artpec9.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/clk/samsung/clk-artpec9.c b/drivers/clk/samsung/clk-artpec9.c
index 2eaf8117638c..aee5a9283de4 100644
--- a/drivers/clk/samsung/clk-artpec9.c
+++ b/drivers/clk/samsung/clk-artpec9.c
@@ -176,6 +176,7 @@ static const unsigned long cmu_cmu_clk_regs[] __initconst = {
 
 static const struct samsung_pll_rate_table artpec9_pll_audio_rates[] __initconst = {
 	PLL_A9FRACO_RATE(25 * MHZ, 589824000U, 94, 1, 3, 6238440),
+	{ /* sentinel */ }
 };
 
 static const struct samsung_pll_clock cmu_cmu_pll_clks[] __initconst = {
@@ -490,6 +491,7 @@ static const struct samsung_pll_rate_table artpec9_pll_cpucl_rates[] __initconst
 	PLL_35XX_RATE(25 * MHZ, 1400000000U, 56, 1, 0),
 	PLL_35XX_RATE(25 * MHZ, 1100000000U, 44, 1, 0),
 	PLL_35XX_RATE(25 * MHZ,  850000000U, 34, 1, 0),
+	{ /* sentinel */ }
 };
 
 static const struct samsung_pll_clock cmu_cpucl_pll_clks[] __initconst = {
@@ -815,6 +817,7 @@ static const unsigned long cmu_fsys1_clk_regs[] __initconst = {
 
 static const struct samsung_pll_rate_table artpec9_pll_fsys1_rates[] __initconst = {
 	PLL_35XX_RATE(25 * MHZ, 2000000000U, 80, 1, 0),
+	{ /* sentinel */ }
 };
 
 static const struct samsung_pll_clock cmu_fsys1_pll_clks[] __initconst = {
-- 
2.56.1.839.g22a8290db9-goog


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 05/12] clk: samsung: exynos5250: Terminate PLL rate table with sentinel
       [not found] <20261127180416.3277544-1-lee@kernel.org>
                   ` (3 preceding siblings ...)
  2026-11-27 18:03 ` [PATCH 04/12] clk: samsung: artpec9: Terminate PLL rate tables with sentinels Lee Jones
@ 2026-11-27 18:03 ` Lee Jones
  2026-11-27 18:03 ` [PATCH 06/12] clk: samsung: exynos5260: Terminate PLL rate tables with sentinels Lee Jones
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: Lee Jones @ 2026-11-27 18:03 UTC (permalink / raw)
  To: lee, Krzysztof Kozlowski, Sylwester Nawrocki, Chanwoo Choi,
	Peter Griffin, Alim Akhtar, Stephen Boyd, Brian Masney,
	Jerome Brunet, Thomas Abraham, Tomasz Figa, Sachin Kamat,
	Andrew Bresticker, linux-samsung-soc, linux-clk, linux-arm-kernel,
	linux-kernel
  Cc: stable

_samsung_clk_register_pll() sizes each PLL rate table by scanning until
it encounters an entry with .rate == 0, then copies the counted entries
into pll->rate_table.  However, apll_24mhz_tbl omits a terminating zero
sentinel, causing out-of-bounds reads into adjacent read-only data and
populating pll->rate_table with bogus entries.

Append a sentinel entry to apll_24mhz_tbl.

Fixes: f521ac8b390c ("clk: exynos5250: register APLL rate table")
Cc: stable@vger.kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
---
 drivers/clk/samsung/clk-exynos5250.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/clk/samsung/clk-exynos5250.c b/drivers/clk/samsung/clk-exynos5250.c
index 802300c945a9..bce5b03ecd2f 100644
--- a/drivers/clk/samsung/clk-exynos5250.c
+++ b/drivers/clk/samsung/clk-exynos5250.c
@@ -730,6 +730,7 @@ static const struct samsung_pll_rate_table apll_24mhz_tbl[] __initconst = {
 	PLL_35XX_RATE(24 * MHZ, 400000000, 100, 3, 1),
 	PLL_35XX_RATE(24 * MHZ, 300000000, 200, 4, 2),
 	PLL_35XX_RATE(24 * MHZ, 200000000, 100, 3, 2),
+	{ /* sentinel */ }
 };
 
 static struct samsung_pll_clock exynos5250_plls[nr_plls] __initdata = {
-- 
2.56.1.839.g22a8290db9-goog


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 06/12] clk: samsung: exynos5260: Terminate PLL rate tables with sentinels
       [not found] <20261127180416.3277544-1-lee@kernel.org>
                   ` (4 preceding siblings ...)
  2026-11-27 18:03 ` [PATCH 05/12] clk: samsung: exynos5250: Terminate PLL rate table with sentinel Lee Jones
@ 2026-11-27 18:03 ` Lee Jones
  2026-11-27 18:03 ` [PATCH 07/12] clk: samsung: exynos5410: Terminate PLL rate table with sentinel Lee Jones
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: Lee Jones @ 2026-11-27 18:03 UTC (permalink / raw)
  To: lee, Krzysztof Kozlowski, Sylwester Nawrocki, Chanwoo Choi,
	Peter Griffin, Alim Akhtar, Stephen Boyd, Brian Masney,
	Jerome Brunet, Rahul Sharma, Pankaj Dubey, Tomasz Figa,
	linux-samsung-soc, linux-clk, linux-arm-kernel, linux-kernel
  Cc: stable

_samsung_clk_register_pll() sizes each PLL rate table by scanning until
it encounters an entry with .rate == 0, then copies the counted entries
into pll->rate_table.  However, pll2550_24mhz_tbl and pll2650_24mhz_tbl
both omit a terminating zero sentinel, causing out-of-bounds reads into
adjacent read-only data and populating pll->rate_table with bogus
entries.

Append a sentinel entry to both PLL rate tables.

Fixes: d39e55e06371 ("clk/exynos5260: add clock file for exynos5260")
Cc: stable@vger.kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
---
 drivers/clk/samsung/clk-exynos5260.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/clk/samsung/clk-exynos5260.c b/drivers/clk/samsung/clk-exynos5260.c
index 0a5959823370..8417321c1202 100644
--- a/drivers/clk/samsung/clk-exynos5260.c
+++ b/drivers/clk/samsung/clk-exynos5260.c
@@ -59,6 +59,7 @@ static const struct samsung_pll_rate_table pll2550_24mhz_tbl[] __initconst = {
 	PLL_35XX_RATE(24 * MHZ, 266000000, 266, 3, 3),
 	PLL_35XX_RATE(24 * MHZ, 200000000, 200, 3, 3),
 	PLL_35XX_RATE(24 * MHZ, 160000000, 160, 3, 3),
+	{ /* sentinel */ }
 };
 
 /*
@@ -83,6 +84,7 @@ static const struct samsung_pll_rate_table pll2650_24mhz_tbl[] __initconst = {
 	PLL_36XX_RATE(24 * MHZ, 133000000, 266, 3, 4, 0),
 	PLL_36XX_RATE(24 * MHZ, 100000000, 200, 3, 4, 0),
 	PLL_36XX_RATE(24 * MHZ, 66000000, 176, 2, 5, 0),
+	{ /* sentinel */ }
 };
 
 /* CMU_AUD */
-- 
2.56.1.839.g22a8290db9-goog


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 07/12] clk: samsung: exynos5410: Terminate PLL rate table with sentinel
       [not found] <20261127180416.3277544-1-lee@kernel.org>
                   ` (5 preceding siblings ...)
  2026-11-27 18:03 ` [PATCH 06/12] clk: samsung: exynos5260: Terminate PLL rate tables with sentinels Lee Jones
@ 2026-11-27 18:03 ` Lee Jones
  2026-11-27 18:03 ` [PATCH 08/12] clk: samsung: exynos7885: " Lee Jones
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: Lee Jones @ 2026-11-27 18:03 UTC (permalink / raw)
  To: lee, Krzysztof Kozlowski, Sylwester Nawrocki, Chanwoo Choi,
	Peter Griffin, Alim Akhtar, Stephen Boyd, Brian Masney,
	Jerome Brunet, Tarek Dakhran, linux-samsung-soc, linux-clk,
	linux-arm-kernel, linux-kernel
  Cc: stable

_samsung_clk_register_pll() sizes each PLL rate table by scanning until
it encounters an entry with .rate == 0, then copies the counted entries
into pll->rate_table.  However, exynos5410_pll2550x_24mhz_tbl omits a
terminating zero sentinel, causing out-of-bounds reads into adjacent
read-only data and populating pll->rate_table with bogus entries.

Append a sentinel entry to exynos5410_pll2550x_24mhz_tbl.

Fixes: be95d2c7d918 ("clk: samsung: Add support for EPLL on exynos5410")
Cc: stable@vger.kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
---
 drivers/clk/samsung/clk-exynos5410.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/clk/samsung/clk-exynos5410.c b/drivers/clk/samsung/clk-exynos5410.c
index baa9988c7bb7..0036544bd77d 100644
--- a/drivers/clk/samsung/clk-exynos5410.c
+++ b/drivers/clk/samsung/clk-exynos5410.c
@@ -235,6 +235,7 @@ static const struct samsung_pll_rate_table exynos5410_pll2550x_24mhz_tbl[] __ini
 	PLL_36XX_RATE(24 * MHZ, 133000000U, 266, 3, 4, 0),
 	PLL_36XX_RATE(24 * MHZ, 100000000U, 200, 3, 4, 0),
 	PLL_36XX_RATE(24 * MHZ, 66000000U,  176, 2, 5, 0),
+	{ /* sentinel */ }
 };
 
 static struct samsung_pll_clock exynos5410_plls[nr_plls] __initdata = {
-- 
2.56.1.839.g22a8290db9-goog


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 08/12] clk: samsung: exynos7885: Terminate PLL rate table with sentinel
       [not found] <20261127180416.3277544-1-lee@kernel.org>
                   ` (6 preceding siblings ...)
  2026-11-27 18:03 ` [PATCH 07/12] clk: samsung: exynos5410: Terminate PLL rate table with sentinel Lee Jones
@ 2026-11-27 18:03 ` Lee Jones
  2026-11-27 18:03 ` [PATCH 09/12] clk: samsung: exynos850: " Lee Jones
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: Lee Jones @ 2026-11-27 18:03 UTC (permalink / raw)
  To: lee, Krzysztof Kozlowski, Sylwester Nawrocki, Chanwoo Choi,
	Peter Griffin, Alim Akhtar, Stephen Boyd, Brian Masney,
	Jerome Brunet, Danilo Krummrich,
	Uwe Kleine-König (The Capable Hub), Bjorn Helgaas,
	Takashi Sakamoto, Dávid Virág, linux-samsung-soc,
	linux-clk, linux-arm-kernel, linux-kernel
  Cc: stable

_samsung_clk_register_pll() sizes each PLL rate table by scanning until
it encounters an entry with .rate == 0, then copies the counted entries
into pll->rate_table.  However, pll_usb_rate_table omits a terminating
zero sentinel, causing out-of-bounds reads into adjacent read-only data
and populating pll->rate_table with bogus entries.

Append a sentinel entry to pll_usb_rate_table.

Fixes: 011a9de99793 ("clk: samsung: exynos7885: Add USB related clocks to CMU_FSYS")
Cc: stable@vger.kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
---
 drivers/clk/samsung/clk-exynos7885.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/clk/samsung/clk-exynos7885.c b/drivers/clk/samsung/clk-exynos7885.c
index 17c2a4fc1a55..6bde2437b0ff 100644
--- a/drivers/clk/samsung/clk-exynos7885.c
+++ b/drivers/clk/samsung/clk-exynos7885.c
@@ -729,6 +729,7 @@ static const unsigned long fsys_clk_regs[] __initconst = {
 
 static const struct samsung_pll_rate_table pll_usb_rate_table[] __initconst = {
 	PLL_35XX_RATE(26 * MHZ, 50000000U, 400, 13, 4),
+	{ /* sentinel */ }
 };
 
 static const struct samsung_pll_clock fsys_pll_clks[] __initconst = {
-- 
2.56.1.839.g22a8290db9-goog


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 09/12] clk: samsung: exynos850: Terminate PLL rate table with sentinel
       [not found] <20261127180416.3277544-1-lee@kernel.org>
                   ` (7 preceding siblings ...)
  2026-11-27 18:03 ` [PATCH 08/12] clk: samsung: exynos7885: " Lee Jones
@ 2026-11-27 18:03 ` Lee Jones
  2026-11-27 18:03 ` [PATCH 10/12] clk: samsung: exynos8895: Terminate PLL rate tables with sentinels Lee Jones
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: Lee Jones @ 2026-11-27 18:03 UTC (permalink / raw)
  To: lee, Sam Protsenko, Krzysztof Kozlowski, Sylwester Nawrocki,
	Chanwoo Choi, Peter Griffin, Alim Akhtar, Stephen Boyd,
	Brian Masney, Jerome Brunet, Alexey Klimov, linux-arm-kernel,
	linux-samsung-soc, linux-clk, linux-kernel
  Cc: stable

_samsung_clk_register_pll() sizes each PLL rate table by scanning until
it encounters an entry with .rate == 0, then copies the counted entries
into pll->rate_table.  However, cpu_pll_rates omits a terminating zero
sentinel, causing out-of-bounds reads into adjacent read-only data and
populating pll->rate_table with bogus entries.

Append a sentinel entry to cpu_pll_rates.

Fixes: dedf87341ad6 ("clk: samsung: exynos850: Add CMU_CPUCL0 and CMU_CPUCL1")
Cc: stable@vger.kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
---
 drivers/clk/samsung/clk-exynos850.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/clk/samsung/clk-exynos850.c b/drivers/clk/samsung/clk-exynos850.c
index ebcdde93bd46..9ac311161a3e 100644
--- a/drivers/clk/samsung/clk-exynos850.c
+++ b/drivers/clk/samsung/clk-exynos850.c
@@ -1180,6 +1180,7 @@ static const struct samsung_pll_rate_table cpu_pll_rates[] __initconst = {
 	PLL_35XX_RATE(26 * MHZ, 247000000U,  114, 3, 2),
 	PLL_35XX_RATE(26 * MHZ, 182000000U,  168, 3, 3),
 	PLL_35XX_RATE(26 * MHZ, 130000000U,  120, 3, 3),
+	{ /* sentinel */ }
 };
 
 static const struct samsung_pll_clock cpucl0_pll_clks[] __initconst = {
-- 
2.56.1.839.g22a8290db9-goog


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 10/12] clk: samsung: exynos8895: Terminate PLL rate tables with sentinels
       [not found] <20261127180416.3277544-1-lee@kernel.org>
                   ` (8 preceding siblings ...)
  2026-11-27 18:03 ` [PATCH 09/12] clk: samsung: exynos850: " Lee Jones
@ 2026-11-27 18:03 ` Lee Jones
  2026-11-27 18:03 ` [PATCH 11/12] clk: samsung: exynosautov920: Terminate PLL rate table with sentinel Lee Jones
  2026-11-27 18:03 ` [PATCH 12/12] clk: samsung: fsd: Terminate PLL rate tables with sentinels Lee Jones
  11 siblings, 0 replies; 12+ messages in thread
From: Lee Jones @ 2026-11-27 18:03 UTC (permalink / raw)
  To: lee, Krzysztof Kozlowski, Sylwester Nawrocki, Chanwoo Choi,
	Peter Griffin, Alim Akhtar, Stephen Boyd, Brian Masney,
	Jerome Brunet, Uwe Kleine-König (The Capable Hub),
	Bjorn Helgaas, Takashi Sakamoto, Danilo Krummrich, Ivaylo Ivanov,
	linux-samsung-soc, linux-clk, linux-arm-kernel, linux-kernel
  Cc: stable

_samsung_clk_register_pll() sizes each PLL rate table by scanning until
it encounters an entry with .rate == 0, then copies the counted entries
into pll->rate_table.  However, pll_shared0_rate_table,
pll_shared1_rate_table, pll_shared2_rate_table, pll_shared3_rate_table,
and pll_shared4_rate_table all omit a terminating zero sentinel, causing
out-of-bounds reads into adjacent read-only data and populating
pll->rate_table with bogus entries.

Append a sentinel entry to each of the 5 PLL rate tables.

Fixes: 9174fac3b302 ("clk: samsung: Introduce Exynos8895 clock driver")
Cc: stable@vger.kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
---
 drivers/clk/samsung/clk-exynos8895.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/clk/samsung/clk-exynos8895.c b/drivers/clk/samsung/clk-exynos8895.c
index 259481c4276e..daf337f47e4f 100644
--- a/drivers/clk/samsung/clk-exynos8895.c
+++ b/drivers/clk/samsung/clk-exynos8895.c
@@ -478,22 +478,27 @@ static const unsigned long top_clk_regs[] __initconst = {
 
 static const struct samsung_pll_rate_table pll_shared0_rate_table[] __initconst = {
 	PLL_35XX_RATE(26 * MHZ, 2132000000U, 328, 4, 0),
+	{ /* sentinel */ }
 };
 
 static const struct samsung_pll_rate_table pll_shared1_rate_table[] __initconst = {
 	PLL_35XX_RATE(26 * MHZ, 1865500000U, 287, 4, 0),
+	{ /* sentinel */ }
 };
 
 static const struct samsung_pll_rate_table pll_shared2_rate_table[] __initconst = {
 	PLL_35XX_RATE(26 * MHZ, 800000000U, 400, 13, 0),
+	{ /* sentinel */ }
 };
 
 static const struct samsung_pll_rate_table pll_shared3_rate_table[] __initconst = {
 	PLL_35XX_RATE(26 * MHZ, 630000000U, 315, 13, 0),
+	{ /* sentinel */ }
 };
 
 static const struct samsung_pll_rate_table pll_shared4_rate_table[] __initconst = {
 	PLL_35XX_RATE(26 * MHZ, 667333333U, 154, 6, 0),
+	{ /* sentinel */ }
 };
 
 static const struct samsung_pll_clock top_pll_clks[] __initconst = {
-- 
2.56.1.839.g22a8290db9-goog


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 11/12] clk: samsung: exynosautov920: Terminate PLL rate table with sentinel
       [not found] <20261127180416.3277544-1-lee@kernel.org>
                   ` (9 preceding siblings ...)
  2026-11-27 18:03 ` [PATCH 10/12] clk: samsung: exynos8895: Terminate PLL rate tables with sentinels Lee Jones
@ 2026-11-27 18:03 ` Lee Jones
  2026-11-27 18:03 ` [PATCH 12/12] clk: samsung: fsd: Terminate PLL rate tables with sentinels Lee Jones
  11 siblings, 0 replies; 12+ messages in thread
From: Lee Jones @ 2026-11-27 18:03 UTC (permalink / raw)
  To: lee, Krzysztof Kozlowski, Sylwester Nawrocki, Chanwoo Choi,
	Peter Griffin, Alim Akhtar, Stephen Boyd, Brian Masney,
	Jerome Brunet, Raghav Sharma,
	Uwe Kleine-König (The Capable Hub), Sunyeal Hong, Shin Son,
	linux-samsung-soc, linux-clk, linux-arm-kernel, linux-kernel
  Cc: stable

_samsung_clk_register_pll() sizes each PLL rate table by scanning until
it encounters an entry with .rate == 0, then copies the counted entries
into pll->rate_table.  However, cpu_pll_rates omits a terminating zero
sentinel, causing out-of-bounds reads into adjacent read-only data and
populating pll->rate_table with bogus entries.

Append a sentinel entry to cpu_pll_rates.

Fixes: 59636ec89c2c ("clk: samsung: exynosautov920: add cpucl0 clock support")
Cc: stable@vger.kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
---
 drivers/clk/samsung/clk-exynosautov920.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/clk/samsung/clk-exynosautov920.c b/drivers/clk/samsung/clk-exynosautov920.c
index a938f3cc7b57..7c4e9ab25624 100644
--- a/drivers/clk/samsung/clk-exynosautov920.c
+++ b/drivers/clk/samsung/clk-exynosautov920.c
@@ -1077,6 +1077,7 @@ static const struct samsung_pll_rate_table cpu_pll_rates[] __initconst = {
 	PLL_35XX_RATE(38400000U, 1152000000U, 120, 4, 0),
 	PLL_35XX_RATE(38400000U, 576000000U, 120, 4, 1),
 	PLL_35XX_RATE(38400000U, 288000000U, 120, 4, 2),
+	{ /* sentinel */ }
 };
 
 static const struct samsung_pll_clock cpucl0_pll_clks[] __initconst = {
-- 
2.56.1.839.g22a8290db9-goog


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 12/12] clk: samsung: fsd: Terminate PLL rate tables with sentinels
       [not found] <20261127180416.3277544-1-lee@kernel.org>
                   ` (10 preceding siblings ...)
  2026-11-27 18:03 ` [PATCH 11/12] clk: samsung: exynosautov920: Terminate PLL rate table with sentinel Lee Jones
@ 2026-11-27 18:03 ` Lee Jones
  11 siblings, 0 replies; 12+ messages in thread
From: Lee Jones @ 2026-11-27 18:03 UTC (permalink / raw)
  To: lee, Krzysztof Kozlowski, Sylwester Nawrocki, Chanwoo Choi,
	Peter Griffin, Alim Akhtar, Stephen Boyd, Brian Masney,
	Jerome Brunet, Danilo Krummrich, Bjorn Helgaas, Takashi Sakamoto,
	Uwe Kleine-König (The Capable Hub), Pankaj Dubey, Ajay Kumar,
	Jayati Sahu, Smitha T Murthy, Sathyakam M, linux-samsung-soc,
	linux-clk, linux-kernel
  Cc: stable

_samsung_clk_register_pll() sizes each PLL rate table by scanning until
it encounters an entry with .rate == 0, then copies the counted entries
into pll->rate_table.  However, pll_shared0_rate_table,
pll_shared1_rate_table, pll_shared2_rate_table, pll_shared3_rate_table,
pll_mfc_rate_table, and pll_cam_csi_rate_table all omit a terminating
zero sentinel, causing out-of-bounds reads into adjacent read-only data
and populating pll->rate_table with bogus entries.

Append a sentinel entry to each of the 6 PLL rate tables.

Fixes: 4f346005aaed ("clk: samsung: fsd: Add initial clock support")
Fixes: 75c50afaa0d9 ("clk: samsung: fsd: Add cmu_mfc block clock information")
Fixes: b826c3e4de1a ("clk: samsung: fsd: Add cam_csi block clock information")
Cc: stable@vger.kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
---
 drivers/clk/samsung/clk-fsd.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/clk/samsung/clk-fsd.c b/drivers/clk/samsung/clk-fsd.c
index 0a0bf1d62a04..ded7bfa97234 100644
--- a/drivers/clk/samsung/clk-fsd.c
+++ b/drivers/clk/samsung/clk-fsd.c
@@ -155,18 +155,22 @@ static const unsigned long cmu_clk_regs[] __initconst = {
 
 static const struct samsung_pll_rate_table pll_shared0_rate_table[] __initconst = {
 	PLL_35XX_RATE(24 * MHZ, 2000000000U, 250, 3, 0),
+	{ /* sentinel */ }
 };
 
 static const struct samsung_pll_rate_table pll_shared1_rate_table[] __initconst = {
 	PLL_35XX_RATE(24 * MHZ, 2400000000U, 200, 2, 0),
+	{ /* sentinel */ }
 };
 
 static const struct samsung_pll_rate_table pll_shared2_rate_table[] __initconst = {
 	PLL_35XX_RATE(24 * MHZ, 2400000000U, 200, 2, 0),
+	{ /* sentinel */ }
 };
 
 static const struct samsung_pll_rate_table pll_shared3_rate_table[] __initconst = {
 	PLL_35XX_RATE(24 * MHZ, 1800000000U, 150, 2, 0),
+	{ /* sentinel */ }
 };
 
 static const struct samsung_pll_clock cmu_pll_clks[] __initconst = {
@@ -1482,6 +1486,7 @@ static const unsigned long mfc_clk_regs[] __initconst = {
 
 static const struct samsung_pll_rate_table pll_mfc_rate_table[] __initconst = {
 	PLL_35XX_RATE(24 * MHZ, 666000000U, 111, 4, 0),
+	{ /* sentinel */ }
 };
 
 static const struct samsung_pll_clock mfc_pll_clks[] __initconst = {
@@ -1642,6 +1647,7 @@ static const unsigned long cam_csi_clk_regs[] __initconst = {
 
 static const struct samsung_pll_rate_table pll_cam_csi_rate_table[] __initconst = {
 	PLL_35XX_RATE(24 * MHZ, 1066000000U, 533, 12, 0),
+	{ /* sentinel */ }
 };
 
 static const struct samsung_pll_clock cam_csi_pll_clks[] __initconst = {
-- 
2.56.1.839.g22a8290db9-goog


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2026-11-27 18:06 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20261127180416.3277544-1-lee@kernel.org>
2026-11-27 18:03 ` [PATCH 01/12] clk: samsung: exynos5-subcmu: Detach power domain on add failure Lee Jones
2026-11-27 18:03 ` [PATCH 02/12] clk: samsung: exynos-arm64: Do not store ERR_PTR in data->clk Lee Jones
2026-11-27 18:03 ` [PATCH 03/12] clk: samsung: artpec8: Terminate PLL rate table with sentinel Lee Jones
2026-11-27 18:03 ` [PATCH 04/12] clk: samsung: artpec9: Terminate PLL rate tables with sentinels Lee Jones
2026-11-27 18:03 ` [PATCH 05/12] clk: samsung: exynos5250: Terminate PLL rate table with sentinel Lee Jones
2026-11-27 18:03 ` [PATCH 06/12] clk: samsung: exynos5260: Terminate PLL rate tables with sentinels Lee Jones
2026-11-27 18:03 ` [PATCH 07/12] clk: samsung: exynos5410: Terminate PLL rate table with sentinel Lee Jones
2026-11-27 18:03 ` [PATCH 08/12] clk: samsung: exynos7885: " Lee Jones
2026-11-27 18:03 ` [PATCH 09/12] clk: samsung: exynos850: " Lee Jones
2026-11-27 18:03 ` [PATCH 10/12] clk: samsung: exynos8895: Terminate PLL rate tables with sentinels Lee Jones
2026-11-27 18:03 ` [PATCH 11/12] clk: samsung: exynosautov920: Terminate PLL rate table with sentinel Lee Jones
2026-11-27 18:03 ` [PATCH 12/12] clk: samsung: fsd: Terminate PLL rate tables with sentinels Lee Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox