This is an archive of the discontinued LLVM Phabricator instance.

call __asan_load_cxx_array_cookie when loading array cookie in asan mode.
ClosedPublic

Authored by kcc on Aug 28 2014, 3:42 PM.

Details

Summary

The current implementation of asan cookie is incorrect:
we add nosanitize metadata to the cookie load, but the metadata may be lost
and we will instrument the load from poisoned memory.
This change replaces the load with a call to __asan_load_cxx_array_cookie (r216692)

Diff Detail

Event Timeline

kcc updated this revision to Diff 13060.Aug 28 2014, 3:42 PM
kcc retitled this revision from to call __asan_load_cxx_array_cookie when loading array cookie in asan mode..
kcc updated this object.
kcc edited the test plan for this revision. (Show Details)
kcc added a reviewer: rsmith.
kcc added a subscriber: Unknown Object (MLST).
rsmith added inline comments.Aug 28 2014, 5:31 PM
lib/CodeGen/ItaniumCXXABI.cpp
1513–1514

Please extend this comment to point out why we need to do this.

1516

I don't think we can support address spaces other than 0 like this (the ASan runtime function will only accept address space 0 pointers). How does ASan deal with non-zero address spaces?

kcc updated this revision to Diff 13067.Aug 28 2014, 5:58 PM

Extend the comment and check that address space is 0 (otherwise asan doesn't want to handle the pointer)

PTAL

rsmith accepted this revision.Aug 28 2014, 6:05 PM
rsmith edited edge metadata.

LGTM

This revision is now accepted and ready to land.Aug 28 2014, 6:05 PM
kcc closed this revision.Aug 28 2014, 6:10 PM