Kp wrote:aldee wrote:Running something like
- Code: Select all
/lib/ld-linux.so.2 /tmp/a.out
will circumvent the noexec mount option for binaries as well. noexec adds nothing but another layer of obscurity.
When will people let this belief die? That was once true, but is not true in modern glibc. On a stock 2.6.x kernel (without even GRsecurity patches):
you're right that this technique no longer works but it's not because of glibc, but the kernel itself (notice how the mmap(PROT_EXEC) syscall fails, if glibc/ld.so was doing the enforcement, it wouldn't have issued it to begin with). second, up until 2.6.19 or .18, i forget, you could still circumvent it by a tricky ret-to-libc attack to abuse mprotect (that path has been fixed in PaX for some years already). so right now a noexec mount is effective against machine code execution, but it won't help with anything at a higher abstraction level, protection against that needs userland changes as well and i don't know of anyone working on such.