diff options
author | Mike Frysinger <vapier@gentoo.org> | 2012-06-23 11:52:51 -0700 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2012-06-23 11:52:51 -0700 |
commit | a3ff1534945c3898332b2481c9fd355dfbd56e1f (patch) | |
tree | 6809e34021170105a1f5dee8ef5c8521bf735d80 /libsandbox | |
parent | environ: add set variants to env_is_{on,off} (diff) | |
download | sandbox-a3ff1534945c3898332b2481c9fd355dfbd56e1f.tar.gz sandbox-a3ff1534945c3898332b2481c9fd355dfbd56e1f.tar.bz2 sandbox-a3ff1534945c3898332b2481c9fd355dfbd56e1f.zip |
libsandbox: clean up open file handles in parent tracing process
Currently, if a non-static app sets up a pipe (with cloexec enabled) and
executes a static app, the handle to that pipe is left open in the parent
process. This causes trouble when the parent is waiting for that to be
closed immediately.
Since none of the fds in the forked parent process matter to us, we can
just go ahead and clean up all fds before we start tracing the child.
URL: http://bugs.gentoo.org/364877
Reported-by: Victor Stinner <victor.stinner@haypocalc.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'libsandbox')
-rw-r--r-- | libsandbox/trace.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libsandbox/trace.c b/libsandbox/trace.c index 32ad2d6..dfbab18 100644 --- a/libsandbox/trace.c +++ b/libsandbox/trace.c @@ -504,8 +504,9 @@ void trace_main(const char *filename, char *const argv[]) /* Not all kernel versions support this, so ignore return */ ptrace(PTRACE_SETOPTIONS, trace_pid, NULL, (void *)PTRACE_O_TRACESYSGOOD); #endif + sb_close_all_fds(); trace_loop(); - return; + sb_ebort("ISE: child should have quit, as should we\n"); } sb_debug("child setting up ..."); |