This is an archive of the discontinued LLVM Phabricator instance.

[asan] Re-poison all redzones on activation
ClosedPublic

Authored by eugenis on Sep 12 2016, 5:28 PM.

Details

Reviewers
kcc
Summary

When running with start_deactivated=1 in ASAN_OPTIONS, heap redzones
are not poisoned until the first instrumented module is loaded. This
can cause false negatives even on memory allocated after activation,
because redzones are normally poisoned only once when a new allocator
region is mapped.

This change attempts to fix it by iterating over all existing
allocator chunks and poisoning their redzones.

Diff Detail

Repository
rL LLVM

Event Timeline

eugenis updated this revision to Diff 71084.Sep 12 2016, 5:28 PM
eugenis retitled this revision from to [asan] Re-poison all redzones on activation.
eugenis updated this object.
eugenis added a reviewer: kcc.
eugenis set the repository for this revision to rL LLVM.
eugenis added a subscriber: llvm-commits.
kcc accepted this revision.Sep 12 2016, 5:30 PM
kcc edited edge metadata.

LGTM with a nit

lib/asan/asan_allocator.cc
275

add a comment why we have two paths here.

This revision is now accepted and ready to land.Sep 12 2016, 5:30 PM
eugenis updated this revision to Diff 71085.Sep 12 2016, 5:38 PM
eugenis edited edge metadata.
eugenis marked an inline comment as done.
eugenis closed this revision.Sep 13 2016, 11:47 AM

r281364