diff options
| author | Yu-Che Cheng <[email protected]> | 2023-12-06 15:17:25 -0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <[email protected]> | 2023-12-15 17:27:04 +0100 |
| commit | e821d50ab5b956ed0effa49faaf29912fd4106d9 (patch) | |
| tree | 22dbbdd89dfb82a8c6ad175c228ff884914e0b6d /tools/perf/scripts/python/sched-migration.py | |
| parent | f200fff8d019f2754f91f5d715652e3e3fdf3604 (diff) | |
spmi: mediatek: Fix UAF on device remove
The pmif driver data that contains the clocks is allocated along with
spmi_controller.
On device remove, spmi_controller will be freed first, and then devres
, including the clocks, will be cleanup.
This leads to UAF because putting the clocks will access the clocks in
the pmif driver data, which is already freed along with spmi_controller.
This can be reproduced by enabling DEBUG_TEST_DRIVER_REMOVE and
building the kernel with KASAN.
Fix the UAF issue by using unmanaged clk_bulk_get() and putting the
clocks before freeing spmi_controller.
Reported-by: Fei Shao <[email protected]>
Signed-off-by: Yu-Che Cheng <[email protected]>
Link: https://lore.kernel.org/r/20230717173934.1.If004a6e055a189c7f2d0724fa814422c26789839@changeid
Tested-by: Fei Shao <[email protected]>
Reviewed-by: Fei Shao <[email protected]>
Reviewed-by: Chen-Yu Tsai <[email protected]>
Signed-off-by: Stephen Boyd <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/sched-migration.py')
0 files changed, 0 insertions, 0 deletions