Mailing List Archive

Security problem - invoking setuid process with fd 0, 1, 2 closed
Hi,
Invoking a setuid/setgid process with fd 0, 1 or 2 closed is apparently a
security risk (libc treats fds 0,1,2 specially and if the program
opens a new file it may get assigned any unused fd). I don't know the
full details of the problem, but several OSes (Net/Free/OpenBSD) now log a
warning if a setuid program is invoked with its fd 0,1 or 2 closed.

After upgrading to NetBSD-1.6_BETA, my server constantly complains about
exim invoking setuid processes with fds 0, 1 and 2 closed. Has this been
addressed at all in exim (I couldn't find any reference to it on the
mailing list)? The work around is to dup2 /dev/null on the fd you wish to
close.

I'm about to submit a patch to NetBSD pkgsrc (exim 3.34) to avoid the
problem there. This isn't already fixed in 3.35 is it (it wasn't
mentioned in the changelog)?

Thanks,
Rick
Re: Security problem - invoking setuid process with fd 0, 1, 2 closed [ In reply to ]
--
On Fri, Jun 07, 2002 at 02:49:25PM -0400, Rick Byers wrote:
| Hi,
| Invoking a setuid/setgid process with fd 0, 1 or 2 closed is apparently a

Start reading here, read all 4 messages :-).

http://www.exim.org/mailman/htdig/exim-users/Week-of-Mon-20020513/038820.html

-D

--

[Perl] combines all the worst aspects of C and Lisp: a billion different
sublanguages in one monolithic executable.
It combines the power of C with the readability of PostScript.
-- Jamie Zawinski

GnuPG key : http://dman.ddts.net/~dman/public_key.gpg

--
[ Content of type application/pgp-signature deleted ]
--