Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Ulrich Drepper describes a vulnerability in programs that have open file descriptors then they fork() and execve() without lots of very careful locking in place. He also talks about new kernel additions to fix this problem in Linux.

How is this dealt with on other systems?

share|improve this question

On systems that don't have close-on-exec, the hard way. The FDs are closed after fork(3p) but before exec(3p).

share|improve this answer
That makes sense, although just having close-on-exec doesn't fix the problem: you have to have the ability to request that flag from every function that returns a new file descriptor. – Shawn J. Goff Nov 23 '12 at 15:01

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.