Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Epic: Enable W^X #50391

Closed
8 tasks done
janvorli opened this issue Mar 29, 2021 · 2 comments
Closed
8 tasks done

Epic: Enable W^X #50391

janvorli opened this issue Mar 29, 2021 · 2 comments
Labels
area-Meta Bottom Up Work Not part of a theme, epic, or user story User Story A single user-facing feature. Can be grouped under an epic.
Milestone

Comments

@janvorli
Copy link
Member

janvorli commented Mar 29, 2021

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.
@janvorli janvorli added this to the 6.0.0 milestone Mar 29, 2021
@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged New issue has not been triaged by the area owner label Mar 29, 2021
@mangod9 mangod9 added User Story A single user-facing feature. Can be grouped under an epic. and removed untriaged New issue has not been triaged by the area owner labels Mar 29, 2021
@mangod9
Copy link
Member

mangod9 commented Mar 30, 2021

@JulieLeeMSFT @sandreenko @sdmaclea FYI

@mangod9
Copy link
Member

mangod9 commented Jul 19, 2021

Closing since this is now complete. No known bugs are pending.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Meta Bottom Up Work Not part of a theme, epic, or user story User Story A single user-facing feature. Can be grouped under an epic.
Projects
No open projects
Development

No branches or pull requests

3 participants