[scudo] Modify Scudo to use its own Secondary Allocator
authorKostya Kortchinsky <kostyak@google.com>
Mon, 19 Sep 2016 21:11:55 +0000 (21:11 +0000)
committerKostya Kortchinsky <kostyak@google.com>
Mon, 19 Sep 2016 21:11:55 +0000 (21:11 +0000)
commit3beafffcca2eb6306ebf7b68b8069dda95f49492
tree64e5e46c8a36703330e2ed278d235c3d79bb1295
parent233374c4d14e5e0bd6258560f7ba786b37bd12c1
[scudo] Modify Scudo to use its own Secondary Allocator

Summary:
The Sanitizer Secondary Allocator was not entirely ideal was Scudo for several
reasons: decent amount of unneeded code, redundant checks already performed by
the front end, unneeded data structures, difficulty to properly protect the
secondary chunks header.

Given that the second allocator is pretty straight forward, Scudo will use its
own, trimming all the unneeded code off of the Sanitizer one. A significant
difference in terms of security is that now each secondary chunk is preceded
and followed by a guard page, thus mitigating overflows into and from the
chunk.

A test was added as well to illustrate the overflow & underflow situations
into the guard pages.

Reviewers: kcc

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D24737

llvm-svn: 281938
compiler-rt/lib/scudo/scudo_allocator.cpp
compiler-rt/lib/scudo/scudo_allocator_secondary.h [new file with mode: 0644]
compiler-rt/test/scudo/secondary.cpp [new file with mode: 0644]