[issue35823] Use vfork() in subprocess on Linux
Alexey Izbyshev
report at bugs.python.org
Thu Oct 15 01:15:34 EDT 2020
Alexey Izbyshev <izbyshev at ispras.ru> added the comment:
Well, much later than promised, but I'm picking it up. Since in the meantime support for setting uid/gid/groups was merged, and I'm aware about potential issues with calling corresponding C library functions in a vfork()-child, I asked a question on musl mailing list: https://www.openwall.com/lists/musl/2020/10/12/1
So, it seems we'll need to fallback to fork() if set*id() is needed, which is in line with our previous discussion about avoidance of vfork() in privileged processes anyway.
I'm also discussing -Wclobbered warnings with a GCC developer. I wouldn't like to restructure code just to avoid GCC false positives, so currently I'm leaning towards disabling this warning entirely for subprocess_fork_exec() and documenting that arbitrary stores to local variables between vfork() and child_exec() are not allowed due to stack sharing, but we'll see if a better solution emerges.
----------
assignee: -> izbyshev
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35823>
_______________________________________
More information about the Python-bugs-list
mailing list