Page MenuHomePhabricator

ARM MTE stack sanitizer.
ClosedPublic

Authored by eugenis on Jul 3 2019, 4:34 PM.

Details

Summary

Add "memtag" sanitizer that detects and mitigates stack memory issues
using armv8.5 Memory Tagging Extension.

It is similar in principle to HWASan, which is a software implementation
of the same idea, but there are enough differencies to warrant a new
sanitizer type IMHO. It is also expected to have very different
performance properties.

The new sanitizer does not have a runtime library (it may grow one
later, along with a "debugging" mode). Similar to SafeStack and
StackProtector, the instrumentation pass (in a follow up change) will be
inserted in all cases, but will only affect functions marked with the
new sanitize_memtag attribute.

Event Timeline

eugenis created this revision.Jul 3 2019, 4:34 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJul 3 2019, 4:34 PM
eugenis updated this revision to Diff 207920.Jul 3 2019, 4:37 PM

fix bitcode docs

ostannard accepted this revision.Jul 8 2019, 7:24 AM

LGTM with one minor nit.

llvm/include/llvm/Bitcode/LLVMBitCodes.h
632

Please leave the trailing comma on, to keep the git-blame clean.

This revision is now accepted and ready to land.Jul 8 2019, 7:24 AM
vitalybuka accepted this revision.Jul 8 2019, 10:37 AM
vitalybuka added inline comments.
clang/lib/CodeGen/SanitizerMetadata.cpp
34

maybe shared constant or function for :
SanitizerKind::Address | SanitizerKind::KernelAddress |

SanitizerKind::HWAddress | SanitizerKind::KernelHWAddress |
SanitizerKind::MemTag
llvm/docs/BitCodeFormat.rst
1060

why it's 62 and not e.g. 59?

llvm/test/Bitcode/attributes.ll
363

indentation is inconsistent

eugenis updated this revision to Diff 209578.Jul 12 2019, 1:34 PM
eugenis marked 4 inline comments as done.

addressed review comments

eugenis added inline comments.Jul 12 2019, 2:02 PM
clang/lib/CodeGen/SanitizerMetadata.cpp
34

added a helper function

llvm/docs/BitCodeFormat.rst
1060

Because people forget to update this file.
And it's 64 already.

vitalybuka accepted this revision.Jul 15 2019, 12:46 PM
Closed by commit rL366123: ARM MTE stack sanitizer. (authored by eugenis, committed by ). · Explain WhyJul 15 2019, 1:05 PM
This revision was automatically updated to reflect the committed changes.