Skip to content

Comments

Add -Zsanitize=kernel-hwaddress#153049

Draft
Darksonn wants to merge 1 commit intorust-lang:mainfrom
Darksonn:kasan-sw-tags
Draft

Add -Zsanitize=kernel-hwaddress#153049
Darksonn wants to merge 1 commit intorust-lang:mainfrom
Darksonn:kasan-sw-tags

Conversation

@Darksonn
Copy link
Member

@Darksonn Darksonn commented Feb 24, 2026

The Linux kernel has a config option called CONFIG_KASAN_SW_TAGS that enables -fsanitize=kernel-hwaddress. This is not supported by Rust.

Note that #[sanitize(kernel_hwaddress = "off")] could be supported as an annotation on statics, but since it's also missing for #[sanitize(hwaddress = "off")], I did not add it.

cc @rcvalle @maurer @ojeda

@Darksonn Darksonn added the A-sanitizers Area: Sanitizers for correctness and code quality label Feb 24, 2026
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-compiletest Area: The compiletest test runner A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-testsuite Area: The testsuite used to check the correctness of rustc PG-exploit-mitigations Project group: Exploit mitigations S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 24, 2026
@rust-log-analyzer

This comment has been minimized.

Signed-off-by: Alice Ryhl <aliceryhl@google.com>
@rust-log-analyzer
Copy link
Collaborator

The job aarch64-gnu-llvm-20-1 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
REPOSITORY                                   TAG       IMAGE ID       CREATED       SIZE
ghcr.io/dependabot/dependabot-updater-core   latest    afc745c7535d   4 weeks ago   783MB
=> Removing docker images...
Deleted Images:
untagged: ghcr.io/dependabot/dependabot-updater-core:latest
untagged: ghcr.io/dependabot/dependabot-updater-core@sha256:faae3d3a1dedd24cde388bb506bbacc0f7ed1eae99ebac129af66acd8540c84a
deleted: sha256:afc745c7535da1bb12f92c273b9a7e9c52c3f12c5873714b2542da259c6d9769
deleted: sha256:64e147d5e54d9be8b8aa322e511cda02296eda4b8b8d063c6a314833aca50e29
deleted: sha256:5cba409bb463f4e7fa1a19f695450170422582c1bc7c0e934d893b4e5f558bc6
deleted: sha256:cddc6ebd344b0111eaab170ead1dfda24acdfe865ed8a12599a34d338fa8e28b
deleted: sha256:2412c3f334d79134573cd45e657fb6cc0abd75bef3881458b0d498d936545c8d
---
test [ui] tests/ui/abi/abi-sysv64-register-usage.rs ... ignored, ignored when the architecture is aarch64
test [ui] tests/ui/abi/abi-typo-unstable.rs#feature_disabled ... ok
test [ui] tests/ui/abi/abi-typo-unstable.rs#feature_enabled ... ok
test [ui] tests/ui/abi/anon-extern-mod.rs ... ok
test [ui] tests/ui/abi/avr-sram.rs#disable_sram ... ok
test [ui] tests/ui/abi/avr-sram.rs#has_sram ... ok
test [ui] tests/ui/abi/arm-unadjusted-intrinsic.rs#aarch64 ... ok
test [ui] tests/ui/abi/avr-sram.rs#no_sram ... ok
test [ui] tests/ui/abi/arm-unadjusted-intrinsic.rs#arm ... ok
test [ui] tests/ui/abi/bad-custom.rs ... ok
test [ui] tests/ui/abi/c-stack-as-value.rs ... ok
test [ui] tests/ui/abi/c-zst.rs#aarch64-darwin ... ok
test [ui] tests/ui/abi/c-zst.rs#powerpc-linux ... ok
---
test [ui] tests/ui/asm/aarch64/type-check-2-2.rs ... ok
test [ui] tests/ui/asm/aarch64/ttbr0_el2.rs ... ok
test [ui] tests/ui/asm/aarch64/may_unwind.rs ... ok
test [ui] tests/ui/asm/aarch64/type-check-3.rs ... ok
test [ui] tests/ui/asm/aarch64v8r.rs#hf ... ok
test [ui] tests/ui/asm/aarch64/type-check-2.rs ... ok
test [ui] tests/ui/asm/aarch64/type-f16.rs ... ok
test [ui] tests/ui/asm/aarch64/sym.rs ... ok
test [ui] tests/ui/asm/aarch64v8r.rs#sf ... ok
test [ui] tests/ui/asm/aarch64v8r.rs#r82 ... ok
test [ui] tests/ui/asm/arm-low-dreg.rs ... ok
test [ui] tests/ui/asm/binary_asm_labels.rs ... ignored, only executed when the architecture is x86_64
test [ui] tests/ui/asm/asm-with-nested-closure.rs ... ok
test [ui] tests/ui/asm/cfg-parse-error.rs ... ok
test [ui] tests/ui/asm/cfg.rs#reva ... ignored, only executed when the architecture is x86_64
---
test [ui] tests/ui/const-generics/occurs-check/unused-substs-2.rs ... ok
test [ui] tests/ui/const-generics/occurs-check/unused-substs-3.rs ... ok
test [ui] tests/ui/const-generics/occurs-check/unused-substs-4.rs ... ok
test [ui] tests/ui/const-generics/occurs-check/unused-substs-5.rs ... ok
test [ui] tests/ui/const-generics/ogca/basic-fail.rs ... ok
test [ui] tests/ui/const-generics/ogca/basic.rs ... ok
test [ui] tests/ui/const-generics/ogca/rhs-but-not-root.rs ... ok
test [ui] tests/ui/const-generics/ogca/coherence-ambiguous.rs ... ok
test [ui] tests/ui/const-generics/opaque_types.rs ... ok
test [ui] tests/ui/const-generics/outer-lifetime-in-const-generic-default.rs ... ok
test [ui] tests/ui/const-generics/opaque_types2.rs ... ok
test [ui] tests/ui/const-generics/overlapping_impls.rs ... ok
test [ui] tests/ui/const-generics/params-in-ct-in-ty-param-lazy-norm.rs#full ... ok
---
test [ui] tests/ui/extern/issue-64655-extern-rust-must-allow-unwind.rs#fat3 ... ok
test [ui] tests/ui/extern/issue-64655-extern-rust-must-allow-unwind.rs#thin1 ... ok
test [ui] tests/ui/extern/issue-95829.rs ... ok
test [ui] tests/ui/extern/issue-80074.rs ... ok
test [ui] tests/ui/extern/lgamma-linkage.rs ... ok
test [ui] tests/ui/extern/not-in-block.rs ... ok
test [ui] tests/ui/extern/no-mangle-associated-fn.rs ... ok
test [ui] tests/ui/extern/unsized-extern-derefmove.rs ... ok
test [ui] tests/ui/feature-gates/allow-features-empty.rs ... ok
test [ui] tests/ui/feature-gates/allow-features.rs ... ok
---
test [ui] tests/ui/feature-gates/feature-gate-macro-derive.rs ... ok
test [ui] tests/ui/feature-gates/feature-gate-macro-metavar-expr-concat.rs ... ok
test [ui] tests/ui/feature-gates/feature-gate-marker_trait_attr.rs ... ok
test [ui] tests/ui/feature-gates/feature-gate-may-dangle.rs ... ok
test [ui] tests/ui/feature-gates/feature-gate-mgca-type-const-syntax.rs ... ok
test [ui] tests/ui/feature-gates/feature-gate-min-generic-const-args.rs ... ok
test [ui] tests/ui/feature-gates/feature-gate-movrs_target_feature.rs ... ignored, only executed when the architecture is x86_64
test [ui] tests/ui/feature-gates/feature-gate-more-maybe-bounds.rs ... ok
test [ui] tests/ui/feature-gates/feature-gate-more-qualified-paths.rs ... ok
test [ui] tests/ui/feature-gates/feature-gate-naked_functions_rustic_abi.rs ... ignored, only executed when the architecture is x86_64
---
test [ui] tests/ui/imports/ambiguous-9.rs ... ok
test [ui] tests/ui/imports/ambiguous-import-visibility-module.rs ... ok
test [ui] tests/ui/imports/ambiguous-8.rs ... ok
test [ui] tests/ui/imports/ambiguous-glob-vs-expanded-extern.rs ... ok
test [ui] tests/ui/imports/ambiguous-panic-glob-vs-multiouter.rs ... ok
test [ui] tests/ui/imports/ambiguous-panic-globvsglob.rs ... ok
test [ui] tests/ui/imports/ambiguous-panic-no-implicit-prelude.rs ... ok
test [ui] tests/ui/imports/ambiguous-panic-non-prelude-core-glob.rs ... ok
test [ui] tests/ui/imports/ambiguous-panic-pick-core.rs ... ok
test [ui] tests/ui/imports/ambiguous-panic-non-prelude-std-glob.rs ... ok
test [ui] tests/ui/imports/ambiguous-panic-pick-std.rs ... ok
---
test [ui] tests/ui/layout/post-mono-layout-cycle.rs ... ok
test [ui] tests/ui/layout/randomize.rs#normal ... ok
test [ui] tests/ui/layout/randomize.rs#randomize-layout ... ok
test [ui] tests/ui/layout/null-pointer-optimization.rs ... ok
test [ui] tests/ui/layout/rigid-alias-due-to-broken-impl.rs ... ok
test [ui] tests/ui/layout/size-of-val-raw-too-big.rs ... ignored, only executed when the pointer width is 32bit (Layout computation rejects this layout for different reasons on 64-bit.)
test [ui] tests/ui/layout/reprc-power-alignment.rs ... ok
test [ui] tests/ui/layout/struct.rs ... ok
test [ui] tests/ui/layout/thaw-validate-invalid-enum.rs ... ok
test [ui] tests/ui/layout/rust-call-abi-not-a-tuple-ice-81974.rs ... ok
---
test [codegen] tests/codegen-llvm/sanitizer/dataflow-instrument-functions.rs ... ignored, ignored on targets without dataflow sanitizer
test [codegen] tests/codegen-llvm/sanitizer/cfi/emit-type-metadata-trait-objects.rs ... ok
test [codegen] tests/codegen-llvm/sanitizer/cfi/external_weak_symbols.rs ... ok
test [codegen] tests/codegen-llvm/sanitizer/cfi/normalize-integers.rs ... ok
test [codegen] tests/codegen-llvm/sanitizer/hwasan-vs-khwasan.rs#hwasan ... ok
test [codegen] tests/codegen-llvm/sanitizer/hwasan-vs-khwasan.rs#khwasan ... FAILED
test [codegen] tests/codegen-llvm/sanitizer/kasan-emits-instrumentation.rs#aarch64 ... ok
test [codegen] tests/codegen-llvm/sanitizer/kasan-emits-instrumentation.rs#aarch64v8r ... ok
test [codegen] tests/codegen-llvm/sanitizer/kasan-emits-instrumentation.rs#riscv64gc ... ok
test [codegen] tests/codegen-llvm/sanitizer/kasan-emits-instrumentation.rs#riscv64imac ... ok
test [codegen] tests/codegen-llvm/sanitizer/kasan-emits-instrumentation.rs#x86_64 ... ok
---
test [codegen] tests/codegen-llvm/sanitizer/kcfi/emit-type-metadata-trait-objects.rs#x86_64 ... ok
test [codegen] tests/codegen-llvm/sanitizer/kcfi/naked-function.rs#aarch64 ... ok
test [codegen] tests/codegen-llvm/sanitizer/kcfi/fn-ptr-reify-shim.rs#aarch64v8r ... ok
test [codegen] tests/codegen-llvm/sanitizer/kcfi/fn-ptr-reify-shim.rs#x86_64 ... ok
test [codegen] tests/codegen-llvm/sanitizer/kcfi/naked-function.rs#aarch64v8r ... ok
test [codegen] tests/codegen-llvm/sanitizer/khwasan-recover.rs#KHWASAN ... ok
test [codegen] tests/codegen-llvm/sanitizer/khwasan-lifetime-markers.rs#aarch64 ... ok
test [codegen] tests/codegen-llvm/sanitizer/kcfi/naked-function.rs#x86_64 ... ok
test [codegen] tests/codegen-llvm/sanitizer/khwasan-recover.rs#KHWASAN-RECOVER ... ok
test [codegen] tests/codegen-llvm/sanitizer/memory-track-origins.rs#MSAN-0 ... ok
test [codegen] tests/codegen-llvm/sanitizer/memory-track-origins.rs#MSAN-1 ... ok
test [codegen] tests/codegen-llvm/sanitizer/memory-track-origins.rs#MSAN-1-LTO ... ok
test [codegen] tests/codegen-llvm/sanitizer/memory-track-origins.rs#MSAN-2-LTO ... ok
test [codegen] tests/codegen-llvm/sanitizer/safestack-attr-check.rs ... ignored, ignored on targets without SafeStack support
test [codegen] tests/codegen-llvm/sanitizer/memory-track-origins.rs#MSAN-2 ... ok
test [codegen] tests/codegen-llvm/sanitizer/memtag-attr-check.rs ... ok
test [codegen] tests/codegen-llvm/sanitizer/riscv64-shadow-call-stack.rs ... ok
test [codegen] tests/codegen-llvm/sanitizer/sanitize-off-asan-kasan.rs#aarch64v8r ... ok
test [codegen] tests/codegen-llvm/sanitizer/sanitize-off-asan-kasan.rs#aarch64 ... ok
test [codegen] tests/codegen-llvm/sanitizer/sanitize-off-asan-kasan.rs#riscv64gc ... ok
test [codegen] tests/codegen-llvm/sanitizer/sanitize-off-asan-kasan.rs#riscv64imac ... ok
test [codegen] tests/codegen-llvm/sanitizer/sanitize-off-hwasan-khwasan.rs#aarch64 ... ok
test [codegen] tests/codegen-llvm/sanitizer/sanitize-off-hwasan-khwasan.rs#aarch64v8r ... ok
test [codegen] tests/codegen-llvm/sanitizer/sanitize-off-asan-kasan.rs#x86_64 ... ok
test [codegen] tests/codegen-llvm/sanitizer/sanitize-off-inlining.rs#ASAN ... ok
test [codegen] tests/codegen-llvm/sanitizer/sanitize-off-inlining.rs#LSAN ... ok
test [codegen] tests/codegen-llvm/sanitizer/sanitize-off-khwasan-hwasan.rs ... FAILED
test [codegen] tests/codegen-llvm/sanitizer/sanitize-off-kasan-asan.rs ... ok
test [codegen] tests/codegen-llvm/sanitizer/sanitize-off.rs ... ok
test [codegen] tests/codegen-llvm/sanitizer/sanitizer-recover.rs#MSAN ... ok
test [codegen] tests/codegen-llvm/sanitizer/sanitizer-recover.rs#ASAN ... ok
test [codegen] tests/codegen-llvm/sanitizer/scs-attr-check.rs ... ignored, ignored on targets without shadow call stacks
---
test [codegen] tests/codegen-llvm/virtual-function-elimination.rs ... ok

