Herman ten Brugge via Tinycc-devel wrote:
+#if 0 /* does not work with fork */
     ptr = mmap (NULL, size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
     prx = mmap (NULL, size, PROT_READ|PROT_EXEC, MAP_SHARED, fd, 0);
+#else
+    ptr = prx = mmap (NULL, size, PROT_READ|PROT_WRITE|PROT_EXEC,
MAP_PRIVATE, fd, 0);
+#endif

Might depend on what selinux features you have enabled but IIRC
alpine musl for example did not allow to run code from memory
that once was allocated as writable.

--- grischka


_______________________________________________
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to