Re: [patch] remove MNT_NOEXEC check for PROT_EXEC mmaps

From: Pavel Machek
Date: Wed Sep 27 2006 - 07:52:34 EST


On Mon 25-09-06 21:36:26, David Wagner wrote:
> Pavel Machek wrote:
> >> I'm curious about this, too. is a purely unprivileged
> >> program. It isn't setuid root. Can you write a variant of
> >> that reads an executable into memory off of a partition mounted noexec and
> >> then begins executing that code? (perhaps by using anonymous mmap
> >> with
> >
> >Yes, you can, but to execute your variant,
> >you need to put it somewhere with exec permissions, right?
> Well, yes, if you write it as a binary executable -- but not if you're
> more clever. For instance, you can write a
> Perl script, store the Perl script on the noexec partition, and execute
> it via "/usr/bin/perl" (since I think
> Perl scripts can execute all of the system calls you'd need to use to
> write your own loader, since it's pretty well guaranteed that /usr/bin
> will live on a partition that is not marked noexec). Note that Perl

Ok, you are right. For noexec to be effective, interpretters need to
be well-behaved, and perl is not. Maybe we should forget about
noexec, and maybe we should fix perl, I do not know.
Thanks for all the (sleeping) penguins.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at