failures:

---- [codegen] tests/codegen-llvm/sanitizer/hwasan-vs-khwasan.rs#khwasan stdout ----
------FileCheck stdout------------------------------

------FileCheck stderr------------------------------
/checkout/tests/codegen-llvm/sanitizer/hwasan-vs-khwasan.rs:23:13: error: khwasan: expected string not found in input
// khwasan: call ptr asm
            ^
/checkout/obj/build/aarch64-unknown-linux-gnu/test/codegen-llvm/sanitizer/hwasan-vs-khwasan.khwasan/hwasan-vs-khwasan.ll:11:26: note: scanning from here
define dso_local i8 @test(ptr align 1 %b) unnamed_addr #0 {
                         ^
/checkout/obj/build/aarch64-unknown-linux-gnu/test/codegen-llvm/sanitizer/hwasan-vs-khwasan.khwasan/hwasan-vs-khwasan.ll:62:3: note: possible intended match here
declare ptr @memmove(ptr, ptr, i64)
  ^

Input file: /checkout/obj/build/aarch64-unknown-linux-gnu/test/codegen-llvm/sanitizer/hwasan-vs-khwasan.khwasan/hwasan-vs-khwasan.ll
Check file: /checkout/tests/codegen-llvm/sanitizer/hwasan-vs-khwasan.rs

