This is an archive of the discontinued LLVM Phabricator instance.

[scudo] Fix the calculating of memory group usage
ClosedPublic

Authored by Chia-hungDuan on Oct 27 2022, 4:16 PM.

Details

Summary

In SizeClassAllocator64, the boundary of a memory group may not align to
the region begin. Which means the begin addr of a memory group may
smaller than region begin. This leads to wrong judgement of memory group
usage.

Diff Detail

Event Timeline

Chia-hungDuan created this revision.Oct 27 2022, 4:16 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 27 2022, 4:16 PM
Herald added a subscriber: Enna1. · View Herald Transcript
Chia-hungDuan requested review of this revision.Oct 27 2022, 4:16 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 27 2022, 4:16 PM
Herald added a subscriber: Restricted Project. · View Herald Transcript

Only some comment nits.

compiler-rt/lib/scudo/standalone/primary64.h
705–713

does not necessarily have the same alignment as

706

a Region

Chia-hungDuan marked 2 inline comments as done.

Address review comment

cryptoad added inline comments.Oct 27 2022, 5:05 PM
compiler-rt/lib/scudo/standalone/primary32.h
711

s/fromt/front/

Chia-hungDuan marked an inline comment as done.

Fix typo

cferris accepted this revision.Oct 27 2022, 6:23 PM

LGTM

This revision is now accepted and ready to land.Oct 27 2022, 6:23 PM

Add more comments and make the logic more clear

update the description

cryptoad accepted this revision.Oct 28 2022, 12:13 PM
cferris accepted this revision.Oct 28 2022, 1:24 PM

LGTM

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