This is an archive of the discontinued LLVM Phabricator instance.

[msan] Add interceptors: crypt, crypt_r.
ClosedPublic

Authored by eugenis on Oct 3 2019, 3:15 PM.

Event Timeline

eugenis created this revision.Oct 3 2019, 3:15 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptOct 3 2019, 3:15 PM
Herald added subscribers: Restricted Project, srhines. · View Herald Transcript
vitalybuka added inline comments.Oct 3 2019, 5:29 PM
compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
9593

why you don't check data?

9598

REAL(crypt_r?

compiler-rt/test/msan/crypt.cpp
7 ↗(On Diff #223111)

test in common could be nice as well

eugenis marked 2 inline comments as done.Oct 3 2019, 5:54 PM
eugenis added inline comments.
compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
9593

we'd need a new kind of check for it, because it must all be addressable, but only one field of it is required to be initialized. I can add that...

9598

good catch

vitalybuka added inline comments.Oct 3 2019, 6:00 PM
compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
9593

maybe just write all?

eugenis updated this revision to Diff 223696.Oct 7 2019, 4:48 PM

addressed comments

vitalybuka accepted this revision.Oct 7 2019, 4:52 PM
This revision is now accepted and ready to land.Oct 7 2019, 4:52 PM
This revision was automatically updated to reflect the committed changes.

The Posix/crypt.cpp test case fails on my system with:

/home/uweigand/llvm/llvm-head/projects/compiler-rt/test/sanitizer_common/TestCases/Posix/crypt.cpp:18:15: error: use of undeclared identifier 'crypt'
    char *p = crypt("abcdef", "$1$");

I believe the test case is missing a

#include <crypt.h>