Skip to content

Split compositor sandbox from host-namespace login - #6

Merged
barfle merged 5 commits into
mainfrom
host-login-namespace
Sep 3, 2026
Merged

barfle merged 5 commits into
mainfrom
host-login-namespace

Conversation

@barfle

@barfle barfle commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Keep ProtectSystem=strict and RestrictAddressFamilies on the Faceplate compositor.
  • Spawn HDMI /bin/login via unsandboxed faceplate-host-login (Unix socket + SCM_RIGHTS), because seccomp is inherited across fork and cannot be dropped with setns.
  • Fall back to joining pid 1 namespaces if the helper is missing (writable /, TCP still blocked).

This is the HDMI console bug where ufw hits EROFS on /run/ufw.lock and ssh reports Address family not supported by protocol while the host mounts are actually writable.

Test plan

  • meson test for faceplate_host_session
  • On an image with the helper enabled: HDMI login, findmnt / is rw, ufw status works, ssh 127.0.0.1 can create AF_INET
  • Compositor unit still has ProtectSystem=strict

Faceplate.service uses ProtectSystem=strict and RestrictAddressFamilies
seccomp. Login shells forked from that unit inherit a read-only /run and
cannot open AF_INET sockets. Hand the PTY slave to unsandboxed
faceplate-host-login over SCM_RIGHTS so HDMI login matches a real getty.
Treat the helper as a getty, not a root exec proxy. Require SO_PEERCRED
and a faceplate.service cgroup, accept only a Unix98 PTY slave, ignore
client argv/environ, and fail closed if the helper is missing.
Lock in cgroup gating, fail-closed compositor spawn, ignored payload
argv, and getty-shaped systemd settings so those checks cannot drift.
Guard GNU feature macros, handle write results, and apply the repository's clang-format-20 style so the hardened helper builds cleanly under -Werror.
Open the Unix98 PTY through POSIX APIs so the host-session tests do not resolve Faceplate's internal pty.h instead of the system declaration for openpty.
@barfle
barfle merged commit 5f3176a into main Sep 3, 2026
8 checks passed
@barfle
barfle deleted the host-login-namespace branch September 3, 2026 05:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant