current objtool warnings from randconfig builds
Subsystems (2)
Hi Josh and Peter,
I've updated my randconfig test setup to use gcc-13 and clang-16, and have sent fixes for all normal WERROR=y build warnings, but there are a lot of objtool warnings that remain. I've reported some of them in the past, some others are new. It would be nice to at least reduce the number of warnings either through code changes or workarounds in objtool for any false positives.
Out of 1500 builds, about a third had any warnings, this is the full list sorted by frequency. Let me know if there are any that you haven't seen before, I can provide the corresponding object and config files for reproducing.
Arnd
8<---
205 mm/kasan/shadow.o: warning: objtool: __asan_memset+0x2e: call to __memset() with UACCESS enabled
205 mm/kasan/shadow.o: warning: objtool: __asan_memmove+0x48: call to __memmove() with UACCESS enabled
205 mm/kasan/shadow.o: warning: objtool: __asan_memcpy+0x48: call to __memcpy() with UACCESS enabled
80 vmlinux.o: warning: objtool: ibt_selftest+0x11: sibling call from callable instruction with modified stack frame
49 vmlinux.o: warning: objtool: lkdtm_UNSET_SMEP+0x100: relocation to !ENDBR: native_write_cr4+0x4
29 mm/kasan/generic.o: warning: objtool: kasan_check_range+0x1e: call to addr_has_metadata() with UACCESS enabled
29 mm/kasan/generic.o: warning: objtool: __asan_load2+0x11: call to addr_has_metadata() with UACCESS enabled
29 drivers/gpu/drm/vmwgfx/vmwgfx_msg.o: warning: objtool: vmw_port_hb_out+0x15e: return with modified stack frame
29 drivers/gpu/drm/vmwgfx/vmwgfx_msg.o: warning: objtool: vmw_port_hb_out+0x11d: stack state mismatch: cfa1=5+16 cfa2=4+8
29 drivers/gpu/drm/vmwgfx/vmwgfx_msg.o: warning: objtool: vmw_port_hb_in+0x150: return with modified stack frame
29 drivers/gpu/drm/vmwgfx/vmwgfx_msg.o: warning: objtool: vmw_port_hb_in+0x13d: stack state mismatch: cfa1=5+16 cfa2=4+8
29 drivers/gpu/drm/vmwgfx/vmwgfx.o: warning: objtool: vmw_port_hb_out+0xe2: return with modified stack frame
29 drivers/gpu/drm/vmwgfx/vmwgfx.o: warning: objtool: vmw_port_hb_out+0xd1: stack state mismatch: cfa1=5+16 cfa2=4+8
29 drivers/gpu/drm/vmwgfx/vmwgfx.o: warning: objtool: vmw_port_hb_in+0xea: return with modified stack frame
29 drivers/gpu/drm/vmwgfx/vmwgfx.o: warning: objtool: vmw_port_hb_in+0xcc: stack state mismatch: cfa1=5+16 cfa2=4+8
28 mm/kasan/generic.o: warning: objtool: __asan_store16+0x11: call to addr_has_metadata() with UACCESS enabled
28 mm/kasan/generic.o: warning: objtool: __asan_load16+0x11: call to addr_has_metadata() with UACCESS enabled
23 fs/reiserfs/do_balan.o: warning: objtool: balance_leaf+0x100ac: stack state mismatch: cfa1=4+464 cfa2=4+456
22 mm/kasan/generic.o: warning: objtool: __asan_load4+0x11: call to addr_has_metadata() with UACCESS enabled
21 mm/kasan/generic.o: warning: objtool: __asan_store4+0x11: call to addr_has_metadata() with UACCESS enabled
21 mm/kasan/generic.o: warning: objtool: __asan_store1+0x11: call to addr_has_metadata() with UACCESS enabled
21 mm/kasan/generic.o: warning: objtool: __asan_load8+0x11: call to addr_has_metadata() with UACCESS enabled
21 mm/kasan/generic.o: warning: objtool: __asan_load1+0x11: call to addr_has_metadata() with UACCESS enabled
18 fs/reiserfs/reiserfs.o: warning: objtool: balance_internal+0x1238: stack state mismatch: cfa1=4+248 cfa2=4+256
18 fs/reiserfs/ibalance.o: warning: objtool: balance_internal+0x10a2: stack state mismatch: cfa1=4+232 cfa2=4+256
17 arch/x86/coco/tdx/tdcall.o: warning: objtool: __tdx_hypercall+0xb0: return with modified stack frame
15 vmlinux.o: warning: objtool: ftrace_likely_update+0xd2: call to __stack_chk_fail() with UACCESS enabled
15 kernel/trace/trace_branch.o: warning: objtool: ftrace_likely_update+0x201: call to __stack_chk_fail() with UACCESS enabled
14 mm/kasan/generic.o: warning: objtool: __asan_store2+0x11: call to addr_has_metadata() with UACCESS enabled
14 arch/x86/kvm/kvm.o: warning: objtool: .text+0x0: unreachable instruction
13 mm/kasan/generic.o: warning: objtool: __asan_store8+0x11: call to addr_has_metadata() with UACCESS enabled
11 vmlinux.o: warning: objtool: replace_key+0x1b2: stack state mismatch: cfa1=4+72 cfa2=4+88
8 vmlinux.o: warning: objtool: set_ftrace_ops_ro+0x49: relocation to !ENDBR: kgdb_ll_trap+0x6a
8 vmlinux.o: warning: objtool: set_ftrace_ops_ro+0x28: relocation to !ENDBR: kgdb_arch_late+0x193
8 vmlinux.o: warning: objtool: set_ftrace_ops_ro+0x23: relocation to !ENDBR: kexec_mark_range+0x13
8 vmlinux.o: warning: objtool: set_ftrace_ops_ro+0x23: relocation to !ENDBR: kexec_mark_crashkres+0x53
8 vmlinux.o: warning: objtool: set_ftrace_ops_ro+0x23: relocation to !ENDBR: .text+0x4b314
8 drivers/media/platform/qcom/camss/qcom-camss.o: warning: objtool: csiphy_lanes_enable() falls through to next function __cfi_csiphy_hw_version_read() 8 drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.o: warning: objtool: csiphy_lanes_enable() falls through to next function __cfi_csiphy_get_lane_mask() 7 vmlinux.o: warning: objtool: internal_move_pointers_items+0x3fa: stack state mismatch: cfa1=4+144 cfa2=4+136
7 fs/jffs2/jffs2.o: warning: objtool: jffs2_erase_pending_blocks() falls through to next function jffs2_free_jeb_node_refs()
7 fs/jffs2/erase.o: warning: objtool: jffs2_erase_pending_blocks() falls through to next function __cfi_jffs2_free_jeb_node_refs()
7 drivers/hwmon/pmbus/adm1275.o: warning: objtool: adm1275_probe+0x574: unreachable instruction
5 vmlinux.o: warning: objtool: exynos3250_cmu_isp_probe+0x17: unreachable instruction
5 arch/x86/mm/fault.o: warning: objtool: do_user_addr_fault+0x2c0: unreachable instruction
5 arch/x86/kvm/kvm-amd.o: warning: objtool: __svm_vcpu_run+0x141: BP used as a scratch register
5 arch/x86/kvm/kvm-amd.o: warning: objtool: __svm_sev_es_vcpu_run+0x36: BP used as a scratch register
4 vmlinux.o: warning: objtool: resume_play_dead+0xe: unreachable instruction
4 vmlinux.o: warning: objtool: hyperv_init+0x55c: unreachable instruction
4 vmlinux.o: warning: objtool: do_idle+0x15e: unreachable instruction
4 drivers/media/i2c/m5mols/m5mols_core.o: warning: objtool: m5mols_set_fmt() falls through to next function __cfi_m5mols_get_frame_desc() 3 vmlinux.o: warning: objtool: nmi_panic+0x2d: unreachable instruction
3 vmlinux.o: warning: objtool: mptscsih_abort+0x319: unreachable instruction
3 vmlinux.o: warning: objtool: internal_delete_pointers_items+0x392: stack state mismatch: cfa1=4+136 cfa2=4+144
3 vmlinux.o: warning: objtool: emulate_vsyscall+0x1ff: unreachable instruction
3 vmlinux.o: warning: objtool: do_arch_prctl_64+0x1ac: unreachable instruction
3 fs/xfs/libxfs/xfs_da_btree.o: warning: objtool: xfs_da_grow_inode_int+0x397: stack state mismatch: reg1[12]=-2-48 reg2[12]=-1+0
3 drivers/spi/spi-amd.o: warning: objtool: amd_spi_master_transfer() falls through to next function __cfi_amd_spi_max_transfer_size() 3 drivers/pwm/pwm-mediatek.o: warning: objtool: .text: unexpected end of section
3 drivers/gpu/drm/i915/gt/intel_timeline.o: warning: objtool: live_hwsp_read+0x318: stack state mismatch: cfa1=4+240 cfa2=5+48
3 arch/x86/entry/entry_64.o: warning: objtool: .entry.text+0xba7: unreachable instruction
2 vmlinux.o: warning: objtool: xenpv_exc_double_fault+0x9: unreachable instruction
2 vmlinux.o: warning: objtool: pwm_mediatek_apply() falls through to next function mtk_disp_pwm_probe()
2 vmlinux.o: warning: objtool: force_ibs_eilvt_setup+0xad: unreachable instruction
2 vmlinux.o: warning: objtool: exynos7885_cmu_probe+0x1b: unreachable instruction
2 vmlinux.o: warning: objtool: do_one_initcall+0x1f6: unreachable instruction
2 mm/kmsan/report.o: warning: objtool: kmsan_report+0x0: call to __fentry__() with UACCESS enabled
2 mm/kmsan/instrumentation.o: warning: objtool: __msan_warning+0x0: call to __fentry__() with UACCESS enabled
2 mm/kmsan/instrumentation.o: warning: objtool: __msan_poison_alloca+0x0: call to __fentry__() with UACCESS enabled
2 mm/kmsan/instrumentation.o: warning: objtool: __msan_metadata_ptr_for_store_n+0x0: call to __fentry__() with UACCESS enabled
2 mm/kmsan/instrumentation.o: warning: objtool: __msan_metadata_ptr_for_store_8+0x0: call to __fentry__() with UACCESS enabled
2 mm/kmsan/instrumentation.o: warning: objtool: __msan_metadata_ptr_for_store_4+0x0: call to __fentry__() with UACCESS enabled
2 mm/kmsan/instrumentation.o: warning: objtool: __msan_metadata_ptr_for_store_2+0x0: call to __fentry__() with UACCESS enabled
2 mm/kmsan/instrumentation.o: warning: objtool: __msan_metadata_ptr_for_store_1+0x0: call to __fentry__() with UACCESS enabled
2 mm/kmsan/instrumentation.o: warning: objtool: __msan_metadata_ptr_for_load_n+0x0: call to __fentry__() with UACCESS enabled
2 mm/kmsan/instrumentation.o: warning: objtool: __msan_metadata_ptr_for_load_8+0x0: call to __fentry__() with UACCESS enabled
2 mm/kmsan/instrumentation.o: warning: objtool: __msan_metadata_ptr_for_load_4+0x0: call to __fentry__() with UACCESS enabled
2 mm/kmsan/instrumentation.o: warning: objtool: __msan_metadata_ptr_for_load_2+0x0: call to __fentry__() with UACCESS enabled
2 mm/kmsan/instrumentation.o: warning: objtool: __msan_metadata_ptr_for_load_1+0x0: call to __fentry__() with UACCESS enabled
2 mm/kmsan/instrumentation.o: warning: objtool: __msan_instrument_asm_store+0x0: call to __fentry__() with UACCESS enabled
2 mm/kmsan/instrumentation.o: warning: objtool: __msan_get_context_state+0x0: call to __fentry__() with UACCESS enabled
2 mm/kmsan/instrumentation.o: warning: objtool: __msan_chain_origin+0x0: call to __fentry__() with UACCESS enabled
2 mm/kmsan/hooks.o: warning: objtool: kmsan_unpoison_memory+0x0: call to __fentry__() with UACCESS enabled
2 mm/kmsan/hooks.o: warning: objtool: kmsan_unpoison_entry_regs+0x0: call to __fentry__() with UACCESS enabled
2 mm/kmsan/hooks.o: warning: objtool: kmsan_copy_to_user+0x0: call to __fentry__() with UACCESS enabled
2 fs/reiserfs/lbalance.o: warning: objtool: leaf_move_items+0x7ab: stack state mismatch: cfa1=4+160 cfa2=4+152
2 drivers/video/fbdev/omap2/omapfb/dss/omapdss.o: warning: objtool: hdmi_power_on_full.isra.0+0x5e: unreachable instruction
2 drivers/net/wwan/iosm/iosm.o: warning: objtool: ipc_imem_run_state_worker() falls through to next function ipc_imem_startup_timer_cb() 2 drivers/iio/imu/bmi160/bmi160_core.o: warning: objtool: bmi160_setup_irq() falls through to next function bmi160_data_rdy_trigger_set_state() 1 vmlinux.o: warning: objtool: trace_initcall_finish+0xee: unreachable instruction
1 vmlinux.o: warning: objtool: native_sched_clock_from_tsc+0x60: unreachable instruction
1 vmlinux.o: warning: objtool: lpass_cdc_dma_daiops_trigger() falls through to next function lpass_hdmi_daiops_hw_params()
1 drivers/crypto/keembay/keembay-ocs-hcu.o: warning: objtool: ocs_hcu_hmac+0x153: stack state mismatch: cfa1=4+136 cfa2=5+48
1 arch/x86/kvm/kvm-amd.o: warning: objtool: .altinstr_replacement+0x108: call without frame pointer save/setup
Quoted 14 lines · Arnd Bergmann
Hi Josh and Peter,
I've updated my randconfig test setup to use gcc-13 and clang-16, and have sent fixes for all normal WERROR=y build warnings, but there are a lot of objtool warnings that remain. I've reported some of them in the past, some others are new. It would be nice to at least reduce the number of warnings either through code changes or workarounds in objtool for any false positives.
Out of 1500 builds, about a third had any warnings, this is the full list sorted by frequency. Let me know if there are any that you haven't seen before, I can provide the corresponding object and config files for reproducing.
Quoted 6 lines
Arnd
8<---
205mm/kasan/shadow.o: warning: objtool:__asan_memset+0x2e: call to__memset()with UACCESS enabled 205mm/kasan/shadow.o: warning: objtool:__asan_memmove+0x48: call to__memmove()with UACCESS enabled 205mm/kasan/shadow.o: warning: objtool:__asan_memcpy+0x48: call to__memcpy()with UACCESS enabled
Patch pending here:
Quoted 1 line
80 vmlinux.o: warning: objtool:
ibt_selftest+0x11: sibling call from callable instruction with modified stack frame
Can you provide details on how to reproduce this?
Quoted 1 line
49 vmlinux.o: warning: objtool:
lkdtm_UNSET_SMEP+0x100: relocation to !ENDBR:native_write_cr4+0x4
That one was on purpose I think.
Quoted 2 lines
29
mm/kasan/generic.o: warning: objtool:kasan_check_range+0x1e: call toaddr_has_metadata()with UACCESS enabled 29mm/kasan/generic.o: warning: objtool:__asan_load2+0x11: call toaddr_has_metadata()with UACCESS enabled
I'm thinking addr_has_metadata() needs the __always_inline treatment, it seems to be present a lot.
Quoted 8 lines
28
mm/kasan/generic.o: warning: objtool:__asan_store16+0x11: call toaddr_has_metadata()with UACCESS enabled 28mm/kasan/generic.o: warning: objtool:__asan_load16+0x11: call toaddr_has_metadata()with UACCESS enabled 22mm/kasan/generic.o: warning: objtool:__asan_load4+0x11: call toaddr_has_metadata()with UACCESS enabled 21mm/kasan/generic.o: warning: objtool:__asan_store4+0x11: call toaddr_has_metadata()with UACCESS enabled 21mm/kasan/generic.o: warning: objtool:__asan_store1+0x11: call toaddr_has_metadata()with UACCESS enabled 21mm/kasan/generic.o: warning: objtool:__asan_load8+0x11: call toaddr_has_metadata()with UACCESS enabled 21mm/kasan/generic.o: warning: objtool:__asan_load1+0x11: call toaddr_has_metadata()with UACCESS enabled
Quoted 8 lines
29
drivers/gpu/drm/vmwgfx/vmwgfx_msg.o: warning: objtool:vmw_port_hb_out+0x15e: return with modified stack frame 29drivers/gpu/drm/vmwgfx/vmwgfx_msg.o: warning: objtool:vmw_port_hb_out+0x11d: stack state mismatch: cfa1=5+16 cfa2=4+8 29drivers/gpu/drm/vmwgfx/vmwgfx_msg.o: warning: objtool:vmw_port_hb_in+0x150: return with modified stack frame 29drivers/gpu/drm/vmwgfx/vmwgfx_msg.o: warning: objtool:vmw_port_hb_in+0x13d: stack state mismatch: cfa1=5+16 cfa2=4+8 29drivers/gpu/drm/vmwgfx/vmwgfx.o: warning: objtool:vmw_port_hb_out+0xe2: return with modified stack frame 29drivers/gpu/drm/vmwgfx/vmwgfx.o: warning: objtool:vmw_port_hb_out+0xd1: stack state mismatch: cfa1=5+16 cfa2=4+8 29drivers/gpu/drm/vmwgfx/vmwgfx.o: warning: objtool:vmw_port_hb_in+0xea: return with modified stack frame 29drivers/gpu/drm/vmwgfx/vmwgfx.o: warning: objtool:vmw_port_hb_in+0xcc: stack state mismatch: cfa1=5+16 cfa2=4+8
Repro details?
Quoted 3 lines
18
fs/reiserfs/reiserfs.o: warning: objtool:balance_internal+0x1238: stack state mismatch: cfa1=4+248 cfa2=4+256 18fs/reiserfs/ibalance.o: warning: objtool:balance_internal+0x10a2: stack state mismatch: cfa1=4+232 cfa2=4+256 17arch/x86/coco/tdx/tdcall.o: warning: objtool:__tdx_hypercall+0xb0: return with modified stack frame
Fix on list somewhere..
Quoted 2 lines
15 vmlinux.o: warning: objtool:
ftrace_likely_update+0xd2: call to__stack_chk_fail()with UACCESS enabled 15kernel/trace/trace_branch.o: warning: objtool:ftrace_likely_update+0x201: call to__stack_chk_fail()with UACCESS enabled
-EWONTFIX, TRACE_BRANCH_PROFILING is fundamentally incompatible with lots of things.
Quoted 4 lines
14
mm/kasan/generic.o: warning: objtool:__asan_store2+0x11: call toaddr_has_metadata()with UACCESS enabled 13mm/kasan/generic.o: warning: objtool:__asan_store8+0x11: call toaddr_has_metadata()with UACCESS enabled14
arch/x86/kvm/kvm.o: warning: objtool: .text+0x0: unreachable instruction
details?
Quoted 36 lines
11 vmlinux.o: warning: objtool:
replace_key+0x1b2: stack state mismatch: cfa1=4+72 cfa2=4+88
8 vmlinux.o: warning: objtool:set_ftrace_ops_ro+0x49: relocation to !ENDBR:kgdb_ll_trap+0x6a
8 vmlinux.o: warning: objtool:set_ftrace_ops_ro+0x28: relocation to !ENDBR:kgdb_arch_late+0x193
8 vmlinux.o: warning: objtool:set_ftrace_ops_ro+0x23: relocation to !ENDBR:kexec_mark_range+0x13
8 vmlinux.o: warning: objtool:set_ftrace_ops_ro+0x23: relocation to !ENDBR:kexec_mark_crashkres+0x53
8 vmlinux.o: warning: objtool:set_ftrace_ops_ro+0x23: relocation to !ENDBR: .text+0x4b314
8drivers/media/platform/qcom/camss/qcom-camss.o: warning: objtool:csiphy_lanes_enable()falls through to next function__cfi_csiphy_hw_version_read()8drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.o: warning: objtool:csiphy_lanes_enable()falls through to next function__cfi_csiphy_get_lane_mask()7 vmlinux.o: warning: objtool:internal_move_pointers_items+0x3fa: stack state mismatch: cfa1=4+144 cfa2=4+136
7fs/jffs2/jffs2.o: warning: objtool:jffs2_erase_pending_blocks()falls through to next functionjffs2_free_jeb_node_refs()
7fs/jffs2/erase.o: warning: objtool:jffs2_erase_pending_blocks()falls through to next function__cfi_jffs2_free_jeb_node_refs()
7drivers/hwmon/pmbus/adm1275.o: warning: objtool:adm1275_probe+0x574: unreachable instruction
5 vmlinux.o: warning: objtool:exynos3250_cmu_isp_probe+0x17: unreachable instruction
5arch/x86/mm/fault.o: warning: objtool:do_user_addr_fault+0x2c0: unreachable instruction
5arch/x86/kvm/kvm-amd.o: warning: objtool:__svm_vcpu_run+0x141: BP used as a scratch register
5arch/x86/kvm/kvm-amd.o: warning: objtool:__svm_sev_es_vcpu_run+0x36: BP used as a scratch register
4 vmlinux.o: warning: objtool:resume_play_dead+0xe: unreachable instruction
4 vmlinux.o: warning: objtool:hyperv_init+0x55c: unreachable instruction
4 vmlinux.o: warning: objtool:do_idle+0x15e: unreachable instruction
4drivers/media/i2c/m5mols/m5mols_core.o: warning: objtool:m5mols_set_fmt()falls through to next function__cfi_m5mols_get_frame_desc()3 vmlinux.o: warning: objtool:nmi_panic+0x2d: unreachable instruction
3 vmlinux.o: warning: objtool:mptscsih_abort+0x319: unreachable instruction
3 vmlinux.o: warning: objtool:internal_delete_pointers_items+0x392: stack state mismatch: cfa1=4+136 cfa2=4+144
3 vmlinux.o: warning: objtool:emulate_vsyscall+0x1ff: unreachable instruction
3 vmlinux.o: warning: objtool:do_arch_prctl_64+0x1ac: unreachable instruction
3fs/xfs/libxfs/xfs_da_btree.o: warning: objtool:xfs_da_grow_inode_int+0x397: stack state mismatch: reg1[12]=-2-48 reg2[12]=-1+0
3drivers/spi/spi-amd.o: warning: objtool:amd_spi_master_transfer()falls through to next function__cfi_amd_spi_max_transfer_size()3drivers/pwm/pwm-mediatek.o: warning: objtool: .text: unexpected end of section
3drivers/gpu/drm/i915/gt/intel_timeline.o: warning: objtool:live_hwsp_read+0x318: stack state mismatch: cfa1=4+240 cfa2=5+48
3arch/x86/entry/entry_64.o: warning: objtool: .entry.text+0xba7: unreachable instruction
2 vmlinux.o: warning: objtool:xenpv_exc_double_fault+0x9: unreachable instruction
2 vmlinux.o: warning: objtool:pwm_mediatek_apply()falls through to next functionmtk_disp_pwm_probe()
2 vmlinux.o: warning: objtool:force_ibs_eilvt_setup+0xad: unreachable instruction
2 vmlinux.o: warning: objtool:exynos7885_cmu_probe+0x1b: unreachable instruction
2 vmlinux.o: warning: objtool:do_one_initcall+0x1f6: unreachable instruction
Quoted 1 line
2
mm/kmsan/report.o: warning: objtool:kmsan_report+0x0: call to__fentry__()with UACCESS enabled
mm/kasan/Makefil:CFLAGS_REMOVE_report.o = $(CC_FLAGS_FTRACE)
How?!?!

