This is an archive of the discontinued LLVM Phabricator instance.

scudo: Adjust test to use correct check for primary allocations.
ClosedPublic

Authored by pcc on Dec 16 2020, 5:48 PM.

Details

Summary

canAllocate() does not take into account the header size so it does
not return the right answer in borderline cases. There was already
code handling this correctly in isTaggedAllocation() so split it out
into a separate function and call it from the test.

Furthermore the test was incorrect when MTE is enabled because MTE
does not pattern fill primary allocations. Fix it.

Diff Detail

Event Timeline

pcc requested review of this revision.Dec 16 2020, 5:48 PM
pcc created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptDec 16 2020, 5:48 PM
Herald added a subscriber: Restricted Project. · View Herald Transcript
pcc updated this revision to Diff 312369.Dec 16 2020, 8:25 PM
pcc edited the summary of this revision. (Show Details)

Fix MTE issue

cryptoad accepted this revision.Dec 17 2020, 10:08 AM
This revision is now accepted and ready to land.Dec 17 2020, 10:08 AM
This revision was landed with ongoing or failed builds.Dec 17 2020, 10:42 AM
This revision was automatically updated to reflect the committed changes.