[PW_SID:1078450] clk: microchip: mpfs-ccc: fix out-of-bounds write#1740
[PW_SID:1078450] clk: microchip: mpfs-ccc: fix out-of-bounds write#1740linux-riscv-bot wants to merge 1 commit into
Conversation
Issue was allocated array size for clk_data. When clocks are being registered their index is taken from defines in dt-bindings. The last 2 clocks had their index outside of allocated range. Two defines (CLK_CCC_DLL0, CLK_CCC_DLL1) were not used and skipped over which was not taken into account when allocating the array. This patch is minimal change to resolve the issue. Issue was found using KASAN when debugging unrelated xdma driver issue. Consequently fixing this issue also resolved xdma driver issue. Related dmesg output: [ 0.290703] BUG: KASAN: slab-out-of-bounds in mpfs_ccc_register_outputs.constprop.0+0xd0/0x1fa [ 0.290984] Write of size 8 at addr ffffffe7be6e3ca8 by task swapper/0/1 [ 0.291253] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 6.1.43-linux4microchip+fpga-2023.09 #1 [ 0.291482] Hardware name: Skylabs HPC (DT) [ 0.291611] Call Trace: ... [ 0.292999] [<ffffffff808508c8>] mpfs_ccc_register_outputs.constprop.0+0xd0/0x1fa [ 0.293245] [<ffffffff80850b66>] mpfs_ccc_probe+0x174/0x30e [ 0.293437] [<ffffffff808d4af2>] platform_probe+0x74/0xba ... Fixes: d39fb17 ("clk: microchip: add PolarFire SoC fabric clock support") Signed-off-by: Aleš Pečnik <ales.pecnik@skylabs.si> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
|
Patch 1: "clk: microchip: mpfs-ccc: fix out-of-bounds write" |
|
Patch 1: "clk: microchip: mpfs-ccc: fix out-of-bounds write" |
|
Patch 1: "clk: microchip: mpfs-ccc: fix out-of-bounds write" |
|
Patch 1: "clk: microchip: mpfs-ccc: fix out-of-bounds write" |
|
Patch 1: "clk: microchip: mpfs-ccc: fix out-of-bounds write" |
|
Patch 1: "clk: microchip: mpfs-ccc: fix out-of-bounds write" |
|
Patch 1: "clk: microchip: mpfs-ccc: fix out-of-bounds write" |
|
Patch 1: "clk: microchip: mpfs-ccc: fix out-of-bounds write" |
|
Patch 1: "clk: microchip: mpfs-ccc: fix out-of-bounds write" |
|
Patch 1: "clk: microchip: mpfs-ccc: fix out-of-bounds write" |
|
Patch 1: "clk: microchip: mpfs-ccc: fix out-of-bounds write" |
|
Patch 1: "clk: microchip: mpfs-ccc: fix out-of-bounds write" |
PR for series 1078450 applied to workflow__riscv__fixes
Name: clk: microchip: mpfs-ccc: fix out-of-bounds write
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1078450
Version: 1