Skip to content

Add -Zsanitize=kernel-hwaddress#153049

Draft
Darksonn wants to merge 2 commits intorust-lang:mainfrom
Darksonn:kasan-sw-tags
Draft

Add -Zsanitize=kernel-hwaddress#153049
Darksonn wants to merge 2 commits 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.

@rust-log-analyzer

This comment has been minimized.

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

This comment has been minimized.

@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)
/dev/sda15       98M  6.4M   92M   7% /boot/efi
tmpfs           1.6G   16K  1.6G   1% /run/user/1001
================================================================================

Sufficient disk space available (120900376KB >= 52428800KB). Skipping cleanup.
##[group]Run echo "[CI_PR_NUMBER=$num]"
echo "[CI_PR_NUMBER=$num]"
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
---
set -ex

# Run a subset of tests. Used to run tests in parallel in multiple jobs.

# When this job partition is run as part of PR CI, skip tidy to allow revealing more failures. The
# dedicated `tidy` job failing won't block other PR CI jobs from completing, and so tidy failures
# shouldn't inhibit revealing other failures in PR CI jobs.
if [ "$PR_CI_JOB" == "1" ]; then
  echo "PR_CI_JOB set; skipping tidy"
  SKIP_TIDY="--skip tidy"
fi

../x.py --stage 2 test \
  ${SKIP_TIDY:+$SKIP_TIDY} \
  --skip compiler \
  --skip src
#!/bin/bash

set -ex

# Run a subset of tests. Used to run tests in parallel in multiple jobs.

# When this job partition is run as part of PR CI, skip tidy to allow revealing more failures. The
# dedicated `tidy` job failing won't block other PR CI jobs from completing, and so tidy failures
# shouldn't inhibit revealing other failures in PR CI jobs.
if [ "$PR_CI_JOB" == "1" ]; then
  echo "PR_CI_JOB set; skipping tidy"
  SKIP_TIDY="--skip tidy"
fi

../x.py --stage 2 test \
  ${SKIP_TIDY:+$SKIP_TIDY} \
  --skip tests \
  --skip coverage-map \
  --skip coverage-run \
  --skip library \
  --skip tidyselftest
---
##[endgroup]
Executing "/scripts/stage_2_test_set1.sh"
+ /scripts/stage_2_test_set1.sh
+ '[' 1 == 1 ']'
+ echo 'PR_CI_JOB set; skipping tidy'
+ SKIP_TIDY='--skip tidy'
+ ../x.py --stage 2 test --skip tidy --skip compiler --skip src
PR_CI_JOB set; skipping tidy
##[group]Building bootstrap
    Finished `dev` profile [unoptimized] target(s) in 0.04s
