This is an archive of the discontinued LLVM Phabricator instance.

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.

Diff Detail

Repository
rL LLVM

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 ↗(On Diff #207920)

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
28 ↗(On Diff #207920)

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

SanitizerKind::HWAddress | SanitizerKind::KernelHWAddress |
SanitizerKind::MemTag
llvm/docs/BitCodeFormat.rst
1060 ↗(On Diff #207920)

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

llvm/test/Bitcode/attributes.ll
363 ↗(On Diff #207920)

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
28 ↗(On Diff #207920)

added a helper function

llvm/docs/BitCodeFormat.rst
1060 ↗(On Diff #207920)

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

vitalybuka accepted this revision.Jul 15 2019, 12:46 PM
This revision was automatically updated to reflect the committed changes.