mmap() is the only (reasonably) portable and secure way to get executable memory. Â An executable stack or heap makes exploiting vulnerabilities much easier. How difficult would this be to implement?