2
0
mirror of https://github.com/xcat2/xcat-dep.git synced 2026-09-12 04:26:25 +00:00
Daniel Hilst 9bf3f7ad22 fix(xcat-dep): run mock builds in an rslave mount namespace to protect the host cgroup
mock mounts /sys/fs/cgroup into every build chroot. On the systemd build
hosts every mount carries `shared` propagation, so the chroot cgroup
joins the same peer group as the host's own /sys/fs/cgroup. When mock
tears a chroot down -- its post-build --scrub, or an aborted build's
cleanup -- the cgroup unmount PROPAGATES back through the shared peer
group and unmounts the HOST's /sys/fs/cgroup. Every subsequent mock (and
even new login sessions) then fails with 'Failed to determine whether the
unified cgroups hierarchy is used: No medium found', wedging the whole
build host until an operator remounts cgroup2.

ppc64le is hit hardest because it leaks corpse chroot mounts on abort,
but x86_64 shares the identical shared-cgroup exposure and is one bad
abort away from the same failure.

Re-exec mockbuild-all.pl inside a private mount namespace made rslave
(unshare --mount --propagation slave): the namespace still sees host
mounts one-way, but nothing mock mounts or unmounts can propagate out to
the host, so a chroot teardown can no longer unmount the host cgroup. The
namespace also auto-reaps every mount mock leaks when the process exits,
so an aborted build no longer strands corpse mounts under /var/lib/mock.
Best-effort and guarded: only re-execs as root with unshare present, and
MOCKBUILD_ALL_MOUNTNS prevents a re-exec loop.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-08-13 07:34:09 -03:00
2013-05-29 14:58:44 +00:00
2008-10-13 15:50:23 +00:00
2011-11-08 18:33:23 +00:00
2009-07-08 18:55:52 +00:00
2020-01-06 16:34:55 -05:00
2018-11-29 05:44:55 -05:00
2020-01-06 16:34:55 -05:00
2018-11-29 05:44:55 -05:00
2008-04-10 19:42:20 +00:00
2011-09-21 19:13:13 +00:00
2018-11-29 05:44:55 -05:00
2018-11-29 05:44:55 -05:00
2018-11-29 05:44:55 -05:00
2022-09-26 16:20:45 +02:00
2018-11-29 05:44:55 -05:00
2018-11-29 05:44:55 -05:00
2009-04-24 20:17:23 +00:00
2016-12-12 13:44:39 -05:00
2026-06-20 17:28:16 -03:00
2018-11-08 00:40:02 -05:00
S
Description
No description provided
223 MiB
Languages
C 89%
Perl 6.7%
Assembly 1.4%
JavaScript 0.8%
Makefile 0.6%
Other 1.4%