msm: thermal: Register for panic notifier on successful probe
Register for panic notification from KTM only on successful probe.
This avoids invalid memory access during early boot from KTM
panic notification callback, in case probe has deferred.
==================================================================
BUG: KASan: out of bounds access in msm_tsens_get_temp+0x51c/0x60c at
addr ffffffc0bc6e0b00
Write of size 8 by task kworker/0:1/42
==========================================================================
BUG kmalloc-128 (Tainted: G B W ): kasan: bad access detected
--------------------------------------------------------------------------
Call trace:
[<ffffffc000089df4>] dump_backtrace+0x0/0x1c4
[<ffffffc000089fc8>] show_stack+0x10/0x1c
[<ffffffc0010cb218>] dump_stack+0x74/0xc8
[<ffffffc000208d60>] print_trailer+0x14c/0x160
[<ffffffc000209124>] object_err+0x38/0x4c
[<ffffffc00020e1c8>] kasan_report_error+0x244/0x40c
[<ffffffc00020e46c>] kasan_report+0x34/0x40
[<ffffffc00020d484>] __asan_store8+0x88/0x94
[<ffffffc000ab9280>] msm_tsens_get_temp+0x518/0x60c
[<ffffffc000aba7c4>] tsens_get_temp+0x68/0x80
[<ffffffc000ac2518>] therm_get_temp+0xd0/0x16c
[<ffffffc000ac2618>] msm_thermal_panic_callback+0x64/0xc8
[<ffffffc0000d17d4>] notifier_call_chain+0x68/0xb4
[<ffffffc0000d197c>] __atomic_notifier_call_chain+0x40/0x64
[<ffffffc0000d19b0>] atomic_notifier_call_chain+0x10/0x1c
[<ffffffc0010c9b40>] panic+0x1e0/0x3c8
[<ffffffc0006081d0>] device_restart_work_hdlr+0xa8/0xac
[<ffffffc0000c8d9c>] process_one_work+0x394/0x650
[<ffffffc0000ca10c>] worker_thread+0x3bc/0x550
[<ffffffc0000d05cc>] kthread+0x180/0x194
Memory state around the buggy address:
ffffffc0bc6e0a00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffffffc0bc6e0a80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffffffc0bc6e0b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
^
ffffffc0bc6e0b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffffffc0bc6e0c00: fc fc fc fc fc fc fc fc 00 00 00 00 00 00 00 00
==================================================================
CRs-Fixed: 860376
Change-Id: Icfd6c859e21a025889c62a8945cd902c0496edc8
Signed-off-by:
Ram Chandrasekar <rkumbako@codeaurora.org>
Loading
Please register or sign in to comment