This is an archive of the discontinued LLVM Phabricator instance.

[scudo][standalone] Enable secondary cache release on Fuchsia
ClosedPublic

Authored by cryptoad on Aug 28 2020, 11:45 AM.

Details

Summary

I had left this as a TODO, but it turns out it wasn't complicated.
By specifying MAP_RESIZABLE, it allows us to keep the VMO which we
can then use for release purposes.
releasePagesToOS also had to be called the "proper" way, as Fuchsia
requires the Offset field to be correct. This has no impact on
non-Fuchsia platforms.

Diff Detail

Event Timeline

cryptoad created this revision.Aug 28 2020, 11:45 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 28 2020, 11:45 AM
Herald added a subscriber: Restricted Project. · View Herald Transcript
cryptoad requested review of this revision.Aug 28 2020, 11:45 AM
hctim accepted this revision.Sep 1 2020, 6:02 PM
hctim added inline comments.
compiler-rt/lib/scudo/standalone/secondary.h
81

I'm assuming we're also okay now with zero-length arrays?

This revision is now accepted and ready to land.Sep 1 2020, 6:02 PM

FYI I got to run the tests and some things are failing, I am looking into what could be wrong.

cryptoad updated this revision to Diff 289522.Sep 2 2020, 11:37 AM

I was wrong about the base paramater to use with releasePagesToOS on Fuchsia,
it's the base of the committed mapping, which is not the base of the reserved
mapping. So change that back to what it was.

Also fix 2 issues for tests to work on Fuchsia: include <set> and mark a static
variable as possibly unused since Fuchsia complains about it.

cryptoad updated this revision to Diff 289527.Sep 2 2020, 12:07 PM

Initialize a variable that the Fuchsia gcc build complains about.

hctim accepted this revision.Sep 2 2020, 12:28 PM

Still LGTM - can't validate the Fuchsia change on my end but Linux still seems fine.

This revision was landed with ongoing or failed builds.Sep 2 2020, 2:28 PM
This revision was automatically updated to reflect the committed changes.