diff options
author | Fangrui Song <i@maskray.me> | 2024-01-19 16:18:28 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-19 16:18:28 -0800 |
commit | c71a5bf940d2246c53d4cbb32cff21e52cc5635d (patch) | |
tree | 9a7e37b93d6a831601cf32621c8bcfb5e7d56c45 /llvm/lib/CodeGen/TargetPassConfig.cpp | |
parent | 123ab34abc68e2e64720f9690aed5cb9e62a035d (diff) | |
download | llvm-c71a5bf940d2246c53d4cbb32cff21e52cc5635d.zip llvm-c71a5bf940d2246c53d4cbb32cff21e52cc5635d.tar.gz llvm-c71a5bf940d2246c53d4cbb32cff21e52cc5635d.tar.bz2 |
[msan] Unpoison indirect outputs for userspace when -msan-handle-asm-conservative is specified (#77393)
KMSAN defaults to `msan-handle-asm-conservative`, which inserts
`__msan_instrument_asm_store` calls to unpoison indirect outputs in
inline assembly (e.g. `=m` constraints in source).
```c
unsigned f() {
unsigned v;
// __msan_instrument_asm_store unpoisons v before invoking the asm.
asm("movl $1,%0" : "=m"(v));
return v;
}
```
Extend the mechanism to userspace, but require explicit
`-mllvm -msan-handle-asm-conservative` for experiments for now.
As
https://docs.kernel.org/dev-tools/kmsan.html#inline-assembly-instrumentation
says, this approach may mask certain errors (an indirect output may not
actually be initialized), but it also helps to avoid a lot of false
positives.
Link: https://github.com/google/sanitizers/issues/192
Diffstat (limited to 'llvm/lib/CodeGen/TargetPassConfig.cpp')
0 files changed, 0 insertions, 0 deletions