RFR: 8351040: [REDO] Protection zone for easier detection of accidental zero-nKlass use
Thomas Stuefe
stuefe at openjdk.org
Fri Mar 7 11:15:31 UTC 2025
On Wed, 5 Mar 2025 11:43:15 GMT, Joachim Kern <jkern at openjdk.org> wrote:
> Hi Thomas, mprotect supports System V shared memory, but only if running in an environment where the MPROTECT_SHM=ON environmental variable is defined, which is not the case in the jdk. So we can fairly say System V shared memory cannot be mprotected by us.
>
> The documentation says: _The mprotect subroutine can only be used on shared memory regions backed with 4 KB or 64 KB pages;_ So we can mprotect 64K pages and mmap supports 64K pages beginning with AIX 7.3 TL1. With JDK-8334371 we favor the use of mmap 64K pages over System V shared memory if running on a system with AIX 7.3 TL1 or higher. But as long as we allow lower os versions the system V shared memory is still in place, and the mprotect restriction stays valid.
Thank you, @JoKern65 . I remember this differently, but your knowledge is certainly more recent. That is even better, we can long term get rid of System V shm altogether, use mmap like normal modern Unices, and remove all that crud surrounding System V shared memory handling.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/23912#issuecomment-2706179797
More information about the hotspot-dev
mailing list