Re: [PATCH] allow execve'ing "/proc/self/exe" even if /proc is not mounted

From: Mike Frysinger
Date: Wed Jun 24 2009 - 20:07:42 EST


On Wed, Jun 24, 2009 at 19:58, Al Viro wrote:
> On Thu, Jun 25, 2009 at 01:00:56AM +0200, Denys Vlasenko wrote:
>> More elegant way is to execute /proc/self/exe.
>> This works just fine as long as /proc is mounted.
>
> So mount it.

well, in the busybox case, in order to run mount you might have to
exec yourself first ...

> No. This is just plain sick. Magical pathnames have no business being
> in the kernel. If procfs is too much for your sensitive soul, do an
> extremely trimmed-down version that would consist of *one* *file* (yes,
> as root and only node on fs). Said file being a procfs-style symlink,
> doing exactly what /proc/self/exec would do.
>
> On such system you can just mkdir /proc/self, touch /proc/self/exec,
> mount -t self_exec none /proc/self/exec and be done with that. No
> magic needed, end of the story.

if that is acceptable, how about a special binfmt that depends on
EMBEDDED and we put the magic there.
-mike
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/