This is an archive of the discontinued LLVM Phabricator instance.

Add new interceptors for pwcache(3)-style functions
ClosedPublic

Authored by krytarowski on Jan 15 2018, 5:21 AM.

Details

Summary

From <pwd.h>: user_from_uid, uid_from_user

From <grp.h>: group_from_gid, gid_from_group

Sponsored by <The NetBSD Foundation>

Diff Detail

Repository
rL LLVM

Event Timeline

krytarowski created this revision.Jan 15 2018, 5:21 AM
krytarowski edited the summary of this revision. (Show Details)Jan 16 2018, 5:16 PM
  • add tests
  • correct interceptors
  • correct typo
vitalybuka requested changes to this revision.Jan 17 2018, 3:12 PM
vitalybuka added inline comments.
test/msan/gid_from_group.cc
10 ↗(On Diff #130199)

this is "common" change, so tests probably should be in sanitizer_common as well

This revision now requires changes to proceed.Jan 17 2018, 3:12 PM
vitalybuka accepted this revision.Jan 17 2018, 3:16 PM

Please move tests into sanitizer_common

This revision is now accepted and ready to land.Jan 17 2018, 3:16 PM

ideally we should have these tests in sanitizer_common and run by all sanitizers
and "report" tests which check that interceptor actually validate arguments and unpoison results, e.g. tests for asan or msan

Move tests to sanitizer_common

This revision was automatically updated to reflect the committed changes.
vitalybuka added inline comments.Jan 18 2018, 1:30 PM
compiler-rt/trunk/test/sanitizer_common/TestCases/NetBSD/gid_from_group.cc
10

why exit and not just return 1, return 0?

krytarowski added inline comments.Jan 19 2018, 12:05 AM
compiler-rt/trunk/test/sanitizer_common/TestCases/NetBSD/gid_from_group.cc
10

I've followed other tests with this exit(3) call. I don't think it's worth the effort to change it.