-dump-input=help explains the following input dump.

Input was:
<<<<<<
            1: ; ModuleID = 'hwasan_vs_khwasan.54a3b2f579d13220-cgu.0' 
            2: source_filename = "hwasan_vs_khwasan.54a3b2f579d13220-cgu.0" 
            3: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32" 
            4: target triple = "aarch64-unknown-none" 
            5:  
            6: @__hwasan_tls = external thread_local(initialexec) global i64 
            7: @llvm.compiler.used = appending global [1 x ptr] [ptr @__hwasan_tls], section "llvm.metadata" 
            8: @__hwasan_shadow = external global [0 x i8] 
            9:  
           10: ; Function Attrs: noredzone nounwind sanitize_hwaddress uwtable 
           11: define dso_local i8 @test(ptr align 1 %b) unnamed_addr #0 { 
check:23'0                              X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
           12: start: 
check:23'0     ~~~~~~~
           13:  %0 = load i64, ptr @__hwasan_tls, align 8 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           14:  %1 = or i64 %0, 4294967295 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           15:  %hwasan.shadow = add i64 %1, 1 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           16:  %2 = inttoptr i64 %hwasan.shadow to ptr 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           17:  %3 = ptrtoint ptr %b to i64 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           18:  %4 = lshr i64 %3, 56 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~
           19:  %5 = trunc i64 %4 to i8 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~
           20:  %6 = or i64 %3, -72057594037927936 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           21:  %7 = lshr i64 %6, 4 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~
           22:  %8 = getelementptr i8, ptr %2, i64 %7 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           23:  %9 = load i8, ptr %8, align 1 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           24:  %10 = icmp ne i8 %5, %9 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~
           25:  %11 = icmp ne i8 %5, -1 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~
           26:  %12 = and i1 %10, %11 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~
           27:  br i1 %12, label %13, label %14, !prof !2 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           28:  
check:23'0     ~
           29: 13: ; preds = %start 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~
           30:  call void @llvm.hwasan.check.memaccess.shortgranules(ptr %2, ptr %b, i32 67043328) 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           31:  br label %14 
check:23'0     ~~~~~~~~~~~~~~
           32:  
check:23'0     ~
           33: 14: ; preds = %start, %13 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~
           34:  %_0 = load i8, ptr %b, align 1 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           35:  ret i8 %_0 