##[endgroup]
---
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/arm-unadjusted-intrinsic.rs#aarch64 ... ok
test [ui] tests/ui/abi/avr-sram.rs#has_sram ... 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/type-check-2.rs ... ok
test [ui] tests/ui/asm/aarch64/type-check-3.rs ... ok
test [ui] tests/ui/asm/aarch64/type-f16.rs ... ok
test [ui] tests/ui/asm/aarch64v8r.rs#r82 ... ok
test [ui] tests/ui/asm/aarch64v8r.rs#hf ... ok
test [ui] tests/ui/asm/aarch64/sym.rs ... ok
test [ui] tests/ui/asm/aarch64v8r.rs#sf ... 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/binary_asm_labels_allowed.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-3.rs ... ok
test [ui] tests/ui/const-generics/occurs-check/unused-substs-4.rs ... ok
test [ui] tests/ui/const-generics/ogca/basic.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/coherence-ambiguous.rs ... ok
test [ui] tests/ui/const-generics/ogca/generic-param-rhs.rs ... ok
test [ui] tests/ui/const-generics/ogca/rhs-but-not-root.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/overlapping_impls.rs ... ok
test [ui] tests/ui/const-generics/opaque_types2.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#fat2 ... ok
test [ui] tests/ui/extern/issue-64655-extern-rust-must-allow-unwind.rs#fat3 ... ok
test [ui] tests/ui/extern/issue-80074.rs ... ok
test [ui] tests/ui/extern/issue-95829.rs ... ok
test [ui] tests/ui/extern/lgamma-linkage.rs ... ok
test [ui] tests/ui/extern/no-mangle-associated-fn.rs ... ok
test [ui] tests/ui/extern/not-in-block.rs ... ok
test [ui] tests/ui/extern/unsized-extern-derefmove.rs ... ok
test [ui] tests/ui/extern/windows-tcb-trash-13259.rs ... ok
test [ui] tests/ui/feature-gates/allow-features-empty.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-min_const_fn.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-non-prelude-std-glob.rs ... ok
test [ui] tests/ui/imports/ambiguous-panic-pick-core.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/rust-call-abi-not-a-tuple-ice-81974.rs ... ok
test [ui] tests/ui/layout/thaw-validate-invalid-enum.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/external_weak_symbols.rs ... ok
test [codegen] tests/codegen-llvm/sanitizer/cfi/normalize-integers.rs ... ok
test [codegen] tests/codegen-llvm/sanitizer/cfi/emit-type-metadata-trait-objects.rs ... ok
test [codegen] tests/codegen-llvm/sanitizer/hwasan-vs-khwasan.rs#hwasan ... ok
test [codegen] tests/codegen-llvm/sanitizer/kasan-emits-instrumentation.rs#aarch64 ... ok
test [codegen] tests/codegen-llvm/sanitizer/hwasan-vs-khwasan.rs#khwasan ... FAILED
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/kasan-recover.rs#KASAN ... ok
test [codegen] tests/codegen-llvm/sanitizer/kcfi/add-cfi-normalize-integers-flag.rs#aarch64 ... 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#aarch64 ... ok
test [codegen] tests/codegen-llvm/sanitizer/kcfi/naked-function.rs#aarch64v8r ... ok
test [codegen] tests/codegen-llvm/sanitizer/kcfi/naked-function.rs#x86_64 ... ok
test [codegen] tests/codegen-llvm/sanitizer/khwasan-lifetime-markers.rs#aarch64 ... ok
test [codegen] tests/codegen-llvm/sanitizer/khwasan-recover.rs#KHWASAN ... 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/khwasan-recover.rs#KHWASAN-RECOVER ... ok
test [codegen] tests/codegen-llvm/sanitizer/memory-track-origins.rs#MSAN-2 ... 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-LTO ... ok
test [codegen] tests/codegen-llvm/sanitizer/memtag-attr-check.rs ... ok
test [codegen] tests/codegen-llvm/sanitizer/sanitize-off-asan-kasan.rs#aarch64 ... 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#riscv64gc ... ok
test [codegen] tests/codegen-llvm/sanitizer/sanitize-off-asan-kasan.rs#riscv64imac ... ok
test [codegen] tests/codegen-llvm/sanitizer/sanitize-off-asan-kasan.rs#x86_64 ... 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-inlining.rs#LSAN ... ok
test [codegen] tests/codegen-llvm/sanitizer/sanitize-off-inlining.rs#ASAN ... ok
test [codegen] tests/codegen-llvm/sanitizer/sanitize-off-kasan-asan.rs ... ok
test [codegen] tests/codegen-llvm/sanitizer/sanitize-off-khwasan-hwasan.rs ... ok
test [codegen] tests/codegen-llvm/sanitizer/sanitizer-recover.rs#ASAN ... ok
test [codegen] tests/codegen-llvm/sanitizer/sanitize-off.rs ... ok
test [codegen] tests/codegen-llvm/sanitizer/sanitizer-recover.rs#ASAN-RECOVER ... ok
test [codegen] tests/codegen-llvm/sanitizer/scs-attr-check.rs ... ignored, ignored on targets without shadow call stacks
test [codegen] tests/codegen-llvm/sanitizer/sanitizer-recover.rs#MSAN ... ok
---
test [codegen] tests/codegen-llvm/zip.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:29:17: error: khwasan-NOT: excluded string found in input
// khwasan-NOT: @__hwasan_tls
                ^
/checkout/obj/build/aarch64-unknown-linux-gnu/test/codegen-llvm/sanitizer/hwasan-vs-khwasan.khwasan/hwasan-vs-khwasan.ll:13:21: note: found here
 %0 = load i64, ptr @__hwasan_tls, align 8
                    ^~~~~~~~~~~~~

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 %b) unnamed_addr #0 { 
       12: start: 
       13:  %0 = load i64, ptr @__hwasan_tls, align 8 
