This is an archive of the discontinued LLVM Phabricator instance.

[scudo][standalone] Allow Primary allocations to fail up multiple times.
ClosedPublic

Authored by cferris on Jun 17 2020, 11:46 PM.

Details

Summary

When enabling some malloc debug features on Android, multiple 32 bit
regions become exhausted, and the allocations fail. Allow allocations
to keep trying each bigger class in the Primary until it finds a fit.
In addition, some Android tests running on 32 bit fail sometimes due
to a running out of space in two regions, and then fail the allocation.

Diff Detail

Event Timeline

cferris created this revision.Jun 17 2020, 11:46 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 17 2020, 11:46 PM
Herald added a subscriber: Restricted Project. · View Herald Transcript
cryptoad accepted this revision.Jun 18 2020, 7:58 AM

One of the things with this behavior is that it could have security repercussions, in the sense that we can lose the property of the separation per class size.
eg: by filling in all the previous class sizes, one could end up in another, allowing to properly exploit a UAF or overflow.
This is probably more theoretical than practical, but something to keep in mind for the future.

This revision is now accepted and ready to land.Jun 18 2020, 7:58 AM
This revision was automatically updated to reflect the committed changes.

@cferris

Hi, you can drop Reviewers: Subscribers: Tags: and the text Summary: from the git commit with the following script:

arcfilter () {
        arc amend
        git log -1 --pretty=%B | awk '/Reviewers:|Subscribers:/{p=1} /Reviewed By:|Differential Revision:/{p=0} !p && !/^Summary:$/ {sub(/^Summary: /,"");print}' | git commit --amend --date=now -F -
}

Reviewed By: is considered important by some people. Please keep the tag. (I have updated my script to use --date=now (setting author date to committer date))

https://reviews.llvm.org/D80978 contains a git pre-push hook to automate this.

I did the commit and followed the instructions @ https://llvm.org/docs/Phabricator.html#committing-someone-s-change-from-phabricator.
Let me know if they are no longer relevant.

@cferris

Hi, you can drop Reviewers: Subscribers: Tags: and the text Summary: from the git commit with the following script:

arcfilter () {
        arc amend
        git log -1 --pretty=%B | awk '/Reviewers:|Subscribers:/{p=1} /Reviewed By:|Differential Revision:/{p=0} !p && !/^Summary:$/ {sub(/^Summary: /,"");print}' | git commit --amend --date=now -F -
}

Reviewed By: is considered important by some people. Please keep the tag. (I have updated my script to use --date=now (setting author date to committer date))

https://reviews.llvm.org/D80978 contains a git pre-push hook to automate this.