Conversation
1191bc5 to
07c2a2a
Compare
This comment has been minimized.
This comment has been minimized.
07c2a2a to
9508e21
Compare
This comment has been minimized.
This comment has been minimized.
9508e21 to
c7a338e
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| // KHWASAN: In LLVM versions prior to 21.1.0, the HWAddressSanitizer pass incorrectly | ||
| // ignores the pass-specific `CompileKernel` flag and only looks at the global command-line | ||
| // flag `-hwasan-kernel`. To work around this, pass `-hwasan-kernel` on the relevant LLVM | ||
| // versions. | ||
| // | ||
| // Fixed by: [HWASan][bugfix] Fix kernel check in ShadowMapping::init (#142226). | ||
| if sess.sanitizers().contains(SanitizerSet::KERNELHWADDRESS) && get_version() < (21, 1, 0) { | ||
| add("-hwasan-kernel", false); | ||
| } |
There was a problem hiding this comment.
@fmayer Is this reasonable a reasonable fix for rustc to work around the lack of llvm/llvm-project#142226? Or do you think I should pass this on all versions? Thanks!
This comment has been minimized.
This comment has been minimized.
|
Some changes occurred in cfg and check-cfg configuration cc @Urgau Some changes occurred in tests/ui/sanitizer cc @rcvalle Some changes occurred in src/tools/compiletest cc @jieyouxu Some changes occurred in tests/codegen-llvm/sanitizer cc @rcvalle Some changes occurred in compiler/rustc_attr_parsing |
|
r? @chenyukang rustbot has assigned @chenyukang. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
FYI LLVM prior to 21 is no longer supported: #153684 |
This comment has been minimized.
This comment has been minimized.
|
@mati865 Technically bug also occurs on 21.0, as it wasn't fixed until 21.1.0 |
This comment has been minimized.
This comment has been minimized.
|
@Darksonn sorry if it wasn't clear. LLVM uses Thus, LLVM 21.1.0 is the oldest supported version now. |
|
@mati865 Oh I did not know that. In that case, I can take out the bugfix. For posterity, it add this to // KHWASAN: In LLVM versions prior to 21.1.0, the HWAddressSanitizer pass incorrectly
// ignores the pass-specific `CompileKernel` flag and only looks at the global command-line
// flag `-hwasan-kernel`. To work around this, pass `-hwasan-kernel` on the relevant LLVM
// versions.
//
// Fixed by: [HWASan][bugfix] Fix kernel check in ShadowMapping::init (#142226).
if sess.sanitizers().contains(SanitizerSet::KERNELHWADDRESS) && get_version() < (21, 1, 0) {
add("-hwasan-kernel", false);
} |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…hanBrouwer Fix minor kasan bugs Fixes a few minor bugs discovered during rust-lang#153049.
…hanBrouwer Fix minor kasan bugs Fixes a few minor bugs discovered during rust-lang#153049.
This comment has been minimized.
This comment has been minimized.
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
Fix minor kasan bugs Fixes a few minor bugs discovered during rust-lang/rust#153049.
Fix minor kasan bugs Fixes a few minor bugs discovered during rust-lang/rust#153049.
|
r? compiler |
View all comments
The Linux kernel has a config option called
CONFIG_KASAN_SW_TAGSthat enables-fsanitize=kernel-hwaddress. This is not supported by Rust.One slightly awkward detail is that
#[sanitize(address = "off")]applies to both-Zsanitize=addressand-Zsanitize=kernel-address. Probably it was done this way because both are the same LLVM pass. I replicated this logic here for hwaddress, but it might be undesirable.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.MCP: rust-lang/compiler-team#975
cc @rcvalle @maurer @ojeda