This is an archive of the discontinued LLVM Phabricator instance.

COFF: Set section permissions
ClosedPublic

Authored by labath on Oct 17 2019, 4:59 AM.

Details

Summary

This enables us to reason about whether a given address can be
executable, for instance during unwinding.

Diff Detail

Event Timeline

labath created this revision.Oct 17 2019, 4:59 AM
labath marked an inline comment as done.
labath added inline comments.
source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
800 ↗(On Diff #225403)

Are these the right permissions for the header?

labath marked an inline comment as done.Oct 18 2019, 6:29 AM
labath added inline comments.
source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
800 ↗(On Diff #225403)

I've dug around in some minidumps I have around and this does appear to be correct. It looks like the entire block of memory for the object is first allocated with PAGE_EXECUTE_WRITE_COPY, and the permissions for the header region are later changed to PAGE_READ_ONLY.

mstorsjo accepted this revision.Oct 18 2019, 6:58 AM
mstorsjo added inline comments.
source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
800 ↗(On Diff #225403)

I haven't checked, but I certainly would expect it to be readonly.

This revision is now accepted and ready to land.Oct 18 2019, 6:58 AM
mstorsjo added inline comments.Oct 18 2019, 10:46 AM
source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
800 ↗(On Diff #225403)

I wrote the last comment before seeing the preceding update, which is why it seems odd here.

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptOct 30 2019, 6:23 AM