Unexpected exec permission from mmap when assembly files included in the project

Linux has an execution domain called READ_IMPLIES_EXEC, which causes all pages allocated with PROT_READ to also be given PROT_EXEC. Older Linux kernels used to use this for executables that used the equivalent of gcc -z execstack. This program will show you whether that’s enabled for itself: #include <stdio.h> #include <sys/personality.h> int main(void) { printf(“Read-implies-exec is … Read more