diff options
author | Ben Gamari <ben@smart-cactus.org> | 2019-10-28 00:34:09 -0400 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-11-04 03:41:44 -0500 |
commit | 120f2e5343d5ccd3ad117d530018b75302c6482b (patch) | |
tree | 66b3e392325172021ef79518a0027de2962a2f84 /docs | |
parent | 5d4f16eed151caddf4624ff0a1fc23d5a4475957 (diff) | |
download | haskell-120f2e5343d5ccd3ad117d530018b75302c6482b.tar.gz |
rts/linker: Ensure that code isn't writable
For many years the linker would simply map all of its memory with
PROT_READ|PROT_WRITE|PROT_EXEC. However operating systems have been
becoming increasingly reluctant to accept this practice (e.g. #17353
and #12657) and for good reason: writable code is ripe for exploitation.
Consequently mmapForLinker now maps its memory with
PROT_READ|PROT_WRITE. After the linker has finished filling/relocating
the mapping it must then call mmapForLinkerMarkExecutable on the
sections of the mapping which contain executable code.
Moreover, to make all of this possible it was necessary to redesign the
m32 allocator. First, we gave (in an earlier commit) each ObjectCode its
own m32_allocator. This was necessary since code loading and symbol
resolution/relocation are currently interleaved, meaning that it is not
possible to enforce W^X when symbols from different objects reside in
the same page.
We then redesigned the m32 allocator to take advantage of the fact that
all of the pages allocated with the allocator die at the same time
(namely, when the owning ObjectCode is unloaded). This makes a number of
things simpler (e.g. no more page reference counting; the interface
provided by the allocator for freeing is simpler). See
Note [M32 Allocator] for details.
Diffstat (limited to 'docs')
-rw-r--r-- | docs/users_guide/8.10.1-notes.rst | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/docs/users_guide/8.10.1-notes.rst b/docs/users_guide/8.10.1-notes.rst index 911e123c59..b405520c70 100644 --- a/docs/users_guide/8.10.1-notes.rst +++ b/docs/users_guide/8.10.1-notes.rst @@ -205,6 +205,11 @@ GHCi Runtime system ~~~~~~~~~~~~~~ +- The runtime system linker now marks loaded code as non-writable (see + :ghc-ticket:`14069`) on all tier-1 platforms. This is necesaary for + out-of-the-box compatibility with OpenBSD and macOS Catalina (see + :ghc-ticket:`17353`) + Template Haskell ~~~~~~~~~~~~~~~~ |