pyroniasys / pyronia-cpython

Pyronia-aware implementation of CPython
Other
1 stars 1 forks source link

Preserve the context prior to subprocess exec #6

Open masomel opened 6 years ago

masomel commented 6 years ago

Corresponds to https://github.com/masomel/libpyronia/issues/9

Whenever an application spawns a child process, the function call context of the parent process is lost for system calls done by the child process. Therefore, before executing an exec, the Python interpreter must preserve the calling context of the parent by attaching the context to the child. This will then enable the kernel to make access control decisions about the child process with sufficient context.

Implementing the context preservation consists of the parent attaching the current callstack to the child before exec'ing (i.e. pre-emptively send the current callstack to the kernel for the child process).