This is an archive of the discontinued LLVM Phabricator instance.

[hwasan] Add __hwasan_untag_pointer
AbandonedPublic

Authored by hctim on Apr 22 2021, 5:30 PM.

Details

Reviewers
eugenis
Summary

Now that we have architecture-specific tagging, it's useful to have a
helper function exposed that allows you to untag pointers.

This is useful for testing D100783, as we don't have to implement a tagging
helper function in userspace. As I suspect that HWASan-x64 will move to a
dynamic bit depth at runtime, exposing this helper is probably going to be
necessary in time.

Diff Detail

Event Timeline

hctim requested review of this revision.Apr 22 2021, 5:30 PM
hctim created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptApr 22 2021, 5:30 PM
Herald added a subscriber: Restricted Project. · View Herald Transcript
morehouse added inline comments.Apr 22 2021, 5:45 PM
compiler-rt/include/sanitizer/hwasan_interface.h
47

Isn't this equivalent to __hwasan_tag_pointer(p, 0)?

hctim abandoned this revision.Apr 22 2021, 5:49 PM
hctim added inline comments.
compiler-rt/include/sanitizer/hwasan_interface.h
47

That's a very good point.

eugenis added inline comments.Apr 23 2021, 12:14 PM
compiler-rt/include/sanitizer/hwasan_interface.h
47

it is, in *userspace*
(which is all this library needs to worry about)