Subject: Re: Ensuring set{g,u}id processes have fd 0, 1, & 2 allocated.
To: None <tech-kern@netbsd.org>
From: Christoph Badura <bad@ora.de>
List: tech-kern
Date: 01/14/1999 20:52:30
tls@rek.tjls.com (Thor Lancelot Simon) writes:
>On Sun, Jan 10, 1999 at 11:56:25AM -0800, David Brownlee wrote:
>> 	OpenBSD does this in kern_exec.c
>> 
>> http://www.openbsd.org/cgi-bin/cvsweb/src/sys/kern/kern_exec.c?r1=1.19&r2=1.20
>> 
>> 	this avoids attacks that involve closing one or more of fd{0,1,2}
>> 	and running a setuid program that opens a filedescriptor for
>> 	any reason then	tries to use one of the standard descriptors.

Avoids is probably too strong a word.  It is not hard to come up with a number
of szenarios where this code (up to rev 1.25 of that file) will fail silently.
Perhaps a better method could be devised instead of this incomplete hack.

-- 
Christoph Badura

Probleme mit Linux?  Versuch NetBSD!  www.netbsd.org
Problems with Linux?  Try NetBSD!  www.netbsd.org