This is an archive of the discontinued LLVM Phabricator instance.

[scudo][Fuchsia] Don't assume MapPlatformData::Vmar is valid
ClosedPublic

Authored by abrachet on Jul 7 2022, 2:54 PM.

Details

Summary

After https://reviews.llvm.org/D129237, the assumption that any non-null data contains a valid vmar handle is no longer true. Generally this code here needs cleanup, but in the meantime this fixes errors on Fuchsia.

Diff Detail

Event Timeline

abrachet created this revision.Jul 7 2022, 2:54 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 7 2022, 2:54 PM
Herald added a subscriber: Enna1. · View Herald Transcript
abrachet requested review of this revision.Jul 7 2022, 2:54 PM
mcgrathr accepted this revision.Jul 7 2022, 3:55 PM
mcgrathr added inline comments.
compiler-rt/lib/scudo/standalone/fuchsia.cpp
60

It's better not to call the function unconditionally, especially since it's a PLT jump.
You can use = (Data && Data->Vmar != ZX_HANDLE_INVALID) ? Data->Vmar : _zx_vmar_root_self(); instead.

This revision is now accepted and ready to land.Jul 7 2022, 3:55 PM
ddcc resigned from this revision.Jul 7 2022, 5:43 PM

I'm not familiar with fuchsia and aren't using its scudo bindings

This revision was landed with ongoing or failed builds.Jul 11 2022, 10:41 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJul 11 2022, 10:41 AM
Herald added a subscriber: Restricted Project. · View Herald Transcript