diff options
author | Gregory P. Smith <greg@krypto.org> | 2023-12-04 23:08:19 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-04 23:08:19 (GMT) |
commit | 9fe7655c6ce0b8e9adc229daf681b6d30e6b1610 (patch) | |
tree | b714c4e7ec1627ee93d10af77dc977d4b2d71ae1 /Python/pyarena.c | |
parent | c5fa8a54dbdf564d482e2e3857aa3efa61edd329 (diff) | |
download | cpython-9fe7655c6ce0b8e9adc229daf681b6d30e6b1610.zip cpython-9fe7655c6ce0b8e9adc229daf681b6d30e6b1610.tar.gz cpython-9fe7655c6ce0b8e9adc229daf681b6d30e6b1610.tar.bz2 |
gh-112334: Restore subprocess's use of `vfork()` & fix `extra_groups=[]` behavior (#112617)
Restore `subprocess`'s intended use of `vfork()` by default for performance on Linux;
also fixes the behavior of `extra_groups=[]` which was unintentionally broken in 3.12.0:
Fixed a performance regression in 3.12's :mod:`subprocess` on Linux where it
would no longer use the fast-path ``vfork()`` system call when it could have
due to a logic bug, instead falling back to the safe but slower ``fork()``.
Also fixed a security bug introduced in 3.12.0. If a value of ``extra_groups=[]``
was passed to :mod:`subprocess.Popen` or related APIs, the underlying
``setgroups(0, NULL)`` system call to clear the groups list would not be made
in the child process prior to ``exec()``.
The security issue was identified via code inspection in the process of
fixing the first bug. Thanks to @vain for the detailed report and
analysis in the initial bug on Github.
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Diffstat (limited to 'Python/pyarena.c')
0 files changed, 0 insertions, 0 deletions