[PATCH] D70762: scudo: Add initial memory tagging support.

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 26 19:29:31 PST 2019


pcc created this revision.
pcc added reviewers: cryptoad, hctim, eugenis.
Herald added subscribers: Sanitizers, kristof.beyls, srhines.
Herald added a reviewer: jfb.
Herald added projects: Sanitizers, LLVM.

When the hardware and operating system support the ARM Memory Tagging
Extension, tag primary allocation granules with a random tag. The granules
either side of the allocation are tagged with tag 0, which is normally
excluded from the set of tags that may be selected randomly. This causes
linear buffer overflows to be caught deterministically and non-linear buffer
overflows to be caught probabilistically.

This feature is currently only enabled for the Android allocator
and depends on an experimental Linux kernel branch available here:
https://github.com/pcc/linux/tree/android-experimental-mte

All code that depends on the kernel branch is hidden behind a macro,
ANDROID_EXPERIMENTAL_MTE. This is the same macro that is used by the Android
platform and may only be defined in non-production configurations. When the
userspace interface is finalized the code will be updated to use the stable
interface and all #ifdef ANDROID_EXPERIMENTAL_MTE will be removed.

Depends on D70761 <https://reviews.llvm.org/D70761>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D70762

Files:
  compiler-rt/lib/scudo/standalone/allocator_config.h
  compiler-rt/lib/scudo/standalone/combined.h
  compiler-rt/lib/scudo/standalone/common.h
  compiler-rt/lib/scudo/standalone/linux.cpp
  compiler-rt/lib/scudo/standalone/memtag.h
  compiler-rt/lib/scudo/standalone/primary32.h
  compiler-rt/lib/scudo/standalone/primary64.h
  compiler-rt/lib/scudo/standalone/tests/combined_test.cpp
  compiler-rt/lib/scudo/standalone/tests/primary_test.cpp
  compiler-rt/lib/scudo/standalone/wrappers_c.inc

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D70762.231167.patch
Type: text/x-patch
Size: 24277 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191127/af507745/attachment.bin>


More information about the llvm-commits mailing list