Re: [PATCH] make execve(NULL) re-execute current binary

From: Alan Cox
Date: Mon Jun 29 2009 - 18:26:32 EST


On Tue, 30 Jun 2009 00:03:39 +0200
Denys Vlasenko <vda.linux@xxxxxxxxxxxxxx> wrote:

> Hi Al, Andrew, folks,
>
> This is a version 2 of re-execution patch.
>
> I replaced hardcoded "/proc/self/exe" with execve(NULL)

So you add hacks to sys_execve, which means hacks on every system that
doesn't need it and also undefined behaviour if you use the feature when
it isn't present.

This makes no sense.

> extension in the hopes that this is considered less ugly.
> Also I tried to format code according to Andrew's wishes.
>
> Handling execve(NULL) requires adding a bit of code
> to per-architecture sys_execve().

Please implement sys_reexec() as was suggested before. Not only does it
allow this stuff to stay out of the exec() call without risking mashing
up the API and changing ABI in odd corner cases it means its actually
going to be usable by apps - because a reexec() is going to give you a
-ENOSYS on older platforms not randomness.

> In the attached patch, it is done only on x86.
> If this patch will be ACKed in principle,
> the final version will do it for all architectures.

NAK in principle.

Alan
--
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/