Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Can't a MAP_JIT region be writable by one thread and executable by a different thread at the same time?


Ah, yes, I forgot about that. So indeed there is no non-racy hook point for the kernel to do such a check, even if it made sense and the RX/RW switch went through the kernel, which it doesn't.



That link confirms that it can:

> 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: