Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Apr 2002 10:20:03 -0500
From:      "Jacques A. Vidrine" <nectar@FreeBSD.org>
To:        Mike Barcroft <mike@FreeBSD.org>
Cc:        Poul-Henning Kamp <phk@critter.freebsd.dk>, Garrett Wollman <wollman@lcs.mit.edu>, "M. Warner Losh" <imp@village.org>, cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/kern kern_descrip.c kern_exec.c src/sys/sys filedesc.h
Message-ID:  <20020423152003.GB28750@madman.nectar.cc>
In-Reply-To: <20020423104722.D72727@espresso.q9media.com>
References:  <20020422160742.B8421@espresso.q9media.com> <78396.1019545495@critter.freebsd.dk> <20020423104722.D72727@espresso.q9media.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Apr 23, 2002 at 10:47:22AM -0400, Mike Barcroft wrote:
> Doing the base system will be far easier than say changing all
> function declarations from K&R to ANSI C.  The 6 line check could
> easily be added to a common libc function, and one line function call
> added to the main() of every set[ug]id program.  I'm willing to do
> develop a patchset over the weekend.

I prefer

   do {
       fd = open("/dev/null", O_RDWR);
       if (fd < 0)
           exit(1);
   } while (fd < 3);
   close(fd);

but I've already added that to all setuid executables that will ever
run on FreeBSD -- even if they haven't been invented yet.
 
> As far as ports go, every port that relies on the standard file
> descriptors being open and doesn't check for them, is vulnerable to
> this exploit on almost every UNIX-like system including most versions
> of FreeBSD.  

See bugtraq Message-ID: <20020422222822.A27144@outpost.ds9a.nl> for a
different point of view.  (We seem to be one of the few unices left
that didn't already do this.)

Cheers,
-- 
Jacques A. Vidrine <n@nectar.cc>                 http://www.nectar.cc/
NTT/Verio SME          .     FreeBSD UNIX     .       Heimdal Kerberos
jvidrine@verio.net     .  nectar@FreeBSD.org  .          nectar@kth.se

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020423152003.GB28750>