check:23'0     ~~~~~~~~~~~~
           36: } 
check:23'0     ~~
           37:  
check:23'0     ~
           38: declare void @__hwasan_loadN(i64, i64) 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           39:  
check:23'0     ~
           40: declare void @__hwasan_load1(i64) 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           41:  
check:23'0     ~
           42: declare void @__hwasan_load2(i64) 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           43:  
check:23'0     ~
           44: declare void @__hwasan_load4(i64) 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           45:  
check:23'0     ~
           46: declare void @__hwasan_load8(i64) 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           47:  
check:23'0     ~
           48: declare void @__hwasan_load16(i64) 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           49:  
check:23'0     ~
           50: declare void @__hwasan_storeN(i64, i64) 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           51:  
check:23'0     ~
           52: declare void @__hwasan_store1(i64) 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           53:  
check:23'0     ~
           54: declare void @__hwasan_store2(i64) 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           55:  
check:23'0     ~
           56: declare void @__hwasan_store4(i64) 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           57:  
check:23'0     ~
           58: declare void @__hwasan_store8(i64) 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           59:  
check:23'0     ~
           60: declare void @__hwasan_store16(i64) 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           61:  
check:23'0     ~
           62: declare ptr @memmove(ptr, ptr, i64) 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
check:23'1       ?                                  possible intended match
           63:  
check:23'0     ~
           64: declare ptr @memcpy(ptr, ptr, i64) 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           65:  
check:23'0     ~
           66: declare ptr @memset(ptr, i32, i64) 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           67:  
check:23'0     ~
           68: declare void @__hwasan_tag_memory(ptr, i8, i64) 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           69:  
check:23'0     ~
           70: declare i8 @__hwasan_generate_tag() 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           71:  
check:23'0     ~
           72: declare void @__hwasan_add_frame_record(i64) 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           73:  
check:23'0     ~
           74: declare void @__hwasan_handle_vfork(i64) 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           75:  
check:23'0     ~
           76: ; Function Attrs: nounwind 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~
           77: declare void @llvm.hwasan.check.memaccess.shortgranules(ptr, ptr, i32 immarg) #1 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           78:  
check:23'0     ~
           79: attributes #0 = { noredzone nounwind sanitize_hwaddress uwtable "probe-stack"="inline-asm" "target-cpu"="generic" "target-features"="+v8a,+strict-align,+neon,+fp-armv8" } 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           80: attributes #1 = { nounwind } 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           81:  
check:23'0     ~
           82: !llvm.ident = !{!0} 
check:23'0     ~~~~~~~~~~~~~~~~~~~~
           83: !llvm.module.flags = !{!1} 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~
           84:  
check:23'0     ~
           85: !0 = !{!"rustc version 1.95.0-nightly (faacbc416 2026-02-24)"} 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           86: !1 = !{i32 4, !"nosanitize_hwaddress", i32 1} 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           87: !2 = !{!"branch_weights", i32 1, i32 1048575} 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>>>>>

------------------------------------------

error in revision `khwasan`: verification with 'FileCheck' failed
status: exit status: 1
command: "/usr/lib/llvm-20/bin/FileCheck" "--input-file" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/codegen-llvm/sanitizer/hwasan-vs-khwasan.khwasan/hwasan-vs-khwasan.ll" "/checkout/tests/codegen-llvm/sanitizer/hwasan-vs-khwasan.rs" "--check-prefix=CHECK" "--check-prefix" "khwasan" "--allow-unused-prefixes" "--dump-input-context" "100"
stdout: none
--- stderr -------------------------------
/checkout/tests/codegen-llvm/sanitizer/hwasan-vs-khwasan.rs:23:13: error: khwasan: expected string not found in input
// khwasan: call ptr asm
            ^
/checkout/obj/build/aarch64-unknown-linux-gnu/test/codegen-llvm/sanitizer/hwasan-vs-khwasan.khwasan/hwasan-vs-khwasan.ll:11:26: note: scanning from here
define dso_local i8 @test(ptr align 1 %b) unnamed_addr #0 {
                         ^
/checkout/obj/build/aarch64-unknown-linux-gnu/test/codegen-llvm/sanitizer/hwasan-vs-khwasan.khwasan/hwasan-vs-khwasan.ll:62:3: note: possible intended match here
declare ptr @memmove(ptr, ptr, i64)
  ^

Input file: /checkout/obj/build/aarch64-unknown-linux-gnu/test/codegen-llvm/sanitizer/hwasan-vs-khwasan.khwasan/hwasan-vs-khwasan.ll
Check file: /checkout/tests/codegen-llvm/sanitizer/hwasan-vs-khwasan.rs

-dump-input=help explains the following input dump.

Input was:
<<<<<<
            1: ; ModuleID = 'hwasan_vs_khwasan.54a3b2f579d13220-cgu.0' 
            2: source_filename = "hwasan_vs_khwasan.54a3b2f579d13220-cgu.0" 
            3: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32" 
            4: target triple = "aarch64-unknown-none" 
            5:  
            6: @__hwasan_tls = external thread_local(initialexec) global i64 
            7: @llvm.compiler.used = appending global [1 x ptr] [ptr @__hwasan_tls], section "llvm.metadata" 
            8: @__hwasan_shadow = external global [0 x i8] 
            9:  
           10: ; Function Attrs: noredzone nounwind sanitize_hwaddress uwtable 
           11: define dso_local i8 @test(ptr align 1 %b) unnamed_addr #0 { 
check:23'0                              X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
           12: start: 
check:23'0     ~~~~~~~
           13:  %0 = load i64, ptr @__hwasan_tls, align 8 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           14:  %1 = or i64 %0, 4294967295 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           15:  %hwasan.shadow = add i64 %1, 1 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           16:  %2 = inttoptr i64 %hwasan.shadow to ptr 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           17:  %3 = ptrtoint ptr %b to i64 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           18:  %4 = lshr i64 %3, 56 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~
           19:  %5 = trunc i64 %4 to i8 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~
           20:  %6 = or i64 %3, -72057594037927936 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           21:  %7 = lshr i64 %6, 4 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~
           22:  %8 = getelementptr i8, ptr %2, i64 %7 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           23:  %9 = load i8, ptr %8, align 1 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           24:  %10 = icmp ne i8 %5, %9 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~
           25:  %11 = icmp ne i8 %5, -1 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~
           26:  %12 = and i1 %10, %11 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~
           27:  br i1 %12, label %13, label %14, !prof !2 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           28:  
check:23'0     ~
           29: 13: ; preds = %start 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~
           30:  call void @llvm.hwasan.check.memaccess.shortgranules(ptr %2, ptr %b, i32 67043328) 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           31:  br label %14 
check:23'0     ~~~~~~~~~~~~~~
           32:  
check:23'0     ~
           33: 14: ; preds = %start, %13 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~
           34:  %_0 = load i8, ptr %b, align 1 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           35:  ret i8 %_0 
check:23'0     ~~~~~~~~~~~~
           36: } 
check:23'0     ~~
           37:  
check:23'0     ~
           38: declare void @__hwasan_loadN(i64, i64) 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           39:  
check:23'0     ~
           40: declare void @__hwasan_load1(i64) 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           41:  
check:23'0     ~
           42: declare void @__hwasan_load2(i64) 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           43:  
check:23'0     ~
           44: declare void @__hwasan_load4(i64) 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           45:  
check:23'0     ~
           46: declare void @__hwasan_load8(i64) 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           47:  
check:23'0     ~
           48: declare void @__hwasan_load16(i64) 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           49:  
check:23'0     ~
           50: declare void @__hwasan_storeN(i64, i64) 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           51:  
check:23'0     ~
           52: declare void @__hwasan_store1(i64) 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           53:  
check:23'0     ~
           54: declare void @__hwasan_store2(i64) 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           55:  
check:23'0     ~
           56: declare void @__hwasan_store4(i64) 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           57:  
check:23'0     ~
           58: declare void @__hwasan_store8(i64) 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           59:  
check:23'0     ~
           60: declare void @__hwasan_store16(i64) 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           61:  
check:23'0     ~
           62: declare ptr @memmove(ptr, ptr, i64) 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
check:23'1       ?                                  possible intended match
           63:  
check:23'0     ~
           64: declare ptr @memcpy(ptr, ptr, i64) 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           65:  
check:23'0     ~
           66: declare ptr @memset(ptr, i32, i64) 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           67:  
check:23'0     ~
           68: declare void @__hwasan_tag_memory(ptr, i8, i64) 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           69:  
check:23'0     ~
           70: declare i8 @__hwasan_generate_tag() 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           71:  
check:23'0     ~
           72: declare void @__hwasan_add_frame_record(i64) 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           73:  
check:23'0     ~
           74: declare void @__hwasan_handle_vfork(i64) 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           75:  
check:23'0     ~
           76: ; Function Attrs: nounwind 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~
           77: declare void @llvm.hwasan.check.memaccess.shortgranules(ptr, ptr, i32 immarg) #1 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           78:  
check:23'0     ~
           79: attributes #0 = { noredzone nounwind sanitize_hwaddress uwtable "probe-stack"="inline-asm" "target-cpu"="generic" "target-features"="+v8a,+strict-align,+neon,+fp-armv8" } 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           80: attributes #1 = { nounwind } 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           81:  
