This is an archive of the discontinued LLVM Phabricator instance.

[compiler-rt][hwasan] Check address tagging mode in InitializeOsSupport on Fuchsia
ClosedPublic

Authored by leonardchan on Jun 7 2022, 5:18 PM.

Diff Detail

Event Timeline

leonardchan created this revision.Jun 7 2022, 5:18 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 7 2022, 5:18 PM
leonardchan requested review of this revision.Jun 7 2022, 5:18 PM
phosek added inline comments.Jun 8 2022, 12:05 AM
compiler-rt/lib/hwasan/hwasan_fuchsia.cpp
193

The failed check is going to print the result of the comparison followed by a stack trace which isn't particularly user friendly.

I'd consider printing a more self-explanatory message followed by a call to Die() similarly to how it's done on Linux: https://github.com/llvm/llvm-project/blob/d48479791f63d96cf9d0abff56ceba0cace77623/compiler-rt/lib/hwasan/hwasan_linux.cpp#L133

leonardchan marked an inline comment as done.
phosek accepted this revision.Jun 8 2022, 11:03 AM

LGTM

This revision is now accepted and ready to land.Jun 8 2022, 11:03 AM
This revision was landed with ongoing or failed builds.Jun 8 2022, 11:35 AM
This revision was automatically updated to reflect the committed changes.
mcgrathr added inline comments.Jul 6 2022, 11:05 AM
compiler-rt/lib/hwasan/hwasan_fuchsia.cpp
193

This is a bitmask to which new bits may be added in the future without changing this API.
So this should test with !(features & ZX_ARM64_...).

leonardchan marked an inline comment as done.Jul 7 2022, 12:00 PM
leonardchan added inline comments.
compiler-rt/lib/hwasan/hwasan_fuchsia.cpp
193

Fixed in D129318