linux-stable/drivers/clk/microchip
Conor Dooley 5b4052aa95 clk: microchip: fix potential UAF in auxdev release callback
commit 7455b7007b upstream.

Similar to commit 1c11289b34 ("peci: cpu: Fix use-after-free in
adev_release()"), the auxiliary device is not torn down in the correct
order. If auxiliary_device_add() fails, the release callback will be
called twice, resulting in a UAF. Due to timing, the auxdev code in this
driver "took inspiration" from the aforementioned commit, and thus its
bugs too!

Moving auxiliary_device_uninit() to the unregister callback instead
avoids the issue.

CC: stable@vger.kernel.org
Fixes: b56bae2dd6 ("clk: microchip: mpfs: add reset controller")
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20230413-critter-synopsis-dac070a86cb4@spud
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-05-11 23:03:40 +09:00
..
clk-core.c clk: let init callback return an error code 2019-12-23 18:53:13 -08:00
clk-core.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 445 2019-06-05 17:37:18 +02:00
clk-mpfs-ccc.c clk: microchip: mpfs-ccc: Use devm_kasprintf() for allocating formatted strings 2023-02-14 19:11:50 +01:00
clk-mpfs.c clk: microchip: fix potential UAF in auxdev release callback 2023-05-11 23:03:40 +09:00
clk-pic32mzda.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 445 2019-06-05 17:37:18 +02:00
Kconfig clk: microchip: mpfs: add reset controller 2022-09-14 10:55:17 +03:00
Makefile clk: microchip: add PolarFire SoC fabric clock support 2022-09-14 10:57:07 +03:00