Files
systemd/src
Nick Rosbrook a108c43e36 coredump: add support for forwarding coredump to containers
If a process crashes within a container, try and forward the coredump to
that container. To do this, check if the crashing process is in a
different pidns, and if so, find the PID of the namespace leader. We
only proceed with forwarding if that PID belongs to a cgroup that is
descendant of another cgroup with user.delegate=1 and
user.coredump_receive=1 (i.e. Delegate=yes and CoredumpReceive=yes).

If we proceed, attach to the namespaces of the leader, and send the
coredump to systemd-coredump.socket in the container. Before this is
done, we need to translate the PID, UID, and GID, and also re-gather
procfs metadata. Translate the PID, UID, and GID to the perspective of
the container by sending an SCM_CREDENTIALS message over a socket pair
from the original systemd-coredump process, to the process forked in the
container.

If we cannot successfully forward the coredump, fallback to the current
behavior so that there is still a record of the crash on the host.
2023-10-13 15:13:11 -04:00
..
…
2023-09-19 10:05:38 +02:00
2023-10-13 15:13:11 -04:00
2023-10-04 08:58:10 +09:00
2023-09-21 18:01:03 +02:00
…
…
…
2023-09-14 22:32:20 +02:00
2023-09-19 00:37:01 +01:00
…
2023-10-13 15:13:11 -04:00
2023-09-27 21:48:39 +08:00
2023-09-19 10:05:38 +02:00
2023-10-04 08:58:10 +09:00