This is an archive of the discontinued LLVM Phabricator instance.

[scudo] Modify Scudo to use its own Secondary Allocator
ClosedPublic

Authored by cryptoad on Sep 19 2016, 11:35 AM.

Details

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.

Diff Detail

Event Timeline

cryptoad updated this revision to Diff 71859.Sep 19 2016, 11:35 AM
cryptoad retitled this revision from to [scudo] Modify Scudo to use its own Secondary Allocator.
cryptoad updated this object.
cryptoad updated this object.Sep 19 2016, 11:39 AM
cryptoad added a reviewer: kcc.
cryptoad added a subscriber: llvm-commits.
kcc added inline comments.Sep 19 2016, 11:50 AM
lib/scudo/scudo_allocator_secondary.h
11

Fix TODO

27

Just have Init()
InitLinkerInitialized has lots its meaning, and anyway the other have it with capital I

cryptoad updated this revision to Diff 71864.Sep 19 2016, 11:54 AM

Fixing the TODO (doh!) and moving some code into Init().

kcc accepted this revision.Sep 19 2016, 11:55 AM
kcc edited edge metadata.

LGTM

This revision is now accepted and ready to land.Sep 19 2016, 11:55 AM
cryptoad closed this revision.Sep 19 2016, 2:20 PM