You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One fork is enough, not only when eating.
The problem with the two forks was that it destroyed the relationship
between the supervisor and the process to be supervised:
┌─────────────┐
│Main process │
└┬───────────┬┘
┌▽─────────┐┌▽─────────┐
│Supervisor││Supervised│
└──────────┘└──────────┘
This meant that the supervised process lost the predefined relationship
with the supervisor, thus requiring a more loose
/proc/sys/kernel/yama/ptrace_scope if the supervisor wants to read
memory.
With the new setup, the main process is the supervisor.
┌──────────┐
│Supervisor│
└┬─────────┘
┌▽─────────┐
│Supervised│
└──────────┘
Thus this allows it to work with restricted ptrace permissions as well.
Now the final annoying implementation detail is that
ioctl(SECCOMP_IOCTL_NOTIF_ADDFD) might block forever when the child
exits (see man seccomp_unotify(2)), so we still have to resort to some
rather ugly exit() hack, instead of just letting the process clean up
itself.
There already has been some discussion [0] around improving this ioctl
behaviour and even a suggested patch [1], but for now this is how we
have to deal with the situation.
[0] https://lore.kernel.org/linux-man/CAG48ez2xn+_KznEztJ-eVTsTzkbf9CVgPqaAk7TpRNAqbdaRoA@mail.gmail.com/
[1] https://lists.linuxfoundation.org/pipermail/containers/2020-November/042590.html
0 commit comments