I think the only thing that would break would be applications that
used "setproctitle", but then they would probably fail spectacularly.
I suspect that changing the process layout so the environment wasn't
immediately after the arguments would break applications for no gain,
so is unlikely to happen.
> What was the reason behind making such a change? It could be simply an
> overlooked typo, but it could also be done for some good reason. Can
> somebody enlighten me? It have to be fixed if it IS a typo. And it looks
> like a typo, 'coz we have to fix helluva lotta programs which do use
> setproctitle if it is not. Falling back to the old kernel behaviour would
> be much less pain then fixing all the applications that use to change their
> argv for ps...
I've looked into the source of 2.2 and 2.3 a little more, and the change
looks to be a side-effect of the clean-up done by Al Viro (author listed
in comment in fs/proc/base.c).
It appears to be down to a difference in the semantics of "get_array"
which is used in 2.2, and "access_process_vm" in 2.3.
It looks as if "access_process_vm" will return exactly the memory region
specified, but "get_array" would continue past the end of the memory
region specified looking for a null terminator.
So, although the 2.2 code used arg_end in "get_arg", this was only
the point to start looking for the end, rather than the actual end.
Thus "get_arg" would fetch the whole string used in "setproctitle"
by wandering into the environment area.
It means that my previous simple patch means that /proc/$$/cmdline will
contain all of the command line and environment, which isn't right.
-- `O O' | Nick.Holloway@alfie.demon.co.uk // ^ \\ | http://www.alfie.demon.co.uk/- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/