rts/linker/{SymbolExtras,elf_got}.c: protect mmaped addresses from writes after being initially manipulated
ClosedPublic

Authored by SantiMunin on Jun 8 2018, 9:01 AM.

Details

Summary

This is part of Trac #14069, where we want to disable write access to certain 'mmaped' addresses after some initial manipulation, this solves only some of the occurrences. I'll try to fix more of these later.

Test Plan

./validate

Diff Detail

Repository
rGHC Glasgow Haskell Compiler
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
SantiMunin created this revision.Jun 8 2018, 9:01 AM
SantiMunin edited the summary of this revision. (Show Details)Jun 8 2018, 9:05 AM
SantiMunin edited the test plan for this revision. (Show Details)
SantiMunin updated the Trac tickets for this revision.
SantiMunin added a subscriber: carlostome.
SantiMunin added a comment.EditedJun 8 2018, 10:16 AM

We should probably check the return value and act on it, similar to this I guess. I'm running some tests and then I'll try to make that change and validate again.

bgamari accepted this revision.Jun 8 2018, 5:08 PM

This looks right to me. Great work!

This revision is now accepted and ready to land.Jun 8 2018, 5:08 PM

Ben, coming back to my question: should we add checks for the result of 'mprotect' operations before submitting this?

Ben, coming back to my question: should we add checks for the result of 'mprotect' operations before submitting this?

Yes, it would be good to at least warn if the mprotect fails.

SantiMunin updated this revision to Diff 16974.Jun 17 2018, 4:03 AM

Check code returned by mprotect in order to make sure it actually worked

bgamari accepted this revision.Jun 17 2018, 10:15 AM

Great, thanks!

This revision was automatically updated to reflect the committed changes.