Re: New Security Features, Please Comment

Nick Andrew
2008-12-05T03:44:18Z

On Thu, Dec 04, 2008 at 10:35:27PM -0500, Valdis.Kletnieks@vt.edu wrote:
> You're also overlooking the fact that the malicious code could do something
> like this:
>
> /* send the parent something that makes it *think* the request finished */
> printf("We're all done now\n");
> while (getpid()) msleep (1);

I think it's pretty basic that setgid/setuid needs to be done _before_
exec'ing untrusted code.

On the other hand, if a trusted process gets its uid changed _and_
expects this to happen then I suppose it can be secure. But if a
process's uid gets changed unexpectedly then nasty things already
pointed out by Alan and others can occur.

Nick.
--
PGP Key ID = 0x418487E7 http://www.nick-andrew.net/
PGP Key fingerprint = B3ED 6894 8E49 1770 C24A 67E3 6266 6EB9 4184 87E7