not:29                         !~~~~~~~~~~~~           error: no match expected
       14:  %1 = or i64 %0, 4294967295 
       15:  %hwasan.shadow = add i64 %1, 1 
       16:  %2 = inttoptr i64 %hwasan.shadow to ptr 
       17:  %3 = ptrtoint ptr %b to i64 
       18:  %4 = lshr i64 %3, 56 
       19:  %5 = trunc i64 %4 to i8 
       20:  %6 = or i64 %3, -72057594037927936 
       21:  %7 = lshr i64 %6, 4 
       22:  %8 = getelementptr i8, ptr %2, i64 %7 
       23:  %9 = load i8, ptr %8, align 1 
       24:  %10 = icmp ne i8 %5, %9 
       25:  %11 = icmp ne i8 %5, -1 
       26:  %12 = and i1 %10, %11 
       27:  br i1 %12, label %13, label %14, !prof !2 
       28:  
       29: 13: ; preds = %start 
       30:  call void @llvm.hwasan.check.memaccess.shortgranules(ptr %2, ptr %b, i32 67043328) 
       31:  br label %14 
       32:  
       33: 14: ; preds = %start, %13 
       34:  %_0 = load i8, ptr %b, align 1 
       35:  ret i8 %_0 
       36: } 
       37:  
       38: declare void @__hwasan_loadN(i64, i64) 
       39:  
       40: declare void @__hwasan_load1(i64) 
       41:  
       42: declare void @__hwasan_load2(i64) 
       43:  
       44: declare void @__hwasan_load4(i64) 
       45:  
       46: declare void @__hwasan_load8(i64) 
       47:  
       48: declare void @__hwasan_load16(i64) 
       49:  
       50: declare void @__hwasan_storeN(i64, i64) 
       51:  
       52: declare void @__hwasan_store1(i64) 
       53:  
       54: declare void @__hwasan_store2(i64) 
       55:  
       56: declare void @__hwasan_store4(i64) 
       57:  
       58: declare void @__hwasan_store8(i64) 
       59:  
       60: declare void @__hwasan_store16(i64) 
       61:  
       62: declare ptr @memmove(ptr, ptr, i64) 
       63:  
       64: declare ptr @memcpy(ptr, ptr, i64) 
       65:  
       66: declare ptr @memset(ptr, i32, i64) 
       67:  
       68: declare void @__hwasan_tag_memory(ptr, i8, i64) 
       69:  
       70: declare i8 @__hwasan_generate_tag() 
       71:  
       72: declare void @__hwasan_add_frame_record(i64) 
       73:  
       74: declare void @__hwasan_handle_vfork(i64) 
       75:  
       76: ; Function Attrs: nounwind 
       77: declare void @llvm.hwasan.check.memaccess.shortgranules(ptr, ptr, i32 immarg) #1 
       78:  
       79: attributes #0 = { noredzone nounwind sanitize_hwaddress uwtable "probe-stack"="inline-asm" "target-cpu"="generic" "target-features"="+v8a,+strict-align,+neon,+fp-armv8" } 
       80: attributes #1 = { nounwind } 
       81:  
       82: !llvm.ident = !{!0} 
       83: !llvm.module.flags = !{!1} 
       84:  
       85: !0 = !{!"rustc version 1.96.0-nightly (dd810923e 2026-03-06)"} 
       86: !1 = !{i32 4, !"nosanitize_hwaddress", i32 1} 
       87: !2 = !{!"branch_weights", i32 1, i32 1048575} 
>>>>>>

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

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:29:17: error: khwasan-NOT: excluded string found in input
// khwasan-NOT: @__hwasan_tls
                ^
/checkout/obj/build/aarch64-unknown-linux-gnu/test/codegen-llvm/sanitizer/hwasan-vs-khwasan.khwasan/hwasan-vs-khwasan.ll:13:21: note: found here
 %0 = load i64, ptr @__hwasan_tls, align 8
                    ^~~~~~~~~~~~~

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 %b) unnamed_addr #0 { 
       12: start: 
       13:  %0 = load i64, ptr @__hwasan_tls, align 8 
