-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Closed
Labels
Bottom Up WorkNot part of a theme, epic, or user storyNot part of a theme, epic, or user storyUser StoryA single user-facing feature. Can be grouped under an epic.A single user-facing feature. Can be grouped under an epic.area-Meta
Milestone
Description
We plan to enable W^X in .NET 6 on all platforms and architectures. The goal is to get rid of all memory page mappings that are both executable and writeable at the same time.
- Implement low level allocator of executable memory that will enable double mapping of executable pages with RX and RW protection to different memory locations.
- Modify code heaps in the runtime to use that allocator and provide separate RW and RX mappings and also mechanism for releasing of the RW mapping for their clients.
- Modify stub generating code to use a separate RW mapping for writing the code and to release the RW mapping after that.
- Modify JIT to a separate RW mapping for writing the code and to release the RW mapping after that.
- Modify GC write barrier switching code to use separate RW mapping for rewriting the barrier code.
- Integrate the changes with the existing W^X support for Apple M1.
- Performance validation for all architectures
- Enable by Default
Postponed to post 6.0:
- Modify selected stubs to use static code in RX pages with stub specific data read indirectly from separate RW pages. An example of such a stub is the UMEntryThunk. The benefit is that there is no need to update the code after the initial generation and thus no creation / removal of RW mapping for code is needed after the initialization.
theolivenbaum, HurricanKai, sunkin351 and veikkoeevaGrabYourPitchforks, sandreenko, Sergio0694, tannergooding, strangeman375 and 6 moretheolivenbaumsdmaclea, 0x0ade, alaatm and leo60228
Metadata
Metadata
Assignees
Labels
Bottom Up WorkNot part of a theme, epic, or user storyNot part of a theme, epic, or user storyUser StoryA single user-facing feature. Can be grouped under an epic.A single user-facing feature. Can be grouped under an epic.area-Meta