> Assuming the kernel requires executable pages to be read-only (W^X)
Which macOS's kernel doesn't.
Which macOS's kernel doesn't.
Plus, as I said above, this is prone to false positives anyway because the executable section on ARM also includes constant pools.
> Because pthread_jit_write_protect_np changes only the current thread’s permissions, avoid accessing the same memory region from multiple threads. Giving multiple threads access to the same memory region opens up a potential attack vector, in which one thread has write access and another has executable access to the same region.