UBSAN: array-index-out-of-bounds in si_dpm.c
On a laptop with an OLAND GPU (HD 8750M) the following are printed during boot with UBSAN enabled with the latest linux-git (1b1934dbbdcf) kernel:
[ 4.571080] ------------[ cut here ]------------
[ 4.571081] UBSAN: array-index-out-of-bounds in drivers/gpu/drm/amd/amdgpu/../pm/legacy-dpm/si_dpm.c:7288:39
[ 4.571087] index 2 is out of range for type 'ATOM_PPLIB_NONCLOCK_INFO [1]'
[ 4.571091] CPU: 2 PID: 125 Comm: systemd-udevd Not tainted 6.7.0-bisect #42
[ 4.571093] Hardware name: Acer Aspire E1-572G/EA50_HW , BIOS V2.17 09/02/2014
[ 4.571095] Call Trace:
[ 4.571096] <TASK>
[ 4.571098] dump_stack_lvl+0x4c/0x70
[ 4.571106] dump_stack+0x14/0x20
[ 4.571108] __ubsan_handle_out_of_bounds+0xa6/0xf0
[ 4.571112] si_dpm_sw_init+0x18c0/0x1c10 [amdgpu]
[ 4.571604] ? si_dma_sw_init+0xec/0x110 [amdgpu]
[ 4.571911] amdgpu_device_init+0x18cf/0x2da0 [amdgpu]
[ 4.572204] ? pci_bus_read_config_word+0x4e/0x80
[ 4.572209] ? pci_read_config_word+0x2b/0x50
[ 4.572212] ? do_pci_enable_device+0xdb/0x110
[ 4.572217] amdgpu_driver_load_kms+0x1e/0x1a0 [amdgpu]
[ 4.572503] amdgpu_pci_probe+0x1a1/0x5d0 [amdgpu]
[ 4.572785] local_pci_probe+0x4f/0xb0
[ 4.572789] pci_device_probe+0xcc/0x280
[ 4.572792] really_probe+0x1c7/0x430
[ 4.572797] __driver_probe_device+0x8a/0x180
[ 4.572800] driver_probe_device+0x23/0xc0
[ 4.572803] __driver_attach+0xfb/0x200
[ 4.572806] ? __pfx___driver_attach+0x10/0x10
[ 4.572809] bus_for_each_dev+0x81/0xd0
[ 4.572812] driver_attach+0x22/0x30
[ 4.572815] bus_add_driver+0x120/0x230
[ 4.572818] driver_register+0x68/0x130
[ 4.572822] ? __pfx_amdgpu_init+0x10/0x10 [amdgpu]
[ 4.573102] __pci_register_driver+0x6c/0x80
[ 4.573105] amdgpu_init+0x67/0xff0 [amdgpu]
[ 4.573386] do_one_initcall+0x4d/0x320
[ 4.573390] ? kmalloc_trace+0x13a/0x360
[ 4.573395] do_init_module+0x6a/0x270
[ 4.573399] load_module+0x2405/0x24f0
[ 4.573404] init_module_from_file+0x9c/0xe0
[ 4.573407] ? init_module_from_file+0x9c/0xe0
[ 4.573411] idempotent_init_module+0x179/0x230
[ 4.573415] __x64_sys_finit_module+0x64/0xc0
[ 4.573418] do_syscall_64+0x7a/0x120
[ 4.573423] ? syscall_exit_to_user_mode+0x9b/0x1d0
[ 4.573426] ? do_syscall_64+0x86/0x120
[ 4.573429] ? syscall_exit_to_user_mode+0x9b/0x1d0
[ 4.573431] ? do_syscall_64+0x86/0x120
[ 4.573434] ? do_syscall_64+0x86/0x120
[ 4.573437] ? sysvec_call_function+0x52/0x90
[ 4.573441] entry_SYSCALL_64_after_hwframe+0x6e/0x76
[ 4.573443] RIP: 0033:0x7fdfb155188d
[ 4.573446] Code: 5b 41 5c c3 66 0f 1f 84 00 00 00 00 00 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 73 b5 0f 00 f7 d8 64 89 01 48
[ 4.573448] RSP: 002b:00007ffcd147e068 EFLAGS: 00000246 ORIG_RAX: 0000000000000139
[ 4.573451] RAX: ffffffffffffffda RBX: 00005601acfb5160 RCX: 00007fdfb155188d
[ 4.573452] RDX: 0000000000000000 RSI: 00005601acfb5ff0 RDI: 0000000000000016
[ 4.573454] RBP: 0000000000020000 R08: 0000000000000000 R09: 0000000000000002
[ 4.573455] R10: 0000000000000016 R11: 0000000000000246 R12: 00005601acfb5ff0
[ 4.573456] R13: 00005601acfb6930 R14: 0000000000000000 R15: 00005601acfb72f0
[ 4.573458] </TASK>
[ 4.573469] ---[ end trace ]---
and
[ 4.573472] ------------[ cut here ]------------
[ 4.573472] UBSAN: array-index-out-of-bounds in drivers/gpu/drm/amd/amdgpu/../pm/legacy-dpm/si_dpm.c:7321:32
[ 4.573477] index 16 is out of range for type 'UCHAR [1]'
[ 4.573480] CPU: 2 PID: 125 Comm: systemd-udevd Not tainted 6.7.0-bisect #42
[ 4.573482] Hardware name: Acer Aspire E1-572G/EA50_HW , BIOS V2.17 09/02/2014
[ 4.573483] Call Trace:
[ 4.573484] <TASK>
[ 4.573485] dump_stack_lvl+0x4c/0x70
[ 4.573489] dump_stack+0x14/0x20
[ 4.573501] __ubsan_handle_out_of_bounds+0xa6/0xf0
[ 4.573504] si_dpm_sw_init+0x1b3a/0x1c10 [amdgpu]
[ 4.573855] ? si_dma_sw_init+0xec/0x110 [amdgpu]
[ 4.574135] amdgpu_device_init+0x18cf/0x2da0 [amdgpu]
[ 4.574390] ? pci_bus_read_config_word+0x4e/0x80
[ 4.574394] ? pci_read_config_word+0x2b/0x50
[ 4.574396] ? do_pci_enable_device+0xdb/0x110
[ 4.574400] amdgpu_driver_load_kms+0x1e/0x1a0 [amdgpu]
[ 4.574680] amdgpu_pci_probe+0x1a1/0x5d0 [amdgpu]
[ 4.574934] local_pci_probe+0x4f/0xb0
[ 4.574936] pci_device_probe+0xcc/0x280
[ 4.574940] really_probe+0x1c7/0x430
[ 4.574942] __driver_probe_device+0x8a/0x180
[ 4.574945] driver_probe_device+0x23/0xc0
[ 4.574948] __driver_attach+0xfb/0x200
[ 4.574951] ? __pfx___driver_attach+0x10/0x10
[ 4.574954] bus_for_each_dev+0x81/0xd0
[ 4.574956] driver_attach+0x22/0x30
[ 4.574959] bus_add_driver+0x120/0x230
[ 4.574961] driver_register+0x68/0x130
[ 4.574964] ? __pfx_amdgpu_init+0x10/0x10 [amdgpu]
[ 4.575217] __pci_register_driver+0x6c/0x80
[ 4.575219] amdgpu_init+0x67/0xff0 [amdgpu]
[ 4.575473] do_one_initcall+0x4d/0x320
[ 4.575476] ? kmalloc_trace+0x13a/0x360
[ 4.575479] do_init_module+0x6a/0x270
[ 4.575482] load_module+0x2405/0x24f0
[ 4.575486] init_module_from_file+0x9c/0xe0
[ 4.575489] ? init_module_from_file+0x9c/0xe0
[ 4.575492] idempotent_init_module+0x179/0x230
[ 4.575496] __x64_sys_finit_module+0x64/0xc0
[ 4.575499] do_syscall_64+0x7a/0x120
[ 4.575502] ? syscall_exit_to_user_mode+0x9b/0x1d0
[ 4.575504] ? do_syscall_64+0x86/0x120
[ 4.575507] ? syscall_exit_to_user_mode+0x9b/0x1d0
[ 4.575509] ? do_syscall_64+0x86/0x120
[ 4.575512] ? do_syscall_64+0x86/0x120
[ 4.575515] ? sysvec_call_function+0x52/0x90
[ 4.575518] entry_SYSCALL_64_after_hwframe+0x6e/0x76
[ 4.575520] RIP: 0033:0x7fdfb155188d
[ 4.575521] Code: 5b 41 5c c3 66 0f 1f 84 00 00 00 00 00 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 73 b5 0f 00 f7 d8 64 89 01 48
[ 4.575523] RSP: 002b:00007ffcd147e068 EFLAGS: 00000246 ORIG_RAX: 0000000000000139
[ 4.575525] RAX: ffffffffffffffda RBX: 00005601acfb5160 RCX: 00007fdfb155188d
[ 4.575526] RDX: 0000000000000000 RSI: 00005601acfb5ff0 RDI: 0000000000000016
[ 4.575527] RBP: 0000000000020000 R08: 0000000000000000 R09: 0000000000000002
[ 4.575528] R10: 0000000000000016 R11: 0000000000000246 R12: 00005601acfb5ff0
[ 4.575529] R13: 00005601acfb6930 R14: 0000000000000000 R15: 00005601acfb72f0
[ 4.575531] </TASK>
[ 4.575532] ---[ end trace ]---