clang/objtool failures on linux-next
I came across two randconfig builds on linux-next that fail to build:
==> build/x86/0xCE0DD5F4_defconfig/log <==drivers/input/misc/uinput.o: warning: objtool: uinput_str_to_user+0x165: undefined stack state drivers/input/misc/uinput.o: warning: objtool: uinput_str_to_user+0x165: unknown CFA base reg -1
==> build/x86/0xAE77DEF6_defconfig/log <== drivers/scsi/qla2xxx/qla_dbg.o: error: SIGSEGV: objtool stack overflow! Segmentation fault
The first one happens with clang-18 through clang-22, the second one with all versions of clang.
The crash seems worse at first, but I also noticed that clang takes a long time to actually compile it, and the object file is huge, so this is probably partially a compiler problem.
Please have a look at the attached object files along the configs I used.
Arnd
Quoted 13 lines · Arnd Bergmann
I came across two randconfig builds on linux-next that fail to build:
==> build/x86/0xCE0DD5F4_defconfig/log <==
drivers/input/misc/uinput.o: warning: objtool:uinput_str_to_user+0x165: undefined stack statedrivers/input/misc/uinput.o: warning: objtool:uinput_str_to_user+0x165: unknown CFA base reg -1==> build/x86/0xAE77DEF6_defconfig/log <==
drivers/scsi/qla2xxx/qla_dbg.o: error: SIGSEGV: objtool stack overflow! Segmentation faultThe first one happens with clang-18 through clang-22, the second one with all versions of clang.
Quoted 6 lines
The crash seems worse at first, but I also noticed that clang takes a long time to actually compile it, and the object file is huge, so this is probably partially a compiler problem.
Please have a look at the attached object files along the configs I used.
Thanks, I'll post a fix for the 1st one right now (haven't looked at the stack overflow yet).
Signature · 1 line
Josh
Quoted 18 lines · Josh Poimboeuf
Quoted 17 lines · Arnd Bergmann
I came across two randconfig builds on linux-next that fail to build:
==> build/x86/0xCE0DD5F4_defconfig/log <==
drivers/input/misc/uinput.o: warning: objtool:uinput_str_to_user+0x165: undefined stack statedrivers/input/misc/uinput.o: warning: objtool:uinput_str_to_user+0x165: unknown CFA base reg -1==> build/x86/0xAE77DEF6_defconfig/log <==
drivers/scsi/qla2xxx/qla_dbg.o: error: SIGSEGV: objtool stack overflow! Segmentation faultThe first one happens with clang-18 through clang-22, the second one with all versions of clang.
The crash seems worse at first, but I also noticed that clang takes a long time to actually compile it, and the object file is huge, so this is probably partially a compiler problem.
Quoted 5 lines
Quoted 2 lines
Please have a look at the attached object files along the configs I used.
Thanks, I'll post a fix for the 1st one right now (haven't looked at the stack overflow yet).
Both fixes posted now:
https://lore.kernel.org/240e6a172cc73292499334a3724d02ccb3247fc7.1772818491.git.jpoimboe@kernel.org
https://lore.kernel.org/8b97f62d083457f3b0a29a424275f7957dd3372f.1772821683.git.jpoimboe@kernel.org
Signature · 1 line
Josh
Quoted 10 lines · Josh Poimboeuf
Quoted 4 lines · Josh Poimboeuf
On Fri, Mar 06, 2026 at 01:41:59PM +0100, Arnd Bergmann wrote:
Thanks, I'll post a fix for the 1st one right now (haven't looked at the stack overflow yet).
Both fixes posted now:
https://lore.kernel.org/240e6a172cc73292499334a3724d02ccb3247fc7.1772818491.git.jpoimboe@kernel.org
https://lore.kernel.org/8b97f62d083457f3b0a29a424275f7957dd3372f.1772821683.git.jpoimboe@kernel.org
Thanks a lot, that was quick!
I've applied both to my randconfig tree now and verified that both issues are addressed in the full build. There is still the question of the 0xAE77DEF6_defconfig causing an incredibly long compile time (minutes!) for the one file when using clang.
I've added Nathan to Cc in case he is motivated to try to reproduce this.
FWIW, this is the current set of objtool warnings that I get that don't cause the build to fail:
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.o: warning: objtool: amdgpu_cs_parser_bos+0x723: unreachable instruction drivers/gpu/drm/msm/msm.o: warning: objtool: msm_gem_vm_close+0x1cf: unreachable instructiondrivers/gpu/drm/panthor/panthor.o: warning: objtool: panthor_ioctl_vm_bind+0x32b: __stack_chk_fail() missing __noreturn in .c/.h or NORETURN() in noreturns.h drivers/gpu/drm/panthor/panthor.o: warning: objtool: panthor_ioctl_vm_bind_async+0x285: unreachable instruction drivers/gpu/drm/panthor/panthor_drv.o: warning: objtool: panthor_ioctl_vm_bind+0x2df: unreachable instruction drivers/gpu/drm/xe/xe_bo.o: warning: objtool: xe_bo_create_pin_map_at_novm+0x11d: unreachable instruction drivers/iio/imu/bmi160/bmi160_core.o: warning: objtool: bmi160_setup_irq() falls through to next function __cfi_bmi160_core_runtime_resume() kernel/bpf/core.o: warning: objtool: ___bpf_prog_run+0x217: sibling call from callable instruction with modified stack frame sound/soc/codecs/wcd9335.o: warning: objtool: wcd9335_slimbus_irq() falls through to next function __cfi_wcd9335_set_channel_map() vmlinux.o: warning: objtool: ___bpf_prog_run+0x1d4: sibling call from callable instruction with modified stack frame
vmlinux.o: warning: objtool: hdmi_power_on_full.isra.0+0xd6: hdmi_pll_compute() missing __noreturn in .c/.h or NORETURN() in noreturns.h
If you want to investigate those, I can send you the configs and/or object files for these as well.
Arnd
Quoted 37 lines · Arnd Bergmann
Quoted 10 lines · Josh Poimboeuf
Quoted 4 lines · Josh Poimboeuf
On Fri, Mar 06, 2026 at 01:41:59PM +0100, Arnd Bergmann wrote:
Thanks, I'll post a fix for the 1st one right now (haven't looked at the stack overflow yet).
Both fixes posted now:
https://lore.kernel.org/240e6a172cc73292499334a3724d02ccb3247fc7.1772818491.git.jpoimboe@kernel.org
https://lore.kernel.org/8b97f62d083457f3b0a29a424275f7957dd3372f.1772821683.git.jpoimboe@kernel.orgThanks a lot, that was quick!
I've applied both to my randconfig tree now and verified that both issues are addressed in the full build. There is still the question of the 0xAE77DEF6_defconfig causing an incredibly long compile time (minutes!) for the one file when using clang.
I've added Nathan to Cc in case he is motivated to try to reproduce this.
FWIW, this is the current set of objtool warnings that I get that don't cause the build to fail:
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.o: warning: objtool:amdgpu_cs_parser_bos+0x723: unreachable instructiondrivers/gpu/drm/msm/msm.o: warning: objtool:msm_gem_vm_close+0x1cf: unreachable instructiondrivers/gpu/drm/panthor/panthor.o: warning: objtool:panthor_ioctl_vm_bind+0x32b:__stack_chk_fail()missing__noreturnin .c/.h orNORETURN()innoreturns.hdrivers/gpu/drm/panthor/panthor.o: warning: objtool:panthor_ioctl_vm_bind_async+0x285: unreachable instructiondrivers/gpu/drm/panthor/panthor_drv.o: warning: objtool:panthor_ioctl_vm_bind+0x2df: unreachable instructiondrivers/gpu/drm/xe/xe_bo.o: warning: objtool:xe_bo_create_pin_map_at_novm+0x11d: unreachable instructiondrivers/iio/imu/bmi160/bmi160_core.o: warning: objtool:bmi160_setup_irq()falls through to next function__cfi_bmi160_core_runtime_resume()kernel/bpf/core.o: warning: objtool:___bpf_prog_run+0x217: sibling call from callable instruction with modified stack framesound/soc/codecs/wcd9335.o: warning: objtool:wcd9335_slimbus_irq()falls through to next function__cfi_wcd9335_set_channel_map()vmlinux.o: warning: objtool:___bpf_prog_run+0x1d4: sibling call from callable instruction with modified stack frame
vmlinux.o: warning: objtool: hdmi_power_on_full.isra.0+0xd6:hdmi_pll_compute()missing__noreturnin .c/.h orNORETURN()innoreturns.h
Quoted 2 lines
If you want to investigate those, I can send you the configs and/or object files for these as well.
Yes, please send those and I'll take a look. Thanks!
Signature · 1 line
Josh
Quoted 14 lines · Josh Poimboeuf
Quoted 13 lines · Arnd Bergmann
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.o: warning: objtool:amdgpu_cs_parser_bos+0x723: unreachable instructiondrivers/gpu/drm/msm/msm.o: warning: objtool:msm_gem_vm_close+0x1cf: unreachable instructiondrivers/gpu/drm/panthor/panthor.o: warning: objtool:panthor_ioctl_vm_bind+0x32b:__stack_chk_fail()missing__noreturnin .c/.h orNORETURN()innoreturns.hdrivers/gpu/drm/panthor/panthor.o: warning: objtool:panthor_ioctl_vm_bind_async+0x285: unreachable instructiondrivers/gpu/drm/panthor/panthor_drv.o: warning: objtool:panthor_ioctl_vm_bind+0x2df: unreachable instructiondrivers/gpu/drm/xe/xe_bo.o: warning: objtool:xe_bo_create_pin_map_at_novm+0x11d: unreachable instructiondrivers/iio/imu/bmi160/bmi160_core.o: warning: objtool:bmi160_setup_irq()falls through to next function__cfi_bmi160_core_runtime_resume()kernel/bpf/core.o: warning: objtool:___bpf_prog_run+0x217: sibling call from callable instruction with modified stack framesound/soc/codecs/wcd9335.o: warning: objtool:wcd9335_slimbus_irq()falls through to next function__cfi_wcd9335_set_channel_map()vmlinux.o: warning: objtool:___bpf_prog_run+0x1d4: sibling call from callable instruction with modified stack frame
vmlinux.o: warning: objtool: hdmi_power_on_full.isra.0+0xd6:hdmi_pll_compute()missing__noreturnin .c/.h orNORETURN()innoreturns.h
Quoted 4 lines
Quoted 2 lines
If you want to investigate those, I can send you the configs and/or object files for these as well.
Yes, please send those and I'll take a look. Thanks!
These are the ones I could easily reproduce on today's linux-next:
==> build/x86/0xCE0DD5F4_defconfig/log <==
vmlinux.o: warning: objtool: ___bpf_prog_run+0x1c5: sibling call from callable instruction with modified stack frame
==> build/x86/0x8FD83285_defconfig/log <==drivers/gpu/drm/amd/amdgpu/amdgpu_cs.o: warning: objtool: amdgpu_cs_parser_bos+0x723: unreachable instruction drivers/gpu/drm/xe/xe_bo.o: warning: objtool: xe_bo_create_pin_map_at_novm+0x11d: unreachable instruction drivers/gpu/drm/panthor/panthor_drv.o: warning: objtool: panthor_ioctl_vm_bind+0x2df: unreachable instruction drivers/iio/imu/bmi160/bmi160_core.o: warning: objtool: bmi160_setup_irq() falls through to next function __cfi_bmi160_core_runtime_resume()
==> build/x86/0x4DF22811_defconfig/log <==sound/soc/codecs/wcd9335.o: warning: objtool: wcd9335_slimbus_irq() falls through to next function __cfi_wcd9335_set_channel_map()
Arnd
Quoted 4 lines · Arnd Bergmann
==> build/x86/0x8FD83285_defconfig/log <==
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.o: warning: objtool:amdgpu_cs_parser_bos+0x723: unreachable instructiondrivers/gpu/drm/xe/xe_bo.o: warning: objtool:xe_bo_create_pin_map_at_novm+0x11d: unreachable instructiondrivers/gpu/drm/panthor/panthor_drv.o: warning: objtool:panthor_ioctl_vm_bind+0x2df: unreachable instruction
These three warnings are accurate, for each of these, Clang is leaving an unreachable JMP at the end of the function:
166e: 4c 89 ea mov %r13,%rdx
1671: e8 00 00 00 00 call 1676 <amdgpu_cs_parser_bos+0x716> 1672: R_X86_64_PLT32 __ubsan_handle_shift_out_of_bounds-0x4
1676: 49 8b 94 24 08 1d 01 00 mov 0x11d08(%r12),%rdx
167e: e9 c6 fd ff ff jmp 1449 <amdgpu_cs_parser_bos+0x4e9>
1683: e9 8c f9 ff ff jmp 1014 <amdgpu_cs_parser_bos+0xb4>
1688: 0f 1f 84 00 00 00 00 00 nopl 0x0(%rax,%rax,1)Nathan, any idea? I haven't seen this pattern before.
Signature · 1 line
Josh
Quoted 9 lines · Josh Poimboeuf
Quoted 4 lines · Arnd Bergmann
==> build/x86/0x8FD83285_defconfig/log <==
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.o: warning: objtool:amdgpu_cs_parser_bos+0x723: unreachable instructiondrivers/gpu/drm/xe/xe_bo.o: warning: objtool:xe_bo_create_pin_map_at_novm+0x11d: unreachable instructiondrivers/gpu/drm/panthor/panthor_drv.o: warning: objtool:panthor_ioctl_vm_bind+0x2df: unreachable instructionThese three warnings are accurate, for each of these, Clang is leaving an unreachable JMP at the end of the function:
Quoted 8 lines
166e: 4c 89 ea mov %r13,%rdx 1671: e8 00 00 00 00 call 1676 <amdgpu_cs_parser_bos+0x716> 1672: R_X86_64_PLT32 __ubsan_handle_shift_out_of_bounds-0x4 1676: 49 8b 94 24 08 1d 01 00 mov 0x11d08(%r12),%rdx 167e: e9 c6 fd ff ff jmp 1449 <amdgpu_cs_parser_bos+0x4e9> 1683: e9 8c f9 ff ff jmp 1014 <amdgpu_cs_parser_bos+0xb4> 1688: 0f 1f 84 00 00 00 00 00 nopl 0x0(%rax,%rax,1)Nathan, any idea? I haven't seen this pattern before.
This seems pretty similar to
https://github.com/ClangBuiltLinux/linux/issues/2130
https://github.com/llvm/llvm-project/issues/167774
as they all use drm_exec_until_all_locked(). Justin fixed this in main (23.0.0) and it was backported to 22.1.0:
https://github.com/llvm/llvm-project/commit/404920838836a022b0ae4b9a462befba89ee0cdc
https://github.com/llvm/llvm-project/commit/2fb8921a7c70b264f670569ac319d1c96e9f5acc
I don't think Arnd has that fix based on the .comment section:
Debian clang version 22.0.0 (++20251025104945+e219cf60598c-1~exp1~20251025225011.1789)
I don't see a configuration file for these so I cannot verify that they are actually fixed with a newer version of clang.
Unfortunately, the problematic change landed in the 21.1.0 release so that version will still see these warnings. I am guessing it is probably not too easy to workaround this in objtool though, so maybe we will just have to live with them?
Cheers,
Nathan
Quoted 8 lines · Nathan Chancellor
Quoted 1 line · Josh Poimboeuf
On Fri, Mar 06, 2026 at 11:04:50PM +0100, Arnd Bergmann wrote:
I don't think Arnd has that fix based on the .comment section:
Debian clang version 22.0.0
(++20251025104945+e219cf60598c-1~exp1~20251025225011.1789)
Correct, I am still using the apt.llvm.org packages on arm64, and those don't have clang-23 packages yet. I should probably start using your builds instead.
Arnd
Quoted 25 lines · Arnd Bergmann
Quoted 14 lines · Josh Poimboeuf
Quoted 13 lines · Arnd Bergmann
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.o: warning: objtool:amdgpu_cs_parser_bos+0x723: unreachable instructiondrivers/gpu/drm/msm/msm.o: warning: objtool:msm_gem_vm_close+0x1cf: unreachable instructiondrivers/gpu/drm/panthor/panthor.o: warning: objtool:panthor_ioctl_vm_bind+0x32b:__stack_chk_fail()missing__noreturnin .c/.h orNORETURN()innoreturns.hdrivers/gpu/drm/panthor/panthor.o: warning: objtool:panthor_ioctl_vm_bind_async+0x285: unreachable instructiondrivers/gpu/drm/panthor/panthor_drv.o: warning: objtool:panthor_ioctl_vm_bind+0x2df: unreachable instructiondrivers/gpu/drm/xe/xe_bo.o: warning: objtool:xe_bo_create_pin_map_at_novm+0x11d: unreachable instructiondrivers/iio/imu/bmi160/bmi160_core.o: warning: objtool:bmi160_setup_irq()falls through to next function__cfi_bmi160_core_runtime_resume()kernel/bpf/core.o: warning: objtool:___bpf_prog_run+0x217: sibling call from callable instruction with modified stack framesound/soc/codecs/wcd9335.o: warning: objtool:wcd9335_slimbus_irq()falls through to next function__cfi_wcd9335_set_channel_map()vmlinux.o: warning: objtool:___bpf_prog_run+0x1d4: sibling call from callable instruction with modified stack frame
vmlinux.o: warning: objtool: hdmi_power_on_full.isra.0+0xd6:hdmi_pll_compute()missing__noreturnin .c/.h orNORETURN()innoreturns.hQuoted 4 lines
Quoted 2 lines
If you want to investigate those, I can send you the configs and/or object files for these as well.
Yes, please send those and I'll take a look. Thanks!
These are the ones I could easily reproduce on today's linux-next:
==> build/x86/0xCE0DD5F4_defconfig/log <==
vmlinux.o: warning: objtool:___bpf_prog_run+0x1c5: sibling call from callable instruction with modified stack frame
Quoted 6 lines
==> build/x86/0x8FD83285_defconfig/log <==
...drivers/iio/imu/bmi160/bmi160_core.o: warning: objtool:bmi160_setup_irq()falls through to next function__cfi_bmi160_core_runtime_resume()==> build/x86/0x4DF22811_defconfig/log <==
sound/soc/codecs/wcd9335.o: warning: objtool:wcd9335_slimbus_irq()falls through to next function__cfi_wcd9335_set_channel_map()
I have fixes for these 3, will post the lot soonish.
Signature · 1 line
Josh
Quoted 2 lines · Arnd Bergmann
I've added Nathan to Cc in case he is motivated to try to reproduce this.
Yeah, I will see if I can get something reproduced for the LLVM folks to take a look at upstream. Most of the time it ends up being something small and dumb :)
Cheers,
Nathan
I've found two more objtool related build failures on today's linux-next.
See attachment for .config and object files.
==> build/x86/0x8F5E6B2F_defconfig/log <==mm/memory.o: warning: objtool: folio_zero_user+0x69a: undefined stack state mm/memory.o: error: objtool: folio_zero_user+0x69a: unknown CFA base reg -1 make[5]: *** [/home/arnd/arm-soc/scripts/Makefile.build:279: mm/memory.o] Error 255
==> build/x86/0xEC8A503_defconfig/log <==
vmlinux.o: warning: objtool: ___bpf_prog_run+0x202: sibling call from callable instruction with modified stack frame vmlinux.o: warning: objtool: __x64_sys_get_mempolicy+0x1705: stack state mismatch: cfa1=4+288 cfa2=4+80 vmlinux.o: error: objtool: vmw_host_printf+0xd: unknown CFA base reg 0
make[4]: *** [/home/arnd/arm-soc/scripts/Makefile.vmlinux_o:76: vmlinux.o] Error 255
Arnd
Quoted 8 lines · Arnd Bergmann
I've found two more objtool related build failures on today's linux-next.
See attachment for .config and object files.
==> build/x86/0x8F5E6B2F_defconfig/log <==
mm/memory.o: warning: objtool:folio_zero_user+0x69a: undefined stack statemm/memory.o: error: objtool:folio_zero_user+0x69a: unknown CFA base reg -1 make[5]: *** [/home/arnd/arm-soc/scripts/Makefile.build:279:mm/memory.o] Error 255
This is a clang issue we've seen before, where ASM_CALL_CONSTRAINT causes clang to save/restore RSP around some inline asm.
The "fix" was going to be asm_call(), as discussed here with Linus:
https://lore.kernel.org/174099976188.10177.7153571701278544000.tip-bot2@tip-bot2
I need to dust off those patches.
Quoted 5 lines
==> build/x86/0xEC8A503_defconfig/log <==
vmlinux.o: warning: objtool:___bpf_prog_run+0x202: sibling call from callable instruction with modified stack frame vmlinux.o: warning: objtool:__x64_sys_get_mempolicy+0x1705: stack state mismatch: cfa1=4+288 cfa2=4+80 vmlinux.o: error: objtool:vmw_host_printf+0xd: unknown CFA base reg 0
make[4]: *** [/home/arnd/arm-soc/scripts/Makefile.vmlinux_o:76: vmlinux.o] Error 255
This one's easy, just need to add RAX to the ORC register list. I will post a fix shortly.
Signature · 1 line
Josh