Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
a197752
Add kernel-hwaddress sanitizer
Darksonn Feb 24, 2026
e41bbfa
Explain why __hwasan_tls is present in LLVM codegen
Darksonn Mar 6, 2026
ec03f4e
Adjust lifetime markers comment
Darksonn Mar 16, 2026
c679e3d
Simplify tests and fix test tidy issue
Darksonn Mar 17, 2026
adacd90
move many `ui/macros` tests from `run-` to `check-pass`
cyrgani Mar 19, 2026
9ce6863
merge `die-macro` tests into `panic-macro-basic.rs`
cyrgani Mar 19, 2026
ad79aa7
merge many repetitive `classes-*` tests
cyrgani Mar 20, 2026
0941e18
reformat merged files
cyrgani Mar 20, 2026
0486281
delete some tests that lost their meaning
cyrgani Mar 20, 2026
98a1441
merge several `tuple-struct-*` tests
cyrgani Mar 20, 2026
ff524fd
move many tests from `run-pass` to `check-pass`
cyrgani Mar 20, 2026
5f68044
miri recursive checking: only check one layer deep
RalfJung Mar 23, 2026
422906d
Do not check for LEAK & KERNELHWADDRESS because they are incompatible
Darksonn Mar 24, 2026
4d86840
Document kernel-hwaddress in Unstable Book
Darksonn Mar 24, 2026
62ba3c1
Move ui/issues tests to relevant subdirectories
kyleecodes Mar 25, 2026
de8f388
Rollup merge of #153049 - Darksonn:kasan-sw-tags, r=fmease
jhpratt Mar 25, 2026
4f9a06b
Rollup merge of #154269 - RalfJung:miri-recursive-shallow, r=saethlin
jhpratt Mar 25, 2026
b4d8062
Rollup merge of #154112 - cyrgani:macros-folder, r=Kivooeo
jhpratt Mar 25, 2026
dc2c20e
Rollup merge of #154131 - cyrgani:structs-enums, r=Kivooeo
jhpratt Mar 25, 2026
63bd8cf
Rollup merge of #154233 - kyleecodes:tests/reorg-ui-issues, r=Kivooeo
jhpratt Mar 25, 2026
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion compiler/rustc_attr_parsing/src/attributes/codegen_attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,7 @@ impl<S: Stage> SingleAttributeParser<S> for SanitizeParser {
r#"kernel_address = "on|off""#,
r#"cfi = "on|off""#,
r#"hwaddress = "on|off""#,
r#"kernel_hwaddress = "on|off""#,
r#"kcfi = "on|off""#,
r#"memory = "on|off""#,
r#"memtag = "on|off""#,
Expand Down Expand Up @@ -648,7 +649,9 @@ impl<S: Stage> SingleAttributeParser<S> for SanitizeParser {
Some(sym::memtag) => apply(SanitizerSet::MEMTAG),
Some(sym::shadow_call_stack) => apply(SanitizerSet::SHADOWCALLSTACK),
Some(sym::thread) => apply(SanitizerSet::THREAD),
Some(sym::hwaddress) => apply(SanitizerSet::HWADDRESS),
Some(sym::hwaddress) | Some(sym::kernel_hwaddress) => {
apply(SanitizerSet::HWADDRESS | SanitizerSet::KERNELHWADDRESS)
}
Some(sym::realtime) => match value.value_as_str() {
Some(sym::nonblocking) => rtsan = Some(RtsanSetting::Nonblocking),
Some(sym::blocking) => rtsan = Some(RtsanSetting::Blocking),
Expand All @@ -673,6 +676,7 @@ impl<S: Stage> SingleAttributeParser<S> for SanitizeParser {
sym::shadow_call_stack,
sym::thread,
sym::hwaddress,
sym::kernel_hwaddress,
sym::realtime,
],
);
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_codegen_llvm/src/attributes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ pub(crate) fn sanitize_attrs<'ll, 'tcx>(
if enabled.contains(SanitizerSet::THREAD) {
attrs.push(llvm::AttributeKind::SanitizeThread.create_attr(cx.llcx));
}
if enabled.contains(SanitizerSet::HWADDRESS) {
if enabled.contains(SanitizerSet::HWADDRESS) || enabled.contains(SanitizerSet::KERNELHWADDRESS)
{
attrs.push(llvm::AttributeKind::SanitizeHWAddress.create_attr(cx.llcx));
}
if enabled.contains(SanitizerSet::SHADOWCALLSTACK) {
Expand Down
4 changes: 4 additions & 0 deletions compiler/rustc_codegen_llvm/src/back/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,10 @@ pub(crate) unsafe fn llvm_optimize(
sanitize_kernel_address_recover: config
.sanitizer_recover
.contains(SanitizerSet::KERNELADDRESS),
sanitize_kernel_hwaddress: config.sanitizer.contains(SanitizerSet::KERNELHWADDRESS),
sanitize_kernel_hwaddress_recover: config
.sanitizer_recover
.contains(SanitizerSet::KERNELHWADDRESS),
})
} else {
None
Expand Down
8 changes: 6 additions & 2 deletions compiler/rustc_codegen_llvm/src/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,14 @@ pub(crate) fn visibility_to_llvm(linkage: Visibility) -> llvm::Visibility {
}

pub(crate) fn set_variable_sanitizer_attrs(llval: &Value, attrs: &CodegenFnAttrs) {
if attrs.sanitizers.disabled.contains(SanitizerSet::ADDRESS) {
if attrs.sanitizers.disabled.contains(SanitizerSet::ADDRESS)
|| attrs.sanitizers.disabled.contains(SanitizerSet::KERNELADDRESS)
{
unsafe { llvm::LLVMRustSetNoSanitizeAddress(llval) };
}
if attrs.sanitizers.disabled.contains(SanitizerSet::HWADDRESS) {
if attrs.sanitizers.disabled.contains(SanitizerSet::HWADDRESS)
|| attrs.sanitizers.disabled.contains(SanitizerSet::KERNELHWADDRESS)
{
unsafe { llvm::LLVMRustSetNoSanitizeHWAddress(llval) };
}
}
2 changes: 2 additions & 0 deletions compiler/rustc_codegen_llvm/src/llvm/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,8 @@ pub(crate) struct SanitizerOptions {
pub sanitize_hwaddress_recover: bool,
pub sanitize_kernel_address: bool,
pub sanitize_kernel_address_recover: bool,
pub sanitize_kernel_hwaddress: bool,
pub sanitize_kernel_hwaddress_recover: bool,
}

/// LLVMRustRelocModel
Expand Down
14 changes: 11 additions & 3 deletions compiler/rustc_const_eval/src/interpret/validity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1532,13 +1532,15 @@ impl<'rt, 'tcx, M: Machine<'tcx>> ValueVisitor<'tcx, M> for ValidityVisitor<'rt,
}

impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
/// The internal core entry point for all validation operations.
fn validate_operand_internal(
&mut self,
val: &PlaceTy<'tcx, M::Provenance>,
path: Path<'tcx>,
ref_tracking: Option<&mut RefTracking<MPlaceTy<'tcx, M::Provenance>, Path<'tcx>>>,
ctfe_mode: Option<CtfeValidationMode>,
reset_provenance_and_padding: bool,
start_in_may_dangle: bool,
) -> InterpResult<'tcx> {
trace!("validate_operand_internal: {:?}, {:?}", *val, val.layout.ty);

Expand All @@ -1556,7 +1558,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
ecx,
reset_provenance_and_padding,
data_bytes: reset_padding.then_some(RangeSet(Vec::new())),
may_dangle: false,
may_dangle: start_in_may_dangle,
};
v.visit_value(val)?;
v.reset_padding(val)?;
Expand Down Expand Up @@ -1599,6 +1601,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
Some(ref_tracking),
Some(ctfe_mode),
/*reset_provenance*/ false,
/*start_in_may_dangle*/ false,
)
}

Expand Down Expand Up @@ -1629,6 +1632,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
None,
None,
reset_provenance_and_padding,
/*start_in_may_dangle*/ false,
);
}
// Do a recursive check.
Expand All @@ -1639,15 +1643,19 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
Some(&mut ref_tracking),
None,
reset_provenance_and_padding,
/*start_in_may_dangle*/ false,
)?;
while let Some((mplace, path)) = ref_tracking.todo.pop() {
// Things behind reference do *not* have the provenance reset.
// Things behind reference do *not* have the provenance reset. In fact
// we treat the entire thing as being inside MaybeDangling, i.e., references
// do not have to be dereferenceable.
self.validate_operand_internal(
&mplace.into(),
path,
Some(&mut ref_tracking),
None, // no further recursion
None,
/*reset_provenance_and_padding*/ false,
/*start_in_may_dangle*/ true,
)?;
}
interp_ok(())
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_feature/src/builtin_attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@ pub static BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
DuplicatesOk, EncodeCrossCrate::No, effective_target_features, experimental!(force_target_feature)
),
gated!(
sanitize, Normal, template!(List: &[r#"address = "on|off""#, r#"kernel_address = "on|off""#, r#"cfi = "on|off""#, r#"hwaddress = "on|off""#, r#"kcfi = "on|off""#, r#"memory = "on|off""#, r#"memtag = "on|off""#, r#"shadow_call_stack = "on|off""#, r#"thread = "on|off""#]), ErrorPreceding,
sanitize, Normal, template!(List: &[r#"address = "on|off""#, r#"kernel_address = "on|off""#, r#"cfi = "on|off""#, r#"hwaddress = "on|off""#, r#"kernel_hwaddress = "on|off""#, r#"kcfi = "on|off""#, r#"memory = "on|off""#, r#"memtag = "on|off""#, r#"shadow_call_stack = "on|off""#, r#"thread = "on|off""#]), ErrorPreceding,
EncodeCrossCrate::No, sanitize, experimental!(sanitize),
),
gated!(
Expand Down
10 changes: 7 additions & 3 deletions compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,8 @@ struct LLVMRustSanitizerOptions {
bool SanitizeHWAddressRecover;
bool SanitizeKernelAddress;
bool SanitizeKernelAddressRecover;
bool SanitizeKernelHWAddress;
bool SanitizeKernelHWAddressRecover;
};

extern "C" typedef void (*registerEnzymeAndPassPipelineFn)(
Expand Down Expand Up @@ -767,13 +769,15 @@ extern "C" LLVMRustResult LLVMRustOptimize(
!TM->getTargetTriple().isOSWindows()));
});
}
if (SanitizerOptions->SanitizeHWAddress) {
if (SanitizerOptions->SanitizeHWAddress ||
SanitizerOptions->SanitizeKernelHWAddress) {
OptimizerLastEPCallbacks.push_back(
[SanitizerOptions](ModulePassManager &MPM, OptimizationLevel Level,
ThinOrFullLTOPhase phase) {
HWAddressSanitizerOptions opts(
/*CompileKernel=*/false,
SanitizerOptions->SanitizeHWAddressRecover,
SanitizerOptions->SanitizeKernelHWAddress,
SanitizerOptions->SanitizeHWAddressRecover ||
SanitizerOptions->SanitizeKernelHWAddressRecover,
/*DisableOptimization=*/false);
MPM.addPass(HWAddressSanitizerPass(opts));
});
Expand Down
4 changes: 4 additions & 0 deletions compiler/rustc_session/src/config/cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,10 @@ pub(crate) fn default_configuration(sess: &Session) -> Cfg {
if s == SanitizerSet::KERNELADDRESS {
s = SanitizerSet::ADDRESS;
}
// KHWASAN is still HWASAN under the hood, so it uses the same attribute.
if s == SanitizerSet::KERNELHWADDRESS {
s = SanitizerSet::HWADDRESS;
}
ins_str!(sym::sanitize, &s.to_string());
}

Expand Down
4 changes: 3 additions & 1 deletion compiler/rustc_session/src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ mod target_modifier_consistency_check {
| SanitizerSet::SHADOWCALLSTACK
| SanitizerSet::KCFI
| SanitizerSet::KERNELADDRESS
| SanitizerSet::KERNELHWADDRESS
| SanitizerSet::SAFESTACK
| SanitizerSet::DATAFLOW;

Expand Down Expand Up @@ -817,7 +818,7 @@ mod desc {
pub(crate) const parse_patchable_function_entry: &str = "either two comma separated integers (total_nops,prefix_nops), with prefix_nops <= total_nops, or one integer (total_nops)";
pub(crate) const parse_opt_panic_strategy: &str = parse_panic_strategy;
pub(crate) const parse_relro_level: &str = "one of: `full`, `partial`, or `off`";
pub(crate) const parse_sanitizers: &str = "comma separated list of sanitizers: `address`, `cfi`, `dataflow`, `hwaddress`, `kcfi`, `kernel-address`, `leak`, `memory`, `memtag`, `safestack`, `shadow-call-stack`, `thread`, or 'realtime'";
pub(crate) const parse_sanitizers: &str = "comma separated list of sanitizers: `address`, `cfi`, `dataflow`, `hwaddress`, `kcfi`, `kernel-address`, `kernel-hwaddress`, `leak`, `memory`, `memtag`, `safestack`, `shadow-call-stack`, `thread`, or 'realtime'";
pub(crate) const parse_sanitizer_memory_track_origins: &str = "0, 1, or 2";
pub(crate) const parse_cfguard: &str =
"either a boolean (`yes`, `no`, `on`, `off`, etc), `checks`, or `nochecks`";
Expand Down Expand Up @@ -1265,6 +1266,7 @@ pub mod parse {
"dataflow" => SanitizerSet::DATAFLOW,
"kcfi" => SanitizerSet::KCFI,
"kernel-address" => SanitizerSet::KERNELADDRESS,
"kernel-hwaddress" => SanitizerSet::KERNELHWADDRESS,
"leak" => SanitizerSet::LEAK,
"memory" => SanitizerSet::MEMORY,
"memtag" => SanitizerSet::MEMTAG,
Expand Down
7 changes: 5 additions & 2 deletions compiler/rustc_session/src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -533,9 +533,12 @@ impl Session {
pub fn emit_lifetime_markers(&self) -> bool {
self.opts.optimize != config::OptLevel::No
// AddressSanitizer and KernelAddressSanitizer uses lifetimes to detect use after scope bugs.
//
// MemorySanitizer uses lifetimes to detect use of uninitialized stack variables.
// HWAddressSanitizer will use lifetimes to detect use after scope bugs in the future.
|| self.sanitizers().intersects(SanitizerSet::ADDRESS | SanitizerSet::KERNELADDRESS | SanitizerSet::MEMORY | SanitizerSet::HWADDRESS)
//
// HWAddressSanitizer and KernelHWAddressSanitizer will use lifetimes to detect use after
// scope bugs in the future.
|| self.sanitizers().intersects(SanitizerSet::ADDRESS | SanitizerSet::KERNELADDRESS | SanitizerSet::MEMORY | SanitizerSet::HWADDRESS | SanitizerSet::KERNELHWADDRESS)
}

pub fn diagnostic_width(&self) -> usize {
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_span/src/symbol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1116,6 +1116,7 @@ symbols! {
iterator_collect_fn,
kcfi,
kernel_address,
kernel_hwaddress,
keylocker_x86,
keyword,
kind,
Expand Down
17 changes: 14 additions & 3 deletions compiler/rustc_target/src/spec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1175,9 +1175,10 @@ bitflags::bitflags! {
const SHADOWCALLSTACK = 1 << 7;
const KCFI = 1 << 8;
const KERNELADDRESS = 1 << 9;
const SAFESTACK = 1 << 10;
const DATAFLOW = 1 << 11;
const REALTIME = 1 << 12;
const KERNELHWADDRESS = 1 << 10;
const SAFESTACK = 1 << 11;
const DATAFLOW = 1 << 12;
const REALTIME = 1 << 13;
}
}
rustc_data_structures::external_bitflags_debug! { SanitizerSet }
Expand All @@ -1191,24 +1192,32 @@ impl SanitizerSet {
(SanitizerSet::ADDRESS, SanitizerSet::HWADDRESS),
(SanitizerSet::ADDRESS, SanitizerSet::MEMTAG),
(SanitizerSet::ADDRESS, SanitizerSet::KERNELADDRESS),
(SanitizerSet::ADDRESS, SanitizerSet::KERNELHWADDRESS),
(SanitizerSet::ADDRESS, SanitizerSet::SAFESTACK),
(SanitizerSet::LEAK, SanitizerSet::MEMORY),
(SanitizerSet::LEAK, SanitizerSet::THREAD),
(SanitizerSet::LEAK, SanitizerSet::KERNELADDRESS),
(SanitizerSet::LEAK, SanitizerSet::KERNELHWADDRESS),
(SanitizerSet::LEAK, SanitizerSet::SAFESTACK),
(SanitizerSet::MEMORY, SanitizerSet::THREAD),
(SanitizerSet::MEMORY, SanitizerSet::HWADDRESS),
(SanitizerSet::MEMORY, SanitizerSet::KERNELADDRESS),
(SanitizerSet::MEMORY, SanitizerSet::KERNELHWADDRESS),
(SanitizerSet::MEMORY, SanitizerSet::SAFESTACK),
(SanitizerSet::THREAD, SanitizerSet::HWADDRESS),
(SanitizerSet::THREAD, SanitizerSet::KERNELADDRESS),
(SanitizerSet::THREAD, SanitizerSet::KERNELHWADDRESS),
(SanitizerSet::THREAD, SanitizerSet::SAFESTACK),
(SanitizerSet::HWADDRESS, SanitizerSet::MEMTAG),
(SanitizerSet::HWADDRESS, SanitizerSet::KERNELADDRESS),
(SanitizerSet::HWADDRESS, SanitizerSet::KERNELHWADDRESS),
(SanitizerSet::HWADDRESS, SanitizerSet::SAFESTACK),
(SanitizerSet::CFI, SanitizerSet::KCFI),
(SanitizerSet::MEMTAG, SanitizerSet::KERNELADDRESS),
(SanitizerSet::MEMTAG, SanitizerSet::KERNELHWADDRESS),
(SanitizerSet::KERNELADDRESS, SanitizerSet::KERNELHWADDRESS),
(SanitizerSet::KERNELADDRESS, SanitizerSet::SAFESTACK),
(SanitizerSet::KERNELHWADDRESS, SanitizerSet::SAFESTACK),
];

/// Return sanitizer's name
Expand All @@ -1221,6 +1230,7 @@ impl SanitizerSet {
SanitizerSet::DATAFLOW => "dataflow",
SanitizerSet::KCFI => "kcfi",
SanitizerSet::KERNELADDRESS => "kernel-address",
SanitizerSet::KERNELHWADDRESS => "kernel-hwaddress",
SanitizerSet::LEAK => "leak",
SanitizerSet::MEMORY => "memory",
SanitizerSet::MEMTAG => "memtag",
Expand Down Expand Up @@ -1266,6 +1276,7 @@ impl FromStr for SanitizerSet {
"dataflow" => SanitizerSet::DATAFLOW,
"kcfi" => SanitizerSet::KCFI,
"kernel-address" => SanitizerSet::KERNELADDRESS,
"kernel-hwaddress" => SanitizerSet::KERNELHWADDRESS,
"leak" => SanitizerSet::LEAK,
"memory" => SanitizerSet::MEMORY,
"memtag" => SanitizerSet::MEMTAG,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ pub(crate) fn target() -> Target {
relocation_model: RelocModel::Static,
disable_redzone: true,
max_atomic_width: Some(128),
supported_sanitizers: SanitizerSet::KCFI | SanitizerSet::KERNELADDRESS,
supported_sanitizers: SanitizerSet::KCFI
| SanitizerSet::KERNELADDRESS
| SanitizerSet::KERNELHWADDRESS,
stack_probes: StackProbeType::Inline,
panic_strategy: PanicStrategy::Abort,
endian: Endian::Big,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ pub(crate) fn target() -> Target {
&["--fix-cortex-a53-843419"],
),
features: "+v8a,+strict-align,+neon".into(),
supported_sanitizers: SanitizerSet::KCFI | SanitizerSet::KERNELADDRESS,
supported_sanitizers: SanitizerSet::KCFI
| SanitizerSet::KERNELADDRESS
| SanitizerSet::KERNELHWADDRESS,
relocation_model: RelocModel::Static,
disable_redzone: true,
max_atomic_width: Some(128),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ pub(crate) fn target() -> Target {
relocation_model: RelocModel::Static,
disable_redzone: true,
max_atomic_width: Some(128),
supported_sanitizers: SanitizerSet::KCFI | SanitizerSet::KERNELADDRESS,
supported_sanitizers: SanitizerSet::KCFI
| SanitizerSet::KERNELADDRESS
| SanitizerSet::KERNELHWADDRESS,
stack_probes: StackProbeType::Inline,
panic_strategy: PanicStrategy::Abort,
default_uwtable: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ pub(crate) fn target() -> Target {
&["--fix-cortex-a53-843419"],
),
features: "+v8a,+strict-align,+neon".into(),
supported_sanitizers: SanitizerSet::KCFI | SanitizerSet::KERNELADDRESS,
supported_sanitizers: SanitizerSet::KCFI
| SanitizerSet::KERNELADDRESS
| SanitizerSet::KERNELHWADDRESS,
relocation_model: RelocModel::Static,
disable_redzone: true,
max_atomic_width: Some(128),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ pub(crate) fn target() -> Target {
// based off the aarch64-unknown-none target at time of addition
linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
linker: Some("rust-lld".into()),
supported_sanitizers: SanitizerSet::KCFI | SanitizerSet::KERNELADDRESS,
supported_sanitizers: SanitizerSet::KCFI
| SanitizerSet::KERNELADDRESS
| SanitizerSet::KERNELHWADDRESS,
relocation_model: RelocModel::Static,
disable_redzone: true,
max_atomic_width: Some(128),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ pub(crate) fn target() -> Target {
relocation_model: RelocModel::Static,
disable_redzone: true,
max_atomic_width: Some(128),
supported_sanitizers: SanitizerSet::KCFI | SanitizerSet::KERNELADDRESS,
supported_sanitizers: SanitizerSet::KCFI
| SanitizerSet::KERNELADDRESS
| SanitizerSet::KERNELHWADDRESS,
stack_probes: StackProbeType::Inline,
panic_strategy: PanicStrategy::Abort,
default_uwtable: true,
Expand Down
12 changes: 12 additions & 0 deletions src/doc/unstable-book/src/compiler-flags/sanitizer.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ This feature allows for use of one of following sanitizers:
* [AddressSanitizer](#addresssanitizer) a fast memory error detector.
* [HWAddressSanitizer](#hwaddresssanitizer) a memory error detector similar to
AddressSanitizer, but based on partial hardware assistance.
* [KernelHWAddressSanitizer](#kernelhwaddresssanitizer) variant of
HWAddressSanitizer that is designed for bare metal environments.
* [LeakSanitizer](#leaksanitizer) a run-time memory leak detector.
* [MemorySanitizer](#memorysanitizer) a detector of uninitialized reads.
* [RealtimeSanitizer](#realtimesanitizer) a detector of calls to function with
Expand Down Expand Up @@ -622,6 +624,16 @@ Registers where the failure occurred (pc 0xaaaae0ae4a98):
SUMMARY: HWAddressSanitizer: tag-mismatch (/.../main+0x54a94)
```
# KernelHWAddressSanitizer
KernelHWAddressSanitizer is the kernel version of [HWAddressSanitizer](#hwaddresssanitizer),
which achieves the same purpose but is designed for bare-metal environments.
HWAddressSanitizer is supported on the `aarch64*-unknown-none` and
`aarch64*-unknown-none-softfloat` targets.
See the [Clang HWAddressSanitizer documentation][clang-hwasan] for more details.
# KernelControlFlowIntegrity
The LLVM Kernel Control Flow Integrity (CFI) support to the Rust compiler
Expand Down
1 change: 1 addition & 0 deletions src/tools/compiletest/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ pub enum Sanitizer {
Dataflow,
Kcfi,
KernelAddress,
KernelHwaddress,
Leak,
Memory,
Memtag,
Expand Down
Loading
Loading