check:23'0     ~
           82: !llvm.ident = !{!0} 
check:23'0     ~~~~~~~~~~~~~~~~~~~~
           83: !llvm.module.flags = !{!1} 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~
           84:  
check:23'0     ~
           85: !0 = !{!"rustc version 1.95.0-nightly (faacbc416 2026-02-24)"} 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           86: !1 = !{i32 4, !"nosanitize_hwaddress", i32 1} 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           87: !2 = !{!"branch_weights", i32 1, i32 1048575} 
check:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>>>>>
------------------------------------------

---- [codegen] tests/codegen-llvm/sanitizer/hwasan-vs-khwasan.rs#khwasan stdout end ----
---- [codegen] tests/codegen-llvm/sanitizer/sanitize-off-khwasan-hwasan.rs stdout ----
------rustc stdout------------------------------

------rustc stderr------------------------------
error: mixing `-Zsanitizer` will cause an ABI mismatch in crate `sanitize_off_khwasan_hwasan`
##[error] --> /checkout/tests/codegen-llvm/sanitizer/sanitize-off-khwasan-hwasan.rs:7:1
  |
7 | #![crate_type = "lib"]
  | ^
  |
  = help: the `-Zsanitizer` flag modifies the ABI so Rust crates compiled with different values of this flag cannot be used together safely
  = note: `-Zsanitizer=hwaddress` in this crate is incompatible with unset `-Zsanitizer` in dependency `std`
  = help: unset `-Zsanitizer` in this crate or set `-Zsanitizer=hwaddress` in `std`
  = help: if you are sure this will not cause problems, you may use `-Cunsafe-allow-abi-mismatch=sanitizer` to silence this error

error: mixing `-Zsanitizer` will cause an ABI mismatch in crate `sanitize_off_khwasan_hwasan`
##[error] --> /checkout/tests/codegen-llvm/sanitizer/sanitize-off-khwasan-hwasan.rs:7:1
  |
7 | #![crate_type = "lib"]
  | ^
  |
  = help: the `-Zsanitizer` flag modifies the ABI so Rust crates compiled with different values of this flag cannot be used together safely
  = note: `-Zsanitizer=hwaddress` in this crate is incompatible with unset `-Zsanitizer` in dependency `core`
  = help: unset `-Zsanitizer` in this crate or set `-Zsanitizer=hwaddress` in `core`
  = help: if you are sure this will not cause problems, you may use `-Cunsafe-allow-abi-mismatch=sanitizer` to silence this error

error: mixing `-Zsanitizer` will cause an ABI mismatch in crate `sanitize_off_khwasan_hwasan`
##[error] --> /checkout/tests/codegen-llvm/sanitizer/sanitize-off-khwasan-hwasan.rs:7:1
  |
7 | #![crate_type = "lib"]
  | ^
  |
  = help: the `-Zsanitizer` flag modifies the ABI so Rust crates compiled with different values of this flag cannot be used together safely
  = note: `-Zsanitizer=hwaddress` in this crate is incompatible with unset `-Zsanitizer` in dependency `alloc`
  = help: unset `-Zsanitizer` in this crate or set `-Zsanitizer=hwaddress` in `alloc`
  = help: if you are sure this will not cause problems, you may use `-Cunsafe-allow-abi-mismatch=sanitizer` to silence this error

error: mixing `-Zsanitizer` will cause an ABI mismatch in crate `sanitize_off_khwasan_hwasan`
##[error] --> /checkout/tests/codegen-llvm/sanitizer/sanitize-off-khwasan-hwasan.rs:7:1
  |
7 | #![crate_type = "lib"]
  | ^
  |
  = help: the `-Zsanitizer` flag modifies the ABI so Rust crates compiled with different values of this flag cannot be used together safely
  = note: `-Zsanitizer=hwaddress` in this crate is incompatible with unset `-Zsanitizer` in dependency `compiler_builtins`
  = help: unset `-Zsanitizer` in this crate or set `-Zsanitizer=hwaddress` in `compiler_builtins`
  = help: if you are sure this will not cause problems, you may use `-Cunsafe-allow-abi-mismatch=sanitizer` to silence this error

error: mixing `-Zsanitizer` will cause an ABI mismatch in crate `sanitize_off_khwasan_hwasan`
##[error] --> /checkout/tests/codegen-llvm/sanitizer/sanitize-off-khwasan-hwasan.rs:7:1
  |
7 | #![crate_type = "lib"]
  | ^
  |
  = help: the `-Zsanitizer` flag modifies the ABI so Rust crates compiled with different values of this flag cannot be used together safely
  = note: `-Zsanitizer=hwaddress` in this crate is incompatible with unset `-Zsanitizer` in dependency `libc`
  = help: unset `-Zsanitizer` in this crate or set `-Zsanitizer=hwaddress` in `libc`
  = help: if you are sure this will not cause problems, you may use `-Cunsafe-allow-abi-mismatch=sanitizer` to silence this error

