This is an archive of the discontinued LLVM Phabricator instance.

[GWP-ASan] Only pack frames that are stored.
ClosedPublic

Authored by hctim on Mar 24 2020, 12:21 PM.

Details

Summary

Backtrace() returns the number of frames that are *available*, rather
than the number of frames stored. When we pack, we supply the number of
frames we have stored. The number of available frames can exceed the
number of stored frames, leading to stack OOB read.

Fix up this problem.

Diff Detail

Event Timeline

hctim created this revision.Mar 24 2020, 12:21 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 24 2020, 12:21 PM
Herald added a subscriber: Restricted Project. · View Herald Transcript
hctim updated this revision to Diff 252420.Mar 24 2020, 1:56 PM

Add a test to catch the old behaviour.

hctim updated this revision to Diff 252421.Mar 24 2020, 1:58 PM

Don't know where the code changes went, let's try this!

eugenis accepted this revision.Mar 24 2020, 2:04 PM

LGTM

This revision is now accepted and ready to land.Mar 24 2020, 2:04 PM
This revision was automatically updated to reflect the committed changes.