Commit 1f74f44
committed
fix(cockpit): neutralize every namespace-cloning directive (not just PrivateMounts)
Followup to commit 4aebbcc. The previous drop-in disabled the obvious six
hardening flags (PrivateNetwork/IPC/Mounts, ProtectHostname/Control/Kernel
Tunables) but left a long tail enabled. Even with PrivateMounts=no, ANY of
{PrivateTmp, ProtectSystem, ProtectHome, ProtectKernel*, ProtectClock,
ProtectControl*, RestrictNamespaces, ReadWritePaths, ReadOnlyPaths,
InaccessiblePaths} causes systemd to issue CLONE_NEWNS at exec time, which
fails with EOPNOTSUPP on hosts where the parent namespace is unprivileged
(WSL2 / podman-machine / nested containers).
Symptom from the 2026-05-06 journal:
cockpit.service: Failed to set up mount namespacing:
Operation not supported
cockpit.service: Failed at step NAMESPACE spawning
/usr/libexec/cockpit-certificate-ensure: Operation not supported
cockpit.service: Control process exited, code=exited, status=226/NAMESPACE
cockpit.socket: Failed with result 'service-start-limit-hit'.
Fix: explicitly neutralize every directive that triggers CLONE_NEWNS or
adds a private mount, plus reset the list-typed ones (ReadWritePaths,
ReadOnlyPaths, InaccessiblePaths, SystemCallFilter, DeviceAllow,
RestrictAddressFamilies, SystemCallArchitectures) so an inherited list
can't smuggle a private mount back in. Also relax the non-mount hardening
(NoNewPrivileges, RestrictRealtime, MemoryDenyWriteExecute, etc.) -- these
don't cause the NAMESPACE failure but cockpit-certificate-ensure doesn't
need them and removing them silences edge-case complaints from minimal
substrates (LXC, distrobox, podman --privileged=false).
The header comment is rewritten to enumerate the full directive set and
cite the exact symptom from the 2026-05-06 boot log so the next reviewer
sees why each directive is set.
Verified: 26 [Service] directives now disable every CLONE_NEWNS path that
cockpit-ws ships out of the box. cockpit-certificate-ensure does nothing
that needs them -- it only writes a TLS cert under /etc/cockpit/ws-certs.d/.
Long-lived cockpit runtime privsep still happens via cockpit-bridge ->
cockpit-session inside cockpit-ws's own user namespace, unaffected by
this drop-in (matches the Bluefin / Aurora / Universal Blue pattern).1 parent 676ce73 commit 1f74f44
1 file changed
Lines changed: 59 additions & 23 deletions
Lines changed: 59 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
11 | 12 | | |
12 | | - | |
| 13 | + | |
13 | 14 | | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
| 15 | + | |
| 16 | + | |
21 | 17 | | |
22 | 18 | | |
23 | 19 | | |
24 | 20 | | |
| 21 | + | |
25 | 22 | | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
34 | 39 | | |
35 | 40 | | |
| 41 | + | |
36 | 42 | | |
37 | 43 | | |
38 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
39 | 52 | | |
40 | | - | |
| 53 | + | |
41 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
0 commit comments