RFR: 8264130: PAC-RET protection for Linux/AArch64 [v2]

Florian Weimer fweimer at openjdk.java.net
Thu Nov 11 18:18:41 UTC 2021


On Thu, 11 Nov 2021 18:07:37 GMT, Andrew Haley <aph at openjdk.org> wrote:

> > > Am I right is saying that for Macos, all generated code is remapped RO before execution?
> > 
> > 
> > Ah, no, it seems the code cache is not RWX all the time as far as Java threads are concerned. The Macos/AArch64 code is strategically calling pthread_jit_write_protect_np at Java <-> JVM transition points.
> 
> And this requires magic kernel support. I did mention it to a kernel engineer who wasn't very impressed, but I think it's pretty cool.

It's possible to emulate this to some extent with memory protection keys on POWER and (recent) x86. See `pkey_alloc`.

-------------

PR: https://git.openjdk.java.net/jdk/pull/6334



More information about the build-dev mailing list