In the Linux kernel, the following vulnerability has been resolved: 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.
4.13.0-16.195.3.0-18.195.3.0-24.265.4.0-9.123.11.0-12.195.13.0-19.194.2.0-16.194.2.0-17.214.2.0-19.234.3.0-1.104.3.0-2.114.3.0-5.164.3.0-6.174.3.0-7.184.4.0-2.166.8.0-31.316.5.0-9.96.6.0-14.146.8.0-11.115.19.0-1007.7~22.04.15.19.0-1009.9~22.04.15.19.0-1010.10~22.04.15.19.0-1011.11~22.04.15.19.0-1012.12~22.04.15.19.0-1013.13~22.04.15.19.0-1014.14~22.04.15.19.0-1015.15~22.04.16.5.0-1008.86.6.0-1001.16.8.0-1001.15.3.0-1003.35.3.0-1008.95.3.0-1009.105.3.0-1010.115.4.0-1005.5Exploitability
AV:NAC:LPR:HUI:NScope
S:UImpact
C:LI:LA:NCVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:L/I:L/A:N