Skip to content

Commit 1ae0448

Browse files
authored
[msan] Enable msan-handle-asm-conservative for userspace by default (#79251)
msan-handle-asm-conservative is enabled by KMSAN by default. Enable the userspace by default as well after #77393.
1 parent 45950f6 commit 1ae0448

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -284,9 +284,6 @@ static cl::opt<bool> ClHandleLifetimeIntrinsics(
284284
// passed into an assembly call. Note that this may cause false positives.
285285
// Because it's impossible to figure out the array sizes, we can only unpoison
286286
// the first sizeof(type) bytes for each type* pointer.
287-
// The instrumentation is only enabled in KMSAN builds, and only if
288-
// -msan-handle-asm-conservative is on. This is done because we may want to
289-
// quickly disable assembly instrumentation when it breaks.
290287
static cl::opt<bool> ClHandleAsmConservative(
291288
"msan-handle-asm-conservative",
292289
cl::desc("conservative handling of inline assembly"), cl::Hidden,
@@ -4103,11 +4100,7 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
41034100
// do the usual thing: check argument shadow and mark all outputs as
41044101
// clean. Note that any side effects of the inline asm that are not
41054102
// immediately visible in its constraints are not handled.
4106-
// For now, handle inline asm by default for KMSAN.
4107-
bool HandleAsm = ClHandleAsmConservative.getNumOccurrences()
4108-
? ClHandleAsmConservative
4109-
: MS.CompileKernel;
4110-
if (HandleAsm)
4103+
if (ClHandleAsmConservative)
41114104
visitAsmInstruction(CB);
41124105
else
41134106
visitInstruction(CB);

llvm/test/Instrumentation/MemorySanitizer/msan_asm_conservative.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
; Test for handling of asm constraints in MSan instrumentation.
22
; RUN: opt < %s -msan-check-access-address=0 -msan-handle-asm-conservative=0 -S -passes=msan 2>&1 | \
33
; RUN: FileCheck %s
4-
; RUN: opt < %s -msan-check-access-address=0 -msan-handle-asm-conservative=1 -S -passes=msan 2>&1 | \
4+
; RUN: opt < %s -msan-check-access-address=0 -S -passes=msan 2>&1 | \
55
; RUN: FileCheck --check-prefixes=CHECK,USER-CONS %s
66
; RUN: opt < %s -msan-kernel=1 -msan-check-access-address=0 \
77
; RUN: -msan-handle-asm-conservative=0 -S -passes=msan 2>&1 | FileCheck \

0 commit comments

Comments
 (0)