error: mixing `-Zsanitizer` will cause an ABI mismatch in crate `sanitize_off_khwasan_hwasan`
##[error] --> /checkout/tests/codegen-llvm/sanitizer/sanitize-off-khwasan-hwasan.rs:7:1
  |
7 | #![crate_type = "lib"]
  | ^
  |
  = help: the `-Zsanitizer` flag modifies the ABI so Rust crates compiled with different values of this flag cannot be used together safely
  = note: `-Zsanitizer=hwaddress` in this crate is incompatible with unset `-Zsanitizer` in dependency `rustc_std_workspace_core`
  = help: unset `-Zsanitizer` in this crate or set `-Zsanitizer=hwaddress` in `rustc_std_workspace_core`
  = help: if you are sure this will not cause problems, you may use `-Cunsafe-allow-abi-mismatch=sanitizer` to silence this error

error: mixing `-Zsanitizer` will cause an ABI mismatch in crate `sanitize_off_khwasan_hwasan`
##[error] --> /checkout/tests/codegen-llvm/sanitizer/sanitize-off-khwasan-hwasan.rs:7:1
  |
7 | #![crate_type = "lib"]
  | ^
  |
  = help: the `-Zsanitizer` flag modifies the ABI so Rust crates compiled with different values of this flag cannot be used together safely
  = note: `-Zsanitizer=hwaddress` in this crate is incompatible with unset `-Zsanitizer` in dependency `unwind`
  = help: unset `-Zsanitizer` in this crate or set `-Zsanitizer=hwaddress` in `unwind`
  = help: if you are sure this will not cause problems, you may use `-Cunsafe-allow-abi-mismatch=sanitizer` to silence this error

error: mixing `-Zsanitizer` will cause an ABI mismatch in crate `sanitize_off_khwasan_hwasan`
##[error] --> /checkout/tests/codegen-llvm/sanitizer/sanitize-off-khwasan-hwasan.rs:7:1
  |
7 | #![crate_type = "lib"]
  | ^
  |
  = help: the `-Zsanitizer` flag modifies the ABI so Rust crates compiled with different values of this flag cannot be used together safely
  = note: `-Zsanitizer=hwaddress` in this crate is incompatible with unset `-Zsanitizer` in dependency `miniz_oxide`
  = help: unset `-Zsanitizer` in this crate or set `-Zsanitizer=hwaddress` in `miniz_oxide`
  = help: if you are sure this will not cause problems, you may use `-Cunsafe-allow-abi-mismatch=sanitizer` to silence this error

error: mixing `-Zsanitizer` will cause an ABI mismatch in crate `sanitize_off_khwasan_hwasan`
##[error] --> /checkout/tests/codegen-llvm/sanitizer/sanitize-off-khwasan-hwasan.rs:7:1
  |
7 | #![crate_type = "lib"]
  | ^
  |
  = help: the `-Zsanitizer` flag modifies the ABI so Rust crates compiled with different values of this flag cannot be used together safely
  = note: `-Zsanitizer=hwaddress` in this crate is incompatible with unset `-Zsanitizer` in dependency `adler2`
  = help: unset `-Zsanitizer` in this crate or set `-Zsanitizer=hwaddress` in `adler2`
  = help: if you are sure this will not cause problems, you may use `-Cunsafe-allow-abi-mismatch=sanitizer` to silence this error

error: mixing `-Zsanitizer` will cause an ABI mismatch in crate `sanitize_off_khwasan_hwasan`
##[error] --> /checkout/tests/codegen-llvm/sanitizer/sanitize-off-khwasan-hwasan.rs:7:1
  |
7 | #![crate_type = "lib"]
  | ^
  |
  = help: the `-Zsanitizer` flag modifies the ABI so Rust crates compiled with different values of this flag cannot be used together safely
  = note: `-Zsanitizer=hwaddress` in this crate is incompatible with unset `-Zsanitizer` in dependency `hashbrown`
  = help: unset `-Zsanitizer` in this crate or set `-Zsanitizer=hwaddress` in `hashbrown`
  = help: if you are sure this will not cause problems, you may use `-Cunsafe-allow-abi-mismatch=sanitizer` to silence this error

error: mixing `-Zsanitizer` will cause an ABI mismatch in crate `sanitize_off_khwasan_hwasan`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) A-compiletest Area: The compiletest test runner A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-sanitizers Area: Sanitizers for correctness and code quality A-testsuite Area: The testsuite used to check the correctness of rustc PG-exploit-mitigations Project group: Exploit mitigations S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants