UBSAN: array-index-out-of-bounds in drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu7_hwmgr.c (kernel 6.5)
Brief summary of the problem:
Encountered in linux 6.5.x dmesg log
[ 9.491376] ================================================================================ [ 9.491381] UBSAN: array-index-out-of-bounds in drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu7_hwmgr.c:3669:4 [ 9.491384] index 2 is out of range for type 'ATOM_Tonga_MCLK_Dependency_Record [1]' [ 9.491386] CPU: 9 PID: 386 Comm: systemd-udevd Not tainted 6.5.5-custom #5 [ 9.491388] Hardware name: Micro-Star International Co., Ltd. MS-7D59/PRO B660-A DDR4 (MS-7D59), BIOS 1.10 03/04/2022 [ 9.491388] Call Trace: [ 9.491390] [ 9.491391] dump_stack_lvl+0x48/0x70 [ 9.491395] dump_stack+0x10/0x20 [ 9.491397] __ubsan_handle_out_of_bounds+0xc6/0x110 [ 9.491399] smu7_get_pp_table_entry_callback_func_v1+0x826/0xa00 [amdgpu] [ 9.491686] ? vi_pcie_rreg+0x6e/0x90 [amdgpu] [ 9.491870] ? __pfx_smu7_get_pp_table_entry_callback_func_v1+0x10/0x10 [amdgpu] [ 9.492107] get_powerplay_table_entry_v1_0+0xf5/0x490 [amdgpu] [ 9.492339] smu7_get_pp_table_entry+0x22c/0x950 [amdgpu] [ 9.492566] ? __kmalloc+0x4d/0xd0 [ 9.492569] psm_init_power_state_table+0x15e/0x250 [amdgpu] [ 9.492808] hwmgr_hw_init+0xe3/0x1e0 [amdgpu] [ 9.493109] pp_hw_init+0x16/0x50 [amdgpu] [ 9.493426] amdgpu_device_init+0x21ef/0x2b10 [amdgpu] [ 9.493715] ? pci_bus_read_config_word+0x47/0x90 [ 9.493719] amdgpu_driver_load_kms+0x1a/0x1c0 [amdgpu] [ 9.494007] amdgpu_pci_probe+0x182/0x450 [amdgpu] [ 9.494295] local_pci_probe+0x44/0xb0 [ 9.494298] pci_device_probe+0xc5/0x280 [ 9.494300] really_probe+0x1c9/0x430 [ 9.494303] __driver_probe_device+0x8c/0x190 [ 9.494305] driver_probe_device+0x24/0xd0 [ 9.494306] __driver_attach+0x10b/0x210 [ 9.494308] ? __pfx___driver_attach+0x10/0x10 [ 9.494310] bus_for_each_dev+0x8a/0xf0 [ 9.494313] driver_attach+0x1e/0x30 [ 9.494314] bus_add_driver+0x127/0x240 [ 9.494316] driver_register+0x5e/0x130 [ 9.494318] ? __pfx_amdgpu_init+0x10/0x10 [amdgpu] [ 9.494605] __pci_register_driver+0x62/0x70 [ 9.494607] amdgpu_init+0x69/0xff0 [amdgpu] [ 9.494894] do_one_initcall+0x5b/0x340 [ 9.494898] do_init_module+0x68/0x260 [ 9.494901] load_module+0x21a9/0x2510 [ 9.494905] init_module_from_file+0x97/0xe0 [ 9.494907] ? init_module_from_file+0x97/0xe0 [ 9.494910] idempotent_init_module+0x11c/0x2b0 [ 9.494913] __x64_sys_finit_module+0x64/0xd0 [ 9.494916] do_syscall_64+0x58/0x90 [ 9.494918] ? do_syscall_64+0x67/0x90 [ 9.494919] ? sysvec_call_function+0x4b/0xd0 [ 9.494920] entry_SYSCALL_64_after_hwframe+0x6e/0xd8 [ 9.494922] RIP: 0033:0x7fc9ea51589d [ 9.494925] Code: 5d c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 4b 05 0e 00 f7 d8 64 89 01 48 [ 9.494926] RSP: 002b:00007fff123911c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000139 [ 9.494928] RAX: ffffffffffffffda RBX: 00005622e67ac950 RCX: 00007fc9ea51589d [ 9.494929] RDX: 0000000000000000 RSI: 00005622e68f18b0 RDI: 0000000000000018 [ 9.494930] RBP: 00005622e68f18b0 R08: 0000000000000000 R09: 00007fff123912f0 [ 9.494931] R10: 0000000000000018 R11: 0000000000000246 R12: 0000000000020000 [ 9.494932] R13: 00005622e67a8d30 R14: 0000000000000000 R15: 00005622e68f1e70 [ 9.494934] [ 9.494938] ================================================================================ [ 9.494941] ================================================================================ [ 9.494942] UBSAN: array-index-out-of-bounds in drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu7_hwmgr.c:3676:4 [ 9.494945] index 7 is out of range for type 'ATOM_Polaris_SCLK_Dependency_Record [1]' [ 9.494947] CPU: 9 PID: 386 Comm: systemd-udevd Not tainted 6.5.5-custom #5 [ 9.494948] Hardware name: Micro-Star International Co., Ltd. MS-7D59/PRO B660-A DDR4 (MS-7D59), BIOS 1.10 03/04/2022 [ 9.494949] Call Trace: [ 9.494949] [ 9.494950] dump_stack_lvl+0x48/0x70 [ 9.494953] dump_stack+0x10/0x20 [ 9.494954] __ubsan_handle_out_of_bounds+0xc6/0x110 [ 9.494956] smu7_get_pp_table_entry_callback_func_v1+0x9b7/0xa00 [amdgpu] [ 9.495194] ? vi_pcie_rreg+0x6e/0x90 [amdgpu] [ 9.495376] ? __pfx_smu7_get_pp_table_entry_callback_func_v1+0x10/0x10 [amdgpu] [ 9.495618] get_powerplay_table_entry_v1_0+0xf5/0x490 [amdgpu] [ 9.495852] smu7_get_pp_table_entry+0x22c/0x950 [amdgpu] [ 9.496080] ? __kmalloc+0x4d/0xd0 [ 9.496083] psm_init_power_state_table+0x15e/0x250 [amdgpu] [ 9.496322] hwmgr_hw_init+0xe3/0x1e0 [amdgpu] [ 9.496555] pp_hw_init+0x16/0x50 [amdgpu] [ 9.496795] amdgpu_device_init+0x21ef/0x2b10 [amdgpu] [ 9.497034] ? pci_bus_read_config_word+0x47/0x90 [ 9.497038] amdgpu_driver_load_kms+0x1a/0x1c0 [amdgpu] [ 9.497327] amdgpu_pci_probe+0x182/0x450 [amdgpu] [ 9.497614] local_pci_probe+0x44/0xb0 [ 9.497616] pci_device_probe+0xc5/0x280 [ 9.497619] really_probe+0x1c9/0x430 [ 9.497621] __driver_probe_device+0x8c/0x190 [ 9.497623] driver_probe_device+0x24/0xd0 [ 9.497625] __driver_attach+0x10b/0x210 [ 9.497627] ? __pfx___driver_attach+0x10/0x10 [ 9.497628] bus_for_each_dev+0x8a/0xf0 [ 9.497631] driver_attach+0x1e/0x30 [ 9.497632] bus_add_driver+0x127/0x240 [ 9.497634] driver_register+0x5e/0x130 [ 9.497636] ? __pfx_amdgpu_init+0x10/0x10 [amdgpu] [ 9.497923] __pci_register_driver+0x62/0x70 [ 9.497925] amdgpu_init+0x69/0xff0 [amdgpu] [ 9.498210] do_one_initcall+0x5b/0x340 [ 9.498214] do_init_module+0x68/0x260 [ 9.498216] load_module+0x21a9/0x2510 [ 9.498220] init_module_from_file+0x97/0xe0 [ 9.498222] ? init_module_from_file+0x97/0xe0 [ 9.498226] idempotent_init_module+0x11c/0x2b0 [ 9.498228] __x64_sys_finit_module+0x64/0xd0 [ 9.498231] do_syscall_64+0x58/0x90 [ 9.498232] ? do_syscall_64+0x67/0x90 [ 9.498234] ? sysvec_call_function+0x4b/0xd0 [ 9.498235] entry_SYSCALL_64_after_hwframe+0x6e/0xd8 [ 9.498237] RIP: 0033:0x7fc9ea51589d [ 9.498238] Code: 5d c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 4b 05 0e 00 f7 d8 64 89 01 48 [ 9.498239] RSP: 002b:00007fff123911c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000139 [ 9.498241] RAX: ffffffffffffffda RBX: 00005622e67ac950 RCX: 00007fc9ea51589d [ 9.498242] RDX: 0000000000000000 RSI: 00005622e68f18b0 RDI: 0000000000000018 [ 9.498243] RBP: 00005622e68f18b0 R08: 0000000000000000 R09: 00007fff123912f0 [ 9.498244] R10: 0000000000000018 R11: 0000000000000246 R12: 0000000000020000 [ 9.498245] R13: 00005622e67a8d30 R14: 0000000000000000 R15: 00005622e68f1e70 [ 9.498247] [ 9.498260] ================================================================================
Hardware description:
- GPU: 01:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Ellesmere [Radeon RX 470/480/570/570X/580/580X/590] [1002:67df] (rev e7)
System information:
- Distro name and Version:
Ubuntu 23.04
- Kernel version:
Linux sauron 6.5.5-custom #5 SMP PREEMPT_DYNAMIC Tue Sep 26 21:42:29 EEST 2023 x86_64 x86_64 x86_64 GNU/Linux
- Custom kernel: built with config from https://kernel.ubuntu.com/~kernel-ppa/mainline/
How to reproduce the issue:
on each boot
Attached files:
Log files
- Dmesg log (full log)dmesg.log