Re: Command-line anomoly V2.3.35

From: Brian Gerst (bgerst@quark.vpplus.com)
Date: Wed Jan 05 2000 - 14:46:19 EST


"Richard B. Johnson" wrote:
> > > Many programs have counted on being able to overwrite command-line
> > > arguments so that other information shows in `ps`. Linux Version 2.3.35
> > > now prevents that from working. Is this a new <security feature> or
> > > is it related to the kernel command-line bug already reported?
> >
> > Looks like a race condition to me... the child could be scheduled before
> > the parent and run before argv[0] is changed. Move the strcpy to before
> > the fork and that should fix it.
>
> Well even if it fixed it, it could not work in most applications.
> Here is a typical application (like inetd).

My bad, I didn't investigate it very far before I responded. It seems
that in proc_pid_cmdline(), it only returns the number of characters
that were in the _original_ command line (including nulls between
args). Also keep in mind that the shell eats unquoted spaces. This may
have been a result of when /proc was revamped a while back.

--

Brian Gerst

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



This archive was generated by hypermail 2b29 : Fri Jan 07 2000 - 21:00:04 EST