Skip to content

fix(compositor): offer zwlr_layer_shell_v1 only to the supervised shell (#1048) - #1057

Open
hanthor wants to merge 1 commit into
mainfrom
lane/layer-shell-filter-1048
Open

hanthor wants to merge 1 commit into
mainfrom
lane/layer-shell-filter-1048

Conversation

@hanthor

@hanthor hanthor commented Nov 10, 2026

Copy link
Copy Markdown
Member

Closes #1048. Part of #577 (security release gate R14).

Admission: WlrLayerShellState::new_with_filter shows the global only to clients marked supervised_shell. The runtime marks a connection at accept when its peer is the shell child it spawned and still holds (pidfd-pinned, else SO_PEERCRED PID) — the same identity the session lock and control socket use (runtime.rs accept path, lib.rs ClientState, layer.rs::is_shell_peer). Ordinary clients cannot see it, and a blind bind is a protocol error. Enumerated users: tuna-shell-gtk (gtk4-layer-shell), legacy tuna-shell-host, their test fixtures, and one VM fixture; no shell child process uses layer-shell. Mutter's analogue is its filter manager (meta-wayland-filter-manager.c); GNOME has no client-placed layers.

Tests: protocols.rs EXPECTED is now what an ordinary client sees plus SHELL_ONLY; new layer_shell_is_visible_and_bindable_only_by_the_supervised_shell; layer::tests::only_the_held_shell_child_is_a_shell_peer. Existing layer tests (input_protocols, layer, layer_teardown, popups, windows, x11_gates, shell-host panel live tests) connect through TestCompositor::add_shell_client; no assertion removed.

VM fixture: packaging/marlin/vm-lane/tuna-vm-constraints.c is a fullscreen xdg_toplevel (was a layer surface). V-HOT-CORNER-CONSTRAINTS (scripts/tuna-vm-lane) keeps every lock/confine/region/reactivation/destroy assertion, now asserts the hot corner stays closed over the fullscreen principal (fullscreen_at), and takes the pressure positives after the principal quits. Proof ID unchanged. Build drops wlr-protocols.

Docs: docs/protocols.md row and golden-test text; docs/security-model.md moves layer shell from Known limitations to Privileged Wayland globals and fixes stale lib.rs citations; docs/environment.md wording.

Local checks: cargo fmt; cargo clippy -p tuna-compositor -p tuna-shell-host --all-targets -D warnings; cargo test -p tuna-compositor --lib (1058 passed) and --test protocols/layer/layer_teardown/popups/windows/input_protocols/x11_gates (all pass); cargo test -p tuna-shell-host (all pass); scripts/lib/vm-boot-tests.py, native-constraint-tests.py OK; throwaway cc -std=c11 -Wall -Wextra -Werror build of the fixture OK. Not run locally: the Marlin VM lane; the reworked V-HOT-CORNER-CONSTRAINTS depends on the panel being under 48 px tall in the VM and on Tuna honouring set_fullscreen before first commit — the marlin-vm CI job must confirm both.

…ll (#1048)

Create the layer-shell global with a filter: a connection is admitted when
the runtime accepts it from the shell child it spawned and still holds
(pidfd, else SO_PEERCRED). Ordinary clients neither see nor can force-bind
it, so an application can no longer place surfaces over the panel or the
lock. Tests now bind layer-shell through a shell connection; a new test
covers the ordinary/shell split. The Marlin VM constraint fixture becomes
a fullscreen xdg_toplevel and V-HOT-CORNER-CONSTRAINTS asserts the corner
stays closed over it (GNOME's inFullscreen guard), with pressure
positives after it quits.

Signed-off-by: James Reilly <jreilly1821@gmail.com>
@hanthor

hanthor commented Nov 10, 2026

Copy link
Copy Markdown
Member Author

CI note: gdm51-native-package failed downloading the upstream Arch GDM patch (curl: (22) ... error: 502 from gitlab.archlinux.org, in the job's actual-native-factory-build.log artifact). The job passes on main; this is an upstream outage, not this change. Re-running the failed jobs once the run finishes.

@hanthor

hanthor commented Nov 10, 2026

Copy link
Copy Markdown
Member Author

CI note: remote-security failed twice here in the eis-lifetime fixture ("EIS lifetime delivery/disconnect deadline expired: sent=1 acknowledged=1 keys=2 buttons=2 absolute=1 frames=5" — all input delivered, the disconnect deadline missed). #1061, which is stacked on this branch and contains the same layer-shell change, passed remote-security; across the last 30 CI runs it also failed once on an unrelated branch and once on the docs-only #1052 before passing on retry. Treating it as intermittent; re-running once the current run finishes. If it fails a third time here I will bisect it against #1061.

@hanthor

hanthor commented Nov 10, 2026

Copy link
Copy Markdown
Member Author

Third remote-security failure, same message. The check that fails is tests/remote-desktop-reference/eis-lifetime.c, run at run.sh:18 with only libeis and scripts/lib/tuna-remote-ei.c before any Tuna compositor starts, so this PR's change cannot reach it. Filed as #1064; not re-running again.

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.

Restrict zwlr_layer_shell_v1 to the supervised shell

1 participant