Quoted 10 lines
2
mm/kmsan/instrumentation.o: warning: objtool:__msan_warning+0x0: call to__fentry__()with UACCESS enabled 2mm/kmsan/instrumentation.o: warning: objtool:__msan_poison_alloca+0x0: call to__fentry__()with UACCESS enabled 2mm/kmsan/instrumentation.o: warning: objtool:__msan_metadata_ptr_for_store_n+0x0: call to__fentry__()with UACCESS enabled 2mm/kmsan/instrumentation.o: warning: objtool:__msan_metadata_ptr_for_store_8+0x0: call to__fentry__()with UACCESS enabled 2mm/kmsan/instrumentation.o: warning: objtool:__msan_metadata_ptr_for_store_4+0x0: call to__fentry__()with UACCESS enabled 2mm/kmsan/instrumentation.o: warning: objtool:__msan_metadata_ptr_for_store_2+0x0: call to__fentry__()with UACCESS enabled 2mm/kmsan/instrumentation.o: warning: objtool:__msan_metadata_ptr_for_store_1+0x0: call to__fentry__()with UACCESS enabled 2mm/kmsan/instrumentation.o: warning: objtool:__msan_metadata_ptr_for_load_n+0x0: call to__fentry__()with UACCESS enabled 2mm/kmsan/instrumentation.o: warning: objtool:__msan_metadata_ptr_for_load_8+0x0: call to__fentry__()with UACCESS enabled 2mm/kmsan/instrumentation.o: warning: objtool:__msan_metadata_ptr_for_load_4+0x0: call to__fentry__()with UACCESS enabled
Quoted 8 lines
2
mm/kmsan/instrumentation.o: warning: objtool:__msan_metadata_ptr_for_load_2+0x0: call to__fentry__()with UACCESS enabled 2mm/kmsan/instrumentation.o: warning: objtool:__msan_metadata_ptr_for_load_1+0x0: call to__fentry__()with UACCESS enabled 2mm/kmsan/instrumentation.o: warning: objtool:__msan_instrument_asm_store+0x0: call to__fentry__()with UACCESS enabled 2mm/kmsan/instrumentation.o: warning: objtool:__msan_get_context_state+0x0: call to__fentry__()with UACCESS enabled 2mm/kmsan/instrumentation.o: warning: objtool:__msan_chain_origin+0x0: call to__fentry__()with UACCESS enabled 2mm/kmsan/hooks.o: warning: objtool:kmsan_unpoison_memory+0x0: call to__fentry__()with UACCESS enabled 2mm/kmsan/hooks.o: warning: objtool:kmsan_unpoison_entry_regs+0x0: call to__fentry__()with UACCESS enabled 2mm/kmsan/hooks.o: warning: objtool:kmsan_copy_to_user+0x0: call to__fentry__()with UACCESS enabled
Something seems to be going badly wrong there... notrace is being lost.
Quoted 22 lines · Peter Zijlstra
Quoted 14 lines · Arnd Bergmann
Hi Josh and Peter,
I've updated my randconfig test setup to use gcc-13 and clang-16, and have sent fixes for all normal WERROR=y build warnings, but there are a lot of objtool warnings that remain. I've reported some of them in the past, some others are new. It would be nice to at least reduce the number of warnings either through code changes or workarounds in objtool for any false positives.
Out of 1500 builds, about a third had any warnings, this is the full list sorted by frequency. Let me know if there are any that you haven't seen before, I can provide the corresponding object and config files for reproducing.
Quoted 6 lines
Arnd
8<---
205mm/kasan/shadow.o: warning: objtool:__asan_memset+0x2e: call to__memset()with UACCESS enabled 205mm/kasan/shadow.o: warning: objtool:__asan_memmove+0x48: call to__memmove()with UACCESS enabled 205mm/kasan/shadow.o: warning: objtool:__asan_memcpy+0x48: call to__memcpy()with UACCESS enabled
Quoted 8 lines
Patch pending here:
Quoted 1 line
80 vmlinux.o: warning: objtool:
ibt_selftest+0x11: sibling call from callable instruction with modified stack frameCan you provide details on how to reproduce this?
Arnd, thanks for rounding these up and posting them.
I agree we need to get these all cleaned up, but before we go too far down the rabbit hole, is there some better way to track these?
Not that I would suggest using an external tracker, but maybe at least put each set of related warnings (e.g., those having the same frequency) in its own subthread with the config/compiler info included.
Signature · 1 line
Josh
Quoted 33 lines · Josh Poimboeuf
Quoted 22 lines · Peter Zijlstra
Quoted 14 lines · Arnd Bergmann
Hi Josh and Peter,
I've updated my randconfig test setup to use gcc-13 and clang-16, and have sent fixes for all normal WERROR=y build warnings, but there are a lot of objtool warnings that remain. I've reported some of them in the past, some others are new. It would be nice to at least reduce the number of warnings either through code changes or workarounds in objtool for any false positives.
Out of 1500 builds, about a third had any warnings, this is the full list sorted by frequency. Let me know if there are any that you haven't seen before, I can provide the corresponding object and config files for reproducing.
Quoted 6 lines
Arnd
8<---
205mm/kasan/shadow.o: warning: objtool:__asan_memset+0x2e: call to__memset()with UACCESS enabled 205mm/kasan/shadow.o: warning: objtool:__asan_memmove+0x48: call to__memmove()with UACCESS enabled 205mm/kasan/shadow.o: warning: objtool:__asan_memcpy+0x48: call to__memcpy()with UACCESS enabledQuoted 8 lines
Patch pending here:
Quoted 1 line
80 vmlinux.o: warning: objtool:
ibt_selftest+0x11: sibling call from callable instruction with modified stack frameCan you provide details on how to reproduce this?
Quoted 8 lines
Arnd, thanks for rounding these up and posting them.
I agree we need to get these all cleaned up, but before we go too far down the rabbit hole, is there some better way to track these?
Not that I would suggest using an external tracker, but maybe at least put each set of related warnings (e.g., those having the same frequency) in its own subthread with the config/compiler info included.
If any are specific to clang, please use
https://github.com/ClangBuiltLinux/linux/issues
We have a tag for issues flagged by objtool
https://github.com/ClangBuiltLinux/linux/issues?q=is%3Aopen+is%3Aissue+label%3A%22%5BTOOL%5D+objtool%22
Quoted 4 lines
--
Josh
Signature · 2 lines
Thanks, ~Nick Desaulniers
Quoted 4 lines · Peter Zijlstra
Quoted 2 lines
80 vmlinux.o: warning: objtool:
ibt_selftest+0x11: sibling call from callable instruction with modified stack frameCan you provide details on how to reproduce this?
I see this one with clang-14 and clang-16, presumably other versions but not gcc, the function disassembles the clang version into
0000000000000140 <ibt_selftest>:
140: f3 0f 1e fa endbr64 144: 55 push %rbp 145: 48 89 e5 mov %rsp,%rbp 148: 48 8d 05 02 00 00 00 lea 0x2(%rip),%rax # 151 <ibt_selftest_ip> 14f: ff e0 jmp *%rax
while the gcc version looks correct with
00000000000005c0 <ibt_selftest>:
5c0: f3 0f 1e fa endbr64 5c4: 48 8d 05 02 00 00 00 lea 0x2(%rip),%rax # 5cd <ibt_selftest_ip> 5cb: ff e0 jmp *%rax
Attached as 0x1A63498B-traps.o.gz and 0x1A63498B-config.gz, the hexadecimal number is the randconfig seed I used.
Quoted 3 lines
Quoted 1 line
49 vmlinux.o: warning: objtool:
lkdtm_UNSET_SMEP+0x100: relocation to !ENDBR:native_write_cr4+0x4That one was on purpose I think.
Do you mean objtool intentionally warns, or the code intentionally does it but objtool should ignore it? I would assume that only one of them is right.
Quoted 5 lines
Quoted 2 lines
29
mm/kasan/generic.o: warning: objtool:kasan_check_range+0x1e: call toaddr_has_metadata()with UACCESS enabled 29mm/kasan/generic.o: warning: objtool:__asan_load2+0x11: call toaddr_has_metadata()with UACCESS enabledI'm thinking
addr_has_metadata()needs the__always_inlinetreatment, it seems to be present a lot.
Makes sense, I'll send a patch.
Quoted 10 lines
Quoted 8 lines
29
drivers/gpu/drm/vmwgfx/vmwgfx_msg.o: warning: objtool:vmw_port_hb_out+0x15e: return with modified stack frame 29drivers/gpu/drm/vmwgfx/vmwgfx_msg.o: warning: objtool:vmw_port_hb_out+0x11d: stack state mismatch: cfa1=5+16 cfa2=4+8 29drivers/gpu/drm/vmwgfx/vmwgfx_msg.o: warning: objtool:vmw_port_hb_in+0x150: return with modified stack frame 29drivers/gpu/drm/vmwgfx/vmwgfx_msg.o: warning: objtool:vmw_port_hb_in+0x13d: stack state mismatch: cfa1=5+16 cfa2=4+8 29drivers/gpu/drm/vmwgfx/vmwgfx.o: warning: objtool:vmw_port_hb_out+0xe2: return with modified stack frame 29drivers/gpu/drm/vmwgfx/vmwgfx.o: warning: objtool:vmw_port_hb_out+0xd1: stack state mismatch: cfa1=5+16 cfa2=4+8 29drivers/gpu/drm/vmwgfx/vmwgfx.o: warning: objtool:vmw_port_hb_in+0xea: return with modified stack frame 29drivers/gpu/drm/vmwgfx/vmwgfx.o: warning: objtool:vmw_port_hb_in+0xcc: stack state mismatch: cfa1=5+16 cfa2=4+8Repro details?
last seen with gcc-13.0.1, but I think this happened with most older versions already, attached 0x2D9ADB20-vmwgfx_msg.o
Quoted 5 lines
Quoted 2 lines
15 vmlinux.o: warning: objtool:
ftrace_likely_update+0xd2: call to__stack_chk_fail()with UACCESS enabled 15kernel/trace/trace_branch.o: warning: objtool:ftrace_likely_update+0x201: call to__stack_chk_fail()with UACCESS enabled
-EWONTFIX,TRACE_BRANCH_PROFILINGis fundamentally incompatible with lots of things.
I see CONFIG_X86_SMAP is now always enabled, does that mean that TRACE_BRANCH_PROFILING no longer works at all on x86, or would it still work most of the time?
Quoted 3 lines
Quoted 1 line
14
arch/x86/kvm/kvm.o: warning: objtool: .text+0x0: unreachable instructiondetails?
I see this with clang-14 through clang-16 or gcc. From an initial analysis I see that virt/kvm/kvm_main.o contains empty __weak versions of kvm_arch_mmu_notifier_invalidate_range and kvm_arch_guest_memory_reclaimed.
For some reason, after linking (with ld.bfd or ld.lld) the file into arch/x86/kvm/kvm.o, the code for those two functions remains, but without a symbol, which leads to a funny disassembly:
Disassembly of section .text:
0000000000000000 <kvm_is_zone_device_page-0x80>:
0: f3 0f 1e fa endbr64
4: c3 ret
5: 66 66 66 66 66 66 2e data16 data16 data16 data16 data16 cs nopw 0x0(%rax,%rax,1)
c: 0f 1f 84 00 00 00 00
13: 00
14: 66 66 66 66 66 66 2e data16 data16 data16 data16 data16 cs nopw 0x0(%rax,%rax,1)
1b: 0f 1f 84 00 00 00 00
22: 00
23: 66 66 66 66 66 66 2e data16 data16 data16 data16 data16 cs nopw 0x0(%rax,%rax,1)
2a: 0f 1f 84 00 00 00 00
31: 00
32: 66 66 66 66 66 2e 0f data16 data16 data16 data16 cs nopw 0x0(%rax,%rax,1)
39: 1f 84 00 00 00 00 00
40: f3 0f 1e fa endbr64
44: c3 ret
45: 66 66 66 66 66 66 2e data16 data16 data16 data16 data16 cs nopw 0x0(%rax,%rax,1)
4c: 0f 1f 84 00 00 00 00
53: 00
54: 66 66 66 66 66 66 2e data16 data16 data16 data16 data16 cs nopw 0x0(%rax,%rax,1)
5b: 0f 1f 84 00 00 00 00
62: 00
63: 66 66 66 66 66 66 2e data16 data16 data16 data16 data16 cs nopw 0x0(%rax,%rax,1)
6a: 0f 1f 84 00 00 00 00
71: 00
72: 66 66 66 66 66 2e 0f data16 data16 data16 data16 cs nopw 0x0(%rax,%rax,1)
79: 1f 84 00 00 00 00 00 0000000000000080 <kvm_is_zone_device_page>:
80: f3 0f 1e fa endbr64
....
When kvm_main.o is built with gcc, the two functions do not appear to be part of the object file, but I don't see why not.
Attaching 0x6BC495CE-kvm_main-gcc.o and 0x6BC495CE-kvm_main-clang.o
Quoted 25 lines
Quoted 1 line
2
mm/kmsan/report.o: warning: objtool:kmsan_report+0x0: call to__fentry__()with UACCESS enabledmm/kasan/Makefil:CFLAGS_REMOVE_report.o = $(CC_FLAGS_FTRACE)
How?!?!
Quoted 10 lines
2
mm/kmsan/instrumentation.o: warning: objtool:__msan_warning+0x0: call to__fentry__()with UACCESS enabled 2mm/kmsan/instrumentation.o: warning: objtool:__msan_poison_alloca+0x0: call to__fentry__()with UACCESS enabled 2mm/kmsan/instrumentation.o: warning: objtool:__msan_metadata_ptr_for_store_n+0x0: call to__fentry__()with UACCESS enabled 2mm/kmsan/instrumentation.o: warning: objtool:__msan_metadata_ptr_for_store_8+0x0: call to__fentry__()with UACCESS enabled 2mm/kmsan/instrumentation.o: warning: objtool:__msan_metadata_ptr_for_store_4+0x0: call to__fentry__()with UACCESS enabled 2mm/kmsan/instrumentation.o: warning: objtool:__msan_metadata_ptr_for_store_2+0x0: call to__fentry__()with UACCESS enabled 2mm/kmsan/instrumentation.o: warning: objtool:__msan_metadata_ptr_for_store_1+0x0: call to__fentry__()with UACCESS enabled 2mm/kmsan/instrumentation.o: warning: objtool:__msan_metadata_ptr_for_load_n+0x0: call to__fentry__()with UACCESS enabled 2mm/kmsan/instrumentation.o: warning: objtool:__msan_metadata_ptr_for_load_8+0x0: call to__fentry__()with UACCESS enabled 2mm/kmsan/instrumentation.o: warning: objtool:__msan_metadata_ptr_for_load_4+0x0: call to__fentry__()with UACCESS enabledQuoted 8 lines
2
mm/kmsan/instrumentation.o: warning: objtool:__msan_metadata_ptr_for_load_2+0x0: call to__fentry__()with UACCESS enabled 2mm/kmsan/instrumentation.o: warning: objtool:__msan_metadata_ptr_for_load_1+0x0: call to__fentry__()with UACCESS enabled 2mm/kmsan/instrumentation.o: warning: objtool:__msan_instrument_asm_store+0x0: call to__fentry__()with UACCESS enabled 2mm/kmsan/instrumentation.o: warning: objtool:__msan_get_context_state+0x0: call to__fentry__()with UACCESS enabled 2mm/kmsan/instrumentation.o: warning: objtool:__msan_chain_origin+0x0: call to__fentry__()with UACCESS enabled 2mm/kmsan/hooks.o: warning: objtool:kmsan_unpoison_memory+0x0: call to__fentry__()with UACCESS enabled 2mm/kmsan/hooks.o: warning: objtool:kmsan_unpoison_entry_regs+0x0: call to__fentry__()with UACCESS enabled 2mm/kmsan/hooks.o: warning: objtool:kmsan_copy_to_user+0x0: call to__fentry__()with UACCESS enabled
Quoted 1 line
Something seems to be going badly wrong there... notrace is being lost.
It's kmsan, not kasan!
I'll send a patch to copy the relevant Makefile bits from kasan to kmsan:
mm/kmsan/Makefile +8 -0
@@ -16,6 +16,14 @@ CC_FLAGS_KMSAN_RUNTIME += -DDISABLE_BRANCH_PROFILING CFLAGS_REMOVE.o = $(CC_FLAGS_FTRACE) +# Disable ftrace to avoid recursion. +CFLAGS_REMOVE_core.o = $(CC_FLAGS_FTRACE) +CFLAGS_REMOVE_hooks.o = $(CC_FLAGS_FTRACE) +CFLAGS_REMOVE_init.o = $(CC_FLAGS_FTRACE) +CFLAGS_REMOVE_instrumentation.o = $(CC_FLAGS_FTRACE) +CFLAGS_REMOVE_report.o = $(CC_FLAGS_FTRACE) +CFLAGS_REMOVE_shadow.o = $(CC_FLAGS_FTRACE) + CFLAGS_core.o := $(CC_FLAGS_KMSAN_RUNTIME) CFLAGS_hooks.o := $(CC_FLAGS_KMSAN_RUNTIME) CFLAGS_init.o := $(CC_FLAGS_KMSAN_RUNTIME)
Arnd