not:29                         !~~~~~~~~~~~~           error: no match expected
       14:  %1 = or i64 %0, 4294967295 
       15:  %hwasan.shadow = add i64 %1, 1 
       16:  %2 = inttoptr i64 %hwasan.shadow to ptr 
       17:  %3 = ptrtoint ptr %b to i64 
       18:  %4 = lshr i64 %3, 56 
       19:  %5 = trunc i64 %4 to i8 
       20:  %6 = or i64 %3, -72057594037927936 
       21:  %7 = lshr i64 %6, 4 
       22:  %8 = getelementptr i8, ptr %2, i64 %7 
       23:  %9 = load i8, ptr %8, align 1 
       24:  %10 = icmp ne i8 %5, %9 
       25:  %11 = icmp ne i8 %5, -1 
       26:  %12 = and i1 %10, %11 
       27:  br i1 %12, label %13, label %14, !prof !2 
       28:  
       29: 13: ; preds = %start 
       30:  call void @llvm.hwasan.check.memaccess.shortgranules(ptr %2, ptr %b, i32 67043328) 
       31:  br label %14 
       32:  
       33: 14: ; preds = %start, %13 
       34:  %_0 = load i8, ptr %b, align 1 
       35:  ret i8 %_0 
       36: } 
       37:  
       38: declare void @__hwasan_loadN(i64, i64) 
       39:  
       40: declare void @__hwasan_load1(i64) 
       41:  
       42: declare void @__hwasan_load2(i64) 
       43:  
       44: declare void @__hwasan_load4(i64) 
       45:  
       46: declare void @__hwasan_load8(i64) 
       47:  
       48: declare void @__hwasan_load16(i64) 
       49:  
       50: declare void @__hwasan_storeN(i64, i64) 
       51:  
       52: declare void @__hwasan_store1(i64) 
       53:  
       54: declare void @__hwasan_store2(i64) 
       55:  
       56: declare void @__hwasan_store4(i64) 
       57:  
       58: declare void @__hwasan_store8(i64) 
       59:  
       60: declare void @__hwasan_store16(i64) 
       61:  
       62: declare ptr @memmove(ptr, ptr, i64) 
       63:  
       64: declare ptr @memcpy(ptr, ptr, i64) 
       65:  
       66: declare ptr @memset(ptr, i32, i64) 
       67:  
       68: declare void @__hwasan_tag_memory(ptr, i8, i64) 
       69:  
       70: declare i8 @__hwasan_generate_tag() 
       71:  
       72: declare void @__hwasan_add_frame_record(i64) 
       73:  
       74: declare void @__hwasan_handle_vfork(i64) 
       75:  
       76: ; Function Attrs: nounwind 
       77: declare void @llvm.hwasan.check.memaccess.shortgranules(ptr, ptr, i32 immarg) #1 
       78:  
       79: attributes #0 = { noredzone nounwind sanitize_hwaddress uwtable "probe-stack"="inline-asm" "target-cpu"="generic" "target-features"="+v8a,+strict-align,+neon,+fp-armv8" } 
       80: attributes #1 = { nounwind } 
       81:  
       82: !llvm.ident = !{!0} 
       83: !llvm.module.flags = !{!1} 
       84:  
       85: !0 = !{!"rustc version 1.96.0-nightly (dd810923e 2026-03-06)"} 
       86: !1 = !{i32 4, !"nosanitize_hwaddress", i32 1} 
       87: !2 = !{!"branch_weights", i32 1, i32 1048575} 
>>>>>>
------------------------------------------

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

failures:
    [codegen] tests/codegen-llvm/sanitizer/hwasan-vs-khwasan.rs#khwasan

test result: FAILED. 838 passed; 1 failed; 192 ignored; 0 measured; 3 filtered out; finished in 15.78s

Some tests failed in compiletest suite=codegen-llvm mode=codegen host=aarch64-unknown-linux-gnu target=aarch64-unknown-linux-gnu
Bootstrap failed while executing `--stage 2 test --skip tidy --skip compiler --skip src`

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