android_kernel_motorola_sm6375/drivers/clk
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Linus Walleij b40facee46 clk: kirkwood: Fix a clocking boot regression
commit aaedb9e00e5400220a8871180d23a83e67f29f63 upstream.

Since a few kernel releases the Pogoplug 4 has crashed like this
during boot:

Unable to handle kernel NULL pointer dereference at virtual address 00000002
(...)
[<c04116ec>] (strlen) from [<c00ead80>] (kstrdup+0x1c/0x4c)
[<c00ead80>] (kstrdup) from [<c04591d8>] (__clk_register+0x44/0x37c)
[<c04591d8>] (__clk_register) from [<c04595ec>] (clk_hw_register+0x20/0x44)
[<c04595ec>] (clk_hw_register) from [<c045bfa8>] (__clk_hw_register_mux+0x198/0x1e4)
[<c045bfa8>] (__clk_hw_register_mux) from [<c045c050>] (clk_register_mux_table+0x5c/0x6c)
[<c045c050>] (clk_register_mux_table) from [<c0acf3e0>] (kirkwood_clk_muxing_setup.constprop.0+0x13c/0x1ac)
[<c0acf3e0>] (kirkwood_clk_muxing_setup.constprop.0) from [<c0aceae0>] (of_clk_init+0x12c/0x214)
[<c0aceae0>] (of_clk_init) from [<c0ab576c>] (time_init+0x20/0x2c)
[<c0ab576c>] (time_init) from [<c0ab3d18>] (start_kernel+0x3dc/0x56c)
[<c0ab3d18>] (start_kernel) from [<00000000>] (0x0)
Code: e3130020 1afffffb e12fff1e c08a1078 (e5d03000)

This is because the "powersave" mux clock 0 was provided in an unterminated
array, which is required by the loop in the driver:

        /* Count, allocate, and register clock muxes */
        for (n = 0; desc[n].name;)
                n++;

Here n will go out of bounds and then call clk_register_mux() on random
memory contents after the mux clock.

Fix this by terminating the array with a blank entry.

Fixes: 105299381d ("cpufreq: kirkwood: use the powersave multiplexer")
Cc: stable@vger.kernel.org
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: Chris Packham <chris.packham@alliedtelesis.co.nz>
Cc: Gregory CLEMENT <gregory.clement@bootlin.com>
Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20210814235514.403426-1-linus.walleij@linaro.org
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-09-15 09:47:41 +02:00
..
actions clk: actions: Fix bisp_factor_table based clocks on Owl S500 SoC 2021-07-14 16:53:34 +02:00
analogbits
at91 clk: at91: sam9x60: remove atmel,osc-bypass support 2020-12-30 11:51:29 +01:00
axis
axs10x
bcm clk: bcm2835: add missing release if devm_clk_hw_register fails 2020-10-29 09:57:55 +01:00
berlin
davinci clk: davinci: Use the correct size when allocating memory 2020-09-23 12:40:38 +02:00
h8300
hisilicon
imgtec
imx clk: imx8mq: Fix usdhc parents order 2020-10-29 09:57:56 +01:00
ingenic clk: ingenic: Fix divider calculation with div tables 2020-12-30 11:51:45 +01:00
keystone clk: keystone: sci-clk: fix parsing assigned-clock data during probe 2020-10-29 09:57:54 +01:00
loongson1
mediatek clk: mediatek: add UART0 clock support 2020-10-29 09:57:54 +01:00
meson clk: meson: g12a: fix gp0 and hifi ranges 2021-07-14 16:53:26 +02:00
microchip
mmp clk: mmp2: Fix the order of timer mux parents 2020-02-05 21:22:43 +00:00
mvebu clk: kirkwood: Fix a clocking boot regression 2021-09-15 09:47:41 +02:00
mxs
nxp
pistachio
pxa clk: pxa: fix one of the pxa RTC clocks 2020-01-04 19:18:11 +01:00
qcom clk: qcom: a53-pll: Add missing MODULE_DEVICE_TABLE 2021-05-14 09:44:25 +02:00
renesas clk: renesas: r8a77995: Add ZA2 clock 2021-07-19 08:53:09 +02:00
rockchip clk: rockchip: Initialize hw to error to avoid undefined behavior 2020-10-29 09:57:54 +01:00
samsung clk: exynos7: Mark aclk_fsys1_200 as critical 2021-05-19 10:08:33 +02:00
sifive clk: sifive: allocate sufficient memory for struct __prci_data 2020-06-30 15:37:01 -04:00
sirf clk: clk-atlas6: fix return value check in atlas6_clk_init() 2020-08-21 13:05:34 +02:00
socfpga clk: socfpga: arria10: Fix memory leak of socfpga_clk on error return 2021-05-11 14:04:10 +02:00
spear
sprd clk: sprd: return correct type of value for _sprd_pll_recalc_rate 2020-06-24 17:50:35 +02:00
st clk: clk-flexgen: fix clock-critical handling 2020-06-24 17:50:17 +02:00
sunxi clk: sunxi: Fix incorrect usage of round_down() 2020-06-24 17:50:08 +02:00
sunxi-ng clk: sunxi-ng: h6: Fix clock divider range on some clocks 2021-03-04 10:26:29 +01:00
tegra clk: tegra: Ensure that PLLU configuration is applied properly 2021-07-19 08:53:09 +02:00
ti clocksource/drivers/timer-ti-dm: Handle dra7 timer wrap errata i940 2021-06-23 14:41:31 +02:00
uniphier clk: uniphier: Fix potential infinite loop 2021-05-14 09:44:25 +02:00
ux500
versatile
x86
zte
zynq
zynqmp clk: zynqmp: move zynqmp_pll_set_mode out of round_rate callback 2021-05-14 09:44:24 +02:00
clk-asm9260.c
clk-aspeed.c
clk-aspeed.h
clk-ast2600.c media: aspeed: fix clock handling logic 2021-05-14 09:44:23 +02:00
clk-axi-clkgen.c
clk-axm5516.c
clk-bd718x7.c
clk-bulk.c
clk-cdce706.c
clk-cdce925.c
clk-clps711x.c
clk-composite.c
clk-conf.c
clk-cs2000-cp.c
clk-devres.c clk: fix leak on devm_clk_bulk_get_all() unwind 2021-08-12 13:21:00 +02:00
clk-divider.c
clk-efm32gg.c
clk-fixed-factor.c
clk-fixed-mmio.c
clk-fixed-rate.c
clk-fractional-divider.c
clk-gate.c
clk-gemini.c
clk-gpio.c clk: clk-gpio: propagate rate change to parent 2020-01-04 19:17:21 +01:00
clk-hi655x.c
clk-highbank.c
clk-hsdk-pll.c
clk-lochnagar.c
clk-max9485.c
clk-max77686.c
clk-milbeaut.c
clk-moxart.c
clk-multiplier.c
clk-mux.c
clk-nomadik.c
clk-npcm7xx.c
clk-nspire.c
clk-oxnas.c
clk-palmas.c
clk-pwm.c
clk-qoriq.c
clk-rk808.c
clk-s2mps11.c clk: s2mps11: Fix a resource leak in error handling paths in the probe function 2020-12-30 11:51:29 +01:00
clk-scmi.c clk: scmi: Fix min and max rate when registering clocks with discrete rates 2020-08-19 08:15:55 +02:00
clk-scpi.c
clk-si514.c
clk-si544.c
clk-si570.c
clk-si5341.c clk: si5341: Update initialization magic 2021-07-14 16:53:35 +02:00
clk-si5351.c
clk-si5351.h
clk-stm32f4.c clk: stm32f4: fix post divisor setup for I2S/SAI PLLs 2021-08-12 13:20:55 +02:00
clk-stm32h7.c
clk-stm32mp1.c
clk-tango4.c
clk-twl6040.c
clk-u300.c
clk-versaclock5.c
clk-vt8500.c
clk-wm831x.c
clk-xgene.c
clk.c clk: fix invalid usage of list cursor in unregister 2021-04-14 08:24:17 +02:00
clk.h
clkdev.c
Kconfig
Makefile