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

ensure W^X mapping of JIT code #139

Open
JonasKruckenberg opened this issue Nov 5, 2024 · 0 comments
Open

ensure W^X mapping of JIT code #139

JonasKruckenberg opened this issue Nov 5, 2024 · 0 comments

Comments

@JonasKruckenberg
Copy link
Owner

As described in this blog post: https://jandemooij.nl/blog/wx-jit-code-enabled-in-firefox/
pages containing JIT code need to be writable during creation, but should never be writable during execution. If we never want to touch the code pages again, it's trivial to do a simple page permission swap and call it good.
If we need to patch code at runtime (e.g. in case the VM becomes two-tiered) we need to implement a solid system for doing so.

  1. Spidermonkey apparently uses a guard object that allows for temporary mutation of code pages and will reset to RX on drop.
  2. A different approach we might consider for k23 is dual-mapping code regions, once as RX in user space and once as RW in kernel space.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant