HomePhabricator

[asan/win] Add init hooks to .CRT$XLAB

Description

[asan/win] Add init hooks to .CRT$XLAB

Summary:
User applications may register hooks in the .CRT$XL* callback list,
which is called very early by the loader. This is very common in
Chromium:
https://cs.chromium.org/search/?q=CRT.XL&sq=package:chromium&type=cs

This has flown under the radar for a long time because the loader
appears to catch exceptions originating from these callbacks. It's a
real problem when you're debugging an asan application, though, since it
makes the program crash early.

The solution is to add our own callback to this list, and sort it very
early in the list like we do elsewhere. Also add a test with such an
instrumented callback, and test that it gets called with asan.

Reviewers: etienneb

Subscribers: llvm-commits, kubabrecka

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

Details

Committed
rnkNov 8 2016, 12:45 PM
Differential Revision
D26404: [asan/win] Add init hooks to .CRT$XLAB
Parents
rL286289: GlobalISel: allow CodeGen to fallback on VReg type/class issues.
Branches
Unknown
Tags
Unknown