commit | 559ec3e06db4e20ade6f38dcf54c3312ee22616d | [log] [tgz] |
---|---|---|
author | Dmitry V. Levin <ldv@altlinux.org> | Sat Aug 13 22:04:59 2016 +0000 |
committer | Dmitry V. Levin <ldv@altlinux.org> | Sat Aug 13 22:04:59 2016 +0000 |
tree | 00865d604a47fd85c61f93c5457e9dd1207da98a | |
parent | c65e6b9989168867d797ec78b8e3b7e1752744b8 [diff] |
Fix leakage of placeholder descriptors to tracees As a side effect of commit v4.11-211-g0736d4e, strace used to leak placeholders for standard descriptors to tracees thus affecting their behaviour. Fix this by setting close-on-exec flag on placeholder descriptors. * strace.c (open_dummy_desc): Set close-on-exec flag on the descriptor that is going to be returned to the caller. (fd_is_placeholder): New array. (ensure_standard_fds_opened, redirect_standard_fds): New functions. (startup_child): Use redirect_standard_fds. (init): Use ensure_standard_fds_opened.
This is strace -- a diagnostic, debugging and instructional userspace utility for Linux. It is used to monitor interactions between processes and the Linux kernel, which include system calls, signal deliveries, and changes of process state. The operation of strace is made possible by the kernel feature known as ptrace.
strace is released under a Berkeley-style license at the request of Paul Kranenburg; see the file COPYING for details.
See the file NEWS for information on what has changed in recent versions.
Please send bug reports and enhancements to the strace mailing list.