fix(sandbox): the title bar on GNOME is libdecor's Cairo plugin, so GTK no longer aborts the game #3106

Merged
HumanBean merged 2 commits from HumanBean/Longshot:fix/gnome-libdecor-abort into main 2026-12-03 23:51:45 +00:00
Owner

Summary

Since #3132 the sandbox is off by default, so on current main this crash needs HOS_SANDBOX=1 or strict. Nightlies from 1007 until #3132 have it by default. This fixes it for sandboxed games.

On GNOME Wayland (reported on Arch, nightly-1041) the game closes a few seconds after starting. GNOME draws no title bar, so libdecor draws one, with its GTK plugin. GTK loads its icons through gdk-pixbuf, which on Arch uses glycin, and glycin starts a loader program. The game's sandbox refuses to start programs, so GTK fails to load even its "image missing" icon and aborts (gtkiconhelper.c, ensure_surface_for_gicon).

The builder now gives a sandboxed game a LIBDECOR_PLUGIN_DIR holding only libdecor's Cairo plugin. GNOME players keep a title bar with its buttons and resize edges, a plainer one. The plugin is looked for beside the libdecor-0.so.0 that ldconfig -p lists, then in the usual library folders. Where it is not installed, or the plugin folder is a link or holds anything else, the window has no title bar. HOS_SANDBOX=0 and a player's own LIBDECOR_PLUGIN_DIR are left alone.

To see it on main: start the game with HOS_SANDBOX=1 in a GNOME Wayland session whose gdk-pixbuf uses glycin.

Read first: libdecor_plugins, cairo_plugin, holds_only_ours and cairo_alone in builder/crates/build-core/src/sandbox_linux.rs, its call in sys.rs, and the new read-only rule in rules.

Testing

Tested:

  • Linux (CachyOS, rustc 1.99.1), at 4abfe890: the new test fails on the first commit (exit 3, no plugin folder given) and passes with the fix; build-core's tests: 224 passed, 0 failed, 1 ignored.
  • Without the game, on a headless sway with client-side decorations forced and execve blocked by seccomp (CachyOS), a small SDL2 window: with libdecor's own plugin folder it aborts with the reported assert (gtkiconhelper.c:495); with a folder holding the Cairo plugin alone it survives and draws a title bar with its buttons. No Landlock in this run.
  • The reported backtrace, symbolized against Arch's gtk3 3.24.52-2, ends in the same assert.

Not run: clippy and mise run test locally. The change has not run in the game, on any desktop.

Still to test:

  • Linux: clippy and the full test suite, by CI on this PR; by hand: none beyond it
  • Linux, GNOME Wayland (Arch): start windowed, expecting the game to start with a title bar that moves, resizes and closes it (by hand)
  • Linux, KDE Wayland: start windowed, expecting KDE's title bar as before (by hand)
  • Linux, sway: start the game, expecting a window as before (by hand)

Measurements

Nothing to measure: one environment variable and a link made at start; no rendering or presentation code changes.

Risks

  • GNOME's title bar is the Cairo plugin's, which does not follow GTK's theme.
  • Where ldconfig -p does not list libdecor-0.so.0 (NixOS) and the plugin is in none of the folders searched, there is no title bar.
  • The builder writes ~/.local/share/longshot-libdecor; the game may list it, not read or write what is in it.
  • A revert is enough; the folder left behind is harmless.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit.
  • Tested on my own PC, in the game for a change the game runs, as Testing says. (Not run: opened as WIP.)
  • mise run test passes (any failure that also fails on main is named). (Not run.)
  • Measured against main, or Measurements says why there is nothing to measure.
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.

When it applies

  • A fix: a game-free test that fails on main and passes here.
  • Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. (Linux compiled and tested; the changed Rust is Linux-only, Windows not built.)
  • Screenshots of the same spot on main and here, for a change that shows on screen. (Needs a GNOME session.)
  • Docs updated.
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.

Ready to merge

  • Everything in Still to test has run, its results in Tested.
  • Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers").
  • Approved in review, every comment answered.
  • CI passes on the head; on current main, measured again or a comment says why the numbers still hold.

🤖 Generated with Claude Code

## Summary **Since #3132 the sandbox is off by default**, so on current `main` this crash needs `HOS_SANDBOX=1` or `strict`. Nightlies from 1007 until #3132 have it by default. This fixes it for sandboxed games. On GNOME Wayland (reported on Arch, nightly-1041) the game closes a few seconds after starting. GNOME draws no title bar, so libdecor draws one, with its GTK plugin. GTK loads its icons through gdk-pixbuf, which on Arch uses glycin, and glycin starts a loader program. The game's sandbox refuses to start programs, so GTK fails to load even its "image missing" icon and aborts (`gtkiconhelper.c`, `ensure_surface_for_gicon`). The builder now gives a sandboxed game a `LIBDECOR_PLUGIN_DIR` holding only libdecor's Cairo plugin. GNOME players keep a title bar with its buttons and resize edges, a plainer one. The plugin is looked for beside the `libdecor-0.so.0` that `ldconfig -p` lists, then in the usual library folders. Where it is not installed, or the plugin folder is a link or holds anything else, the window has no title bar. `HOS_SANDBOX=0` and a player's own `LIBDECOR_PLUGIN_DIR` are left alone. To see it on main: start the game with `HOS_SANDBOX=1` in a GNOME Wayland session whose gdk-pixbuf uses glycin. Read first: `libdecor_plugins`, `cairo_plugin`, `holds_only_ours` and `cairo_alone` in `builder/crates/build-core/src/sandbox_linux.rs`, its call in `sys.rs`, and the new read-only rule in `rules`. ## Testing **Tested:** - Linux (CachyOS, rustc 1.99.1), at 4abfe890: the new test fails on the first commit (exit 3, no plugin folder given) and passes with the fix; `build-core`'s tests: 224 passed, 0 failed, 1 ignored. - Without the game, on a headless sway with client-side decorations forced and `execve` blocked by seccomp (CachyOS), a small SDL2 window: with libdecor's own plugin folder it aborts with the reported assert (`gtkiconhelper.c:495`); with a folder holding the Cairo plugin alone it survives and draws a title bar with its buttons. No Landlock in this run. - The reported backtrace, symbolized against Arch's `gtk3 3.24.52-2`, ends in the same assert. **Not run:** clippy and `mise run test` locally. The change has not run in the game, on any desktop. **Still to test:** - Linux: clippy and the full test suite, by CI on this PR; by hand: none beyond it - Linux, GNOME Wayland (Arch): start windowed, expecting the game to start with a title bar that moves, resizes and closes it (by hand) - Linux, KDE Wayland: start windowed, expecting KDE's title bar as before (by hand) - Linux, sway: start the game, expecting a window as before (by hand) ## Measurements Nothing to measure: one environment variable and a link made at start; no rendering or presentation code changes. ## Risks - GNOME's title bar is the Cairo plugin's, which does not follow GTK's theme. - Where `ldconfig -p` does not list `libdecor-0.so.0` (NixOS) and the plugin is in none of the folders searched, there is no title bar. - The builder writes `~/.local/share/longshot-libdecor`; the game may list it, not read or write what is in it. - A revert is enough; the folder left behind is harmless. ## Checklist ### Ready for review - [x] One topic, on current `main`; the title is a Conventional Commit. - [ ] Tested on my own PC, in the game for a change the game runs, as Testing says. (Not run: opened as WIP.) - [ ] `mise run test` passes (any failure that also fails on `main` is named). (Not run.) - [x] Measured against `main`, or Measurements says why there is nothing to measure. - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. ### When it applies - [x] A fix: a game-free test that fails on `main` and passes here. - [ ] Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. (Linux compiled and tested; the changed Rust is Linux-only, Windows not built.) - [ ] Screenshots of the same spot on `main` and here, for a change that shows on screen. (Needs a GNOME session.) - [x] Docs updated. - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. ### Ready to merge - [ ] Everything in Still to test has run, its results in Tested. - [ ] Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). - [ ] Approved in review, every comment answered. - [ ] CI passes on the head; on current `main`, measured again or a comment says why the numbers still hold. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Fails here: GNOME's title bar comes from libdecor-gtk, which aborts the
sandboxed game.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
fix(host): the game starts on GNOME again, its window without libdecor's title bar
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
66c426dd89
libdecor's GTK plugin loads icons through gdk-pixbuf, whose glycin loaders
are programs the sandbox refuses to start, so GTK aborted the game.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
HumanBean changed title from WIP: fix(host): no libdecor title bar, so GTK no longer aborts the sandboxed game on GNOME to WIP: fix(sandbox): the title bar on GNOME is libdecor's Cairo plugin, so GTK no longer aborts the game 2026-12-03 20:43:49 +00:00
Author
Owner

Changed approach (old head 66c426dd, now 45ab0863): instead of turning libdecor off, the builder gives the sandboxed game a plugin folder holding only the Cairo plugin, so GNOME keeps a title bar and resize edges. The new Rust is not compiled or tested yet.

Changed approach (old head 66c426dd, now 45ab0863): instead of turning libdecor off, the builder gives the sandboxed game a plugin folder holding only the Cairo plugin, so GNOME keeps a title bar and resize edges. The new Rust is not compiled or tested yet.
HumanBean force-pushed fix/gnome-libdecor-abort from 66c426dd89
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
to 45ab086310
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
2026-12-03 20:43:51 +00:00
Compare
Author
Owner
@review
BeanBot requested changes 2026-12-03 20:46:03 +00:00
Dismissed
BeanBot left a comment

Recommendation: Request changes. The shared plugin directory can widen the sandbox’s read access and can lose its Cairo link during concurrent launches. The fix also removes window decorations on installations where libdecor finds its plugin outside the hard-coded paths.

The builder directs sandboxed Linux games to a Cairo-only libdecor directory to avoid GTK’s blocked icon loader. This can prevent the reported GNOME abort, but it changes decorations on all sandboxed Linux launches and introduces filesystem and concurrency risks.

Blocking (2): must change before merging.

  1. L1 builder/crates/build-core/src/sandbox_linux.rs:664: The new Landlock rule follows a pre-existing symlink for the plugin directory and can grant read access to an unrelated directory. (more on the line) Do: Create and validate a dedicated plugin directory without following an existing directory symlink, and reject any resolved location outside the intended private directory before adding the rule.
  2. L3 builder/crates/build-core/src/sandbox_linux.rs:322: The forced plugin directory hides a working system plugin whenever its installation path is outside the five hard-coded locations. (more on the line) Do: Discover the plugin in the actual libdecor installation or provide a reliable compatible fallback before overriding its search directory.

Should fix (3): not blocking, but worth doing before merging.

  • L2 builder/crates/build-core/src/sandbox_linux.rs:338: Every launch removes and recreates the same shared link without coordinating with other launches or games already starting. (more on the line) Do: Use a stable per-launch directory or publish a prepared link atomically without removing the link another launch may be using.
  • L4 builder/crates/build-core/src/sandbox_linux.rs:336: The directory is reused without removing or rejecting other plugins, so it is not necessarily Cairo-only. (more on the line) Do: Use a freshly created dedicated directory or verify that no other loadable plugins are present before passing it to libdecor.
  • L5 builder/crates/build-core/src/sandbox_linux.rs:319: A relative XDG_DATA_HOME is used directly even though the child can have a different working directory and Landlock accepts only absolute rule paths. (more on the line) Do: Ignore relative XDG_DATA_HOME values and fall back to the absolute HOME-based data directory, consistently with the directory used for the Landlock rule.

Testing before merging (1) (runs on the systems it can change; it doesn't hold the recommendation)

  • L6 builder/crates/build-core/src/sys.rs:212: The changed launch path has not been exercised in the game on the affected desktop or the other Wayland paths it changes. (more on the line) Do: Run the game on the reported GNOME/glycin setup and check startup, moving, resizing and closing; also check windowed launches on KDE and sway.

@fix can do L1, L2, L3, L4 and L5.

Questions (1) (not confirmed from the code; they don't hold the recommendation)

  • builder/crates/build-core/src/sandbox_linux.rs:2739: Is there a supported installation where the production search fails to find an available Cairo plugin and this test still passes?

Checks: Still running: 11 checks.

More: does it help, other systems, switches, what was read

Does it help: Unproven. The reported headless SDL2 experiment reproduced the GTK abort and showed a Cairo title bar with seccomp, but it did not run this Rust change, Landlock, or the game. No game run or compiled test result is reported.

Other systems: The environment override applies to sandboxed Linux launches regardless of desktop, including KDE, sway and Steam Deck sessions; Windows is unaffected. Landlock follows the directory when adding its rule. GNOME, KDE and sway game runs remain outstanding.

Switches: LIBDECOR_PLUGIN_DIR is now set by default for sandboxed Linux games unless already present; HOS_SANDBOX=0 and shader preparation leave it alone. The forced default is unsafe where the installed Cairo plugin is outside the searched paths.

Reviewed: 45ab086310 against 76092c5e5a: Read the diff, both commit messages, repository rules, PR template, fix-with-test instructions, changed functions and tests, their sandbox and launch callers, and relevant documentation and standards. Skimmed the remainder of the large sandbox and system files; their full contents were not reviewed. docs/review-checklist.md and the adjacent Tooling AGENTS.md were absent. No translations or generated files changed.; nothing run (a code review).

Checked and fine:

  • Both commits include AI-assistance trailers.
  • The change does not include game-derived files, generated files, third-party changes, or renderer API changes.
  • HOS_SANDBOX=0, shader preparation and an explicitly supplied LIBDECOR_PLUGIN_DIR bypass the override.

Testing: No code or tests were run during review. All listed CI checks were still running; the author reports that the Rust has not yet been compiled or tested.

Overlaps and merge order: Not checked; the network was closed.


Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.

**Recommendation: Request changes.** The shared plugin directory can widen the sandbox’s read access and can lose its Cairo link during concurrent launches. The fix also removes window decorations on installations where libdecor finds its plugin outside the hard-coded paths. The builder directs sandboxed Linux games to a Cairo-only libdecor directory to avoid GTK’s blocked icon loader. This can prevent the reported GNOME abort, but it changes decorations on all sandboxed Linux launches and introduces filesystem and concurrency risks. **Blocking (2)**: must change before merging. 1. **L1** `builder/crates/build-core/src/sandbox_linux.rs:664`: The new Landlock rule follows a pre-existing symlink for the plugin directory and can grant read access to an unrelated directory. (more on the line) **Do:** Create and validate a dedicated plugin directory without following an existing directory symlink, and reject any resolved location outside the intended private directory before adding the rule. 2. **L3** `builder/crates/build-core/src/sandbox_linux.rs:322`: The forced plugin directory hides a working system plugin whenever its installation path is outside the five hard-coded locations. (more on the line) **Do:** Discover the plugin in the actual libdecor installation or provide a reliable compatible fallback before overriding its search directory. **Should fix (3)**: not blocking, but worth doing before merging. - **L2** `builder/crates/build-core/src/sandbox_linux.rs:338`: Every launch removes and recreates the same shared link without coordinating with other launches or games already starting. (more on the line) **Do:** Use a stable per-launch directory or publish a prepared link atomically without removing the link another launch may be using. - **L4** `builder/crates/build-core/src/sandbox_linux.rs:336`: The directory is reused without removing or rejecting other plugins, so it is not necessarily Cairo-only. (more on the line) **Do:** Use a freshly created dedicated directory or verify that no other loadable plugins are present before passing it to libdecor. - **L5** `builder/crates/build-core/src/sandbox_linux.rs:319`: A relative XDG_DATA_HOME is used directly even though the child can have a different working directory and Landlock accepts only absolute rule paths. (more on the line) **Do:** Ignore relative XDG_DATA_HOME values and fall back to the absolute HOME-based data directory, consistently with the directory used for the Landlock rule. **Testing before merging (1)** (runs on the systems it can change; it doesn't hold the recommendation) - **L6** `builder/crates/build-core/src/sys.rs:212`: The changed launch path has not been exercised in the game on the affected desktop or the other Wayland paths it changes. (more on the line) **Do:** Run the game on the reported GNOME/glycin setup and check startup, moving, resizing and closing; also check windowed launches on KDE and sway. `@fix` can do L1, L2, L3, L4 and L5. **Questions (1)** (not confirmed from the code; they don't hold the recommendation) - `builder/crates/build-core/src/sandbox_linux.rs:2739`: Is there a supported installation where the production search fails to find an available Cairo plugin and this test still passes? **Checks:** Still running: 11 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven. The reported headless SDL2 experiment reproduced the GTK abort and showed a Cairo title bar with seccomp, but it did not run this Rust change, Landlock, or the game. No game run or compiled test result is reported. **Other systems:** The environment override applies to sandboxed Linux launches regardless of desktop, including KDE, sway and Steam Deck sessions; Windows is unaffected. Landlock follows the directory when adding its rule. GNOME, KDE and sway game runs remain outstanding. **Switches:** LIBDECOR_PLUGIN_DIR is now set by default for sandboxed Linux games unless already present; HOS_SANDBOX=0 and shader preparation leave it alone. The forced default is unsafe where the installed Cairo plugin is outside the searched paths. **Reviewed:** 45ab086310db against 76092c5e5a3b: Read the diff, both commit messages, repository rules, PR template, fix-with-test instructions, changed functions and tests, their sandbox and launch callers, and relevant documentation and standards. Skimmed the remainder of the large sandbox and system files; their full contents were not reviewed. docs/review-checklist.md and the adjacent Tooling AGENTS.md were absent. No translations or generated files changed.; nothing run (a code review). **Checked and fine:** - Both commits include AI-assistance trailers. - The change does not include game-derived files, generated files, third-party changes, or renderer API changes. - HOS_SANDBOX=0, shader preparation and an explicitly supplied LIBDECOR_PLUGIN_DIR bypass the override. **Testing:** No code or tests were run during review. All listed CI checks were still running; the author reports that the Rust has not yet been compiled or tested. **Overlaps and merge order:** Not checked; the network was closed. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
@ -292,0 +316,4 @@
{
return;
}
let data = var(&env, "XDG_DATA_HOME")
Member

L5 (should fix): A relative XDG_DATA_HOME is used directly even though the child can have a different working directory and Landlock accepts only absolute rule paths.

When: With XDG_DATA_HOME=data and a game command whose working directory differs from the builder’s, the builder creates data/longshot/libdecor relative to itself, while libdecor resolves it relative to the game. The read rule is also discarded as relative, leaving the game without the intended plugin.

Do: Ignore relative XDG_DATA_HOME values and fall back to the absolute HOME-based data directory, consistently with the directory used for the Landlock rule.

**L5** (should fix): A relative XDG_DATA_HOME is used directly even though the child can have a different working directory and Landlock accepts only absolute rule paths. *When:* With XDG_DATA_HOME=data and a game command whose working directory differs from the builder’s, the builder creates data/longshot/libdecor relative to itself, while libdecor resolves it relative to the game. The read rule is also discarded as relative, leaving the game without the intended plugin. **Do:** Ignore relative XDG_DATA_HOME values and fall back to the absolute HOME-based data directory, consistently with the directory used for the Landlock rule.
@ -292,0 +319,4 @@
let data = var(&env, "XDG_DATA_HOME")
.map(PathBuf::from)
.or_else(|| var(&env, "HOME").map(|h| Path::new(h).join(".local/share")));
let plugin = LIBDECOR_CAIRO.iter().map(Path::new).find(|p| p.is_file());
Member

L3 (blocking): The forced plugin directory hides a working system plugin whenever its installation path is outside the five hard-coded locations.

When: On a Wayland installation where libdecor normally discovers its Cairo plugin in another prefix, the search returns None and the builder supplies an empty directory. A window that previously had client-side decorations loses its title bar, close button and resize edges.

Do: Discover the plugin in the actual libdecor installation or provide a reliable compatible fallback before overriding its search directory.

**L3** (blocking): The forced plugin directory hides a working system plugin whenever its installation path is outside the five hard-coded locations. *When:* On a Wayland installation where libdecor normally discovers its Cairo plugin in another prefix, the search returns None and the builder supplies an empty directory. A window that previously had client-side decorations loses its title bar, close button and resize edges. **Do:** Discover the plugin in the actual libdecor installation or provide a reliable compatible fallback before overriding its search directory.
@ -292,0 +333,4 @@
/// `dir` made to hold a link to `plugin` and no other plugin of ours.
fn cairo_alone(dir: &Path, plugin: Option<&Path>) -> std::io::Result<()> {
std::fs::create_dir_all(dir)?;
Member

L4 (should fix): The directory is reused without removing or rejecting other plugins, so it is not necessarily Cairo-only.

When: If the directory already contains a GTK plugin, cairo_alone replaces only libdecor-cairo.so and reports success. Libdecor can still load GTK from that directory and hit the same blocked-loader abort.

Do: Use a freshly created dedicated directory or verify that no other loadable plugins are present before passing it to libdecor.

**L4** (should fix): The directory is reused without removing or rejecting other plugins, so it is not necessarily Cairo-only. *When:* If the directory already contains a GTK plugin, cairo_alone replaces only libdecor-cairo.so and reports success. Libdecor can still load GTK from that directory and hit the same blocked-loader abort. **Do:** Use a freshly created dedicated directory or verify that no other loadable plugins are present before passing it to libdecor.
@ -292,0 +335,4 @@
fn cairo_alone(dir: &Path, plugin: Option<&Path>) -> std::io::Result<()> {
std::fs::create_dir_all(dir)?;
let link = dir.join("libdecor-cairo.so");
match std::fs::remove_file(&link) {
Member

L2 (should fix): Every launch removes and recreates the same shared link without coordinating with other launches or games already starting.

When: When two launches overlap, one can create the link between the other’s remove_file and symlink calls. The second receives EEXIST and supplies /dev/null as its plugin directory; a game loading during the removal window can also miss the plugin. On GNOME it then has no title bar or its controls.

Do: Use a stable per-launch directory or publish a prepared link atomically without removing the link another launch may be using.

**L2** (should fix): Every launch removes and recreates the same shared link without coordinating with other launches or games already starting. *When:* When two launches overlap, one can create the link between the other’s remove_file and symlink calls. The second receives EEXIST and supplies /dev/null as its plugin directory; a game loading during the removal window can also miss the plugin. On GNOME it then has no title bar or its controls. **Do:** Use a stable per-launch directory or publish a prepared link atomically without removing the link another launch may be using.
@ -608,6 +661,7 @@ pub fn rules(input: &Input, handled: u64) -> (Vec<Rule>, usize) {
}
r.add_p(i.tmp.as_deref(), RW, "the private temporary folder (TMPDIR)");
r.add_in(i.xdg_data_home.as_deref(), b"longshot/ngx", RX, "DLSS's runtime");
r.add_in(i.xdg_data_home.as_deref(), LIBDECOR_DIR.as_bytes(), RO, "the title bar's plugin (libdecor_plugins)");
Member

L1 (blocking): The new Landlock rule follows a pre-existing symlink for the plugin directory and can grant read access to an unrelated directory.

When: If ~/.local/share/longshot/libdecor points to the user’s home, create_dir_all accepts it and the rule applier opens that path following the link. The resulting read rule covers the home, so the confined game can read files the sandbox otherwise keeps private.

Do: Create and validate a dedicated plugin directory without following an existing directory symlink, and reject any resolved location outside the intended private directory before adding the rule.

**L1** (blocking): The new Landlock rule follows a pre-existing symlink for the plugin directory and can grant read access to an unrelated directory. *When:* If ~/.local/share/longshot/libdecor points to the user’s home, create_dir_all accepts it and the rule applier opens that path following the link. The resulting read rule covers the home, so the confined game can read files the sandbox otherwise keeps private. **Do:** Create and validate a dedicated plugin directory without following an existing directory symlink, and reject any resolved location outside the intended private directory before adding the rule.
@ -209,2 +209,4 @@
// (the pads the builder's, the Steam Deck's own sensors with them: every start, confined or not)
let mut pads = crate::sandbox_linux::pads_slot(cmd);
// (a sandboxed game's title bar plugin, before the rules that let it be read are made)
crate::sandbox_linux::libdecor_plugins(cmd);
Member

L6 (should fix): The changed launch path has not been exercised in the game on the affected desktop or the other Wayland paths it changes.

When: The reported SDL2 experiment omitted Landlock and did not execute this builder code, so it cannot show that the game loads the plugin and retains usable decorations.

Do: Run the game on the reported GNOME/glycin setup and check startup, moving, resizing and closing; also check windowed launches on KDE and sway.

**L6** (should fix): The changed launch path has not been exercised in the game on the affected desktop or the other Wayland paths it changes. *When:* The reported SDL2 experiment omitted Landlock and did not execute this builder code, so it cannot show that the game loads the plugin and retains usable decorations. **Do:** Run the game on the reported GNOME/glycin setup and check startup, moving, resizing and closing; also check windowed launches on KDE and sway.
HumanBean force-pushed fix/gnome-libdecor-abort from 45ab086310
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
to 026fe6e668
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
2026-12-03 21:00:49 +00:00
Compare
Author
Owner

Review addressed (old head 45ab0863). None of this is compiled or tested yet; the tests and clippy are waiting in the job queue.

  • L1: the plugin folder must be a folder of its own, not a link, both to be handed to the game and to get a read rule (own_folder).
  • L2: the link is changed only when its target differs, and then by a rename over it.
  • L3: the plugin is looked for beside the libdecor-0.so.0 the system loads, whatever its prefix, then in the listed folders. With none found the folder stays empty on purpose: no title bar rather than GTK's abort.
  • L4: a folder holding any other .so is not given.
  • L5: a relative XDG_DATA_HOME (or HOME) is ignored.
  • L6: still open. A short game start on sway with client-side decorations forced is planned once the tests pass; GNOME needs someone who has it.
  • Question on the test: it now fails when /usr/lib has the Cairo plugin and the folder lacks it.
Review addressed (old head 45ab0863). **None of this is compiled or tested yet**; the tests and clippy are waiting in the job queue. - **L1:** the plugin folder must be a folder of its own, not a link, both to be handed to the game and to get a read rule (`own_folder`). - **L2:** the link is changed only when its target differs, and then by a rename over it. - **L3:** the plugin is looked for beside the `libdecor-0.so.0` the system loads, whatever its prefix, then in the listed folders. With none found the folder stays empty on purpose: no title bar rather than GTK's abort. - **L4:** a folder holding any other `.so` is not given. - **L5:** a relative `XDG_DATA_HOME` (or `HOME`) is ignored. - **L6:** still open. A short game start on sway with client-side decorations forced is planned once the tests pass; GNOME needs someone who has it. - **Question on the test:** it now fails when `/usr/lib` has the Cairo plugin and the folder lacks it.
Author
Owner
@review
BeanBot requested changes 2026-12-03 21:02:59 +00:00
Dismissed
BeanBot left a comment

Recommendation: Request changes. The new sandbox rule can expose an unrelated directory through a symlinked parent, and the new unsafe code conflicts with the repository's stated Rust rule. Plugin discovery still misses valid installations outside its assumed layouts.

The change gives sandboxed Linux games a Cairo-only libdecor plugin directory to avoid GTK's glycin-related abort while retaining window decorations. It adds plugin discovery and sandbox rules, with fallback cases that can remove the title bar.

Blocking (2): must change before merging.

  1. L3 builder/crates/build-core/src/sandbox_linux.rs:322: The new unsafe allowance is outside the locations permitted by the builder's documented Rust rule. When: cairo_plugin permits unsafe code in sandbox_linux.rs, while docs/dev/standards.md permits it only in the named Windows and disk system-call modules. Do: Use an allowed safe interface or place the system calls in a location permitted by the repository rule.
  2. L7 builder/crates/build-core/src/sandbox_linux.rs:1403: Checking only the final directory does not prevent a symlinked parent from redirecting the new read rule. (more on the line) Do: Validate or securely resolve the path components before granting the rule, and reject redirected paths outside the intended data directory.

Testing before merging (1) (runs on the systems it can change; it doesn't hold the recommendation)

  • L6 builder/crates/build-core/src/sys.rs:212: The changed launch path has not been exercised in the game on the affected desktop or the other Wayland paths it changes. When: The reported SDL2 experiment omitted Landlock and did not execute this builder code, so it cannot show that the game loads the plugin and retains usable decorations. Do: Run the game on the reported GNOME/glycin setup and check startup, moving, resizing and closing; also check windowed launches on KDE and sway.

@fix can do L3 and L7.

Since the last review (on 45ab086310)
Resolved: L1 (The new Landlock rule follows a pre-existing symlink for the plugin directory and can gran…); L2 (Every launch removes and recreates the same shared link without coordinating with other la…); L4 (The directory is reused without removing or rejecting other plugins, so it is not necessar…); L5 (A relative XDG_DATA_HOME is used directly even though the child can have a different worki…)
Still open: L3 (The new unsafe allowance is outside the locations permitted by the builder's documented Ru…); L6 (The changed launch path has not been exercised in the game on the affected desktop or the…)
New: L7 (Checking only the final directory does not prevent a symlinked parent from redirecting the…)

Checks: Still running: 11 checks.

More: does it help, other systems, switches, what was read

Does it help: Unproven: a separate SDL2 window survived with the Cairo plugin under seccomp, but the changed Rust and the game have not been run on the affected desktop.

Other systems: The launch path affects sandboxed Linux games on GNOME, KDE, sway and other desktops, including Steam Deck; game runs are still needed. Windows does not use this Linux-specific path.

Switches: No Longshot switch added or changed. HOS_SANDBOX=0 and an existing LIBDECOR_PLUGIN_DIR are preserved; otherwise the builder sets LIBDECOR_PLUGIN_DIR for sandboxed games.

Reviewed: 026fe6e668 against 76092c5e5a: Read the repository rules and PR template, the change and commit history, and relevant sandbox and launch code. The long sandbox file and reference documentation were partly skimmed; the game and tests were not run.; nothing run (a code review).

Checked and fine:

  • A player's explicit LIBDECOR_PLUGIN_DIR and HOS_SANDBOX=0 are left alone.
  • The directory rejects other .so plugins and relative data paths.
  • The changed link is replaced by rename rather than removed on every ordinary launch.

Testing: No commands from the project were run. The author reports a separate headless SDL2 experiment; the Rust checks, game runs and CI remain pending.

Overlaps and merge order: Not checked; network access is unavailable.


Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.

**Recommendation: Request changes.** The new sandbox rule can expose an unrelated directory through a symlinked parent, and the new unsafe code conflicts with the repository's stated Rust rule. Plugin discovery still misses valid installations outside its assumed layouts. The change gives sandboxed Linux games a Cairo-only libdecor plugin directory to avoid GTK's glycin-related abort while retaining window decorations. It adds plugin discovery and sandbox rules, with fallback cases that can remove the title bar. **Blocking (2)**: must change before merging. 1. **L3** `builder/crates/build-core/src/sandbox_linux.rs:322`: The new unsafe allowance is outside the locations permitted by the builder's documented Rust rule. *When:* cairo_plugin permits unsafe code in sandbox_linux.rs, while docs/dev/standards.md permits it only in the named Windows and disk system-call modules. **Do:** Use an allowed safe interface or place the system calls in a location permitted by the repository rule. 2. **L7** `builder/crates/build-core/src/sandbox_linux.rs:1403`: Checking only the final directory does not prevent a symlinked parent from redirecting the new read rule. (more on the line) **Do:** Validate or securely resolve the path components before granting the rule, and reject redirected paths outside the intended data directory. **Testing before merging (1)** (runs on the systems it can change; it doesn't hold the recommendation) - **L6** `builder/crates/build-core/src/sys.rs:212`: The changed launch path has not been exercised in the game on the affected desktop or the other Wayland paths it changes. *When:* The reported SDL2 experiment omitted Landlock and did not execute this builder code, so it cannot show that the game loads the plugin and retains usable decorations. **Do:** Run the game on the reported GNOME/glycin setup and check startup, moving, resizing and closing; also check windowed launches on KDE and sway. `@fix` can do L3 and L7. **Since the last review** (on 45ab086310db) Resolved: L1 (The new Landlock rule follows a pre-existing symlink for the plugin directory and can gran…); L2 (Every launch removes and recreates the same shared link without coordinating with other la…); L4 (The directory is reused without removing or rejecting other plugins, so it is not necessar…); L5 (A relative XDG_DATA_HOME is used directly even though the child can have a different worki…) Still open: L3 (The new unsafe allowance is outside the locations permitted by the builder's documented Ru…); L6 (The changed launch path has not been exercised in the game on the affected desktop or the…) New: L7 (Checking only the final directory does not prevent a symlinked parent from redirecting the…) **Checks:** Still running: 11 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven: a separate SDL2 window survived with the Cairo plugin under seccomp, but the changed Rust and the game have not been run on the affected desktop. **Other systems:** The launch path affects sandboxed Linux games on GNOME, KDE, sway and other desktops, including Steam Deck; game runs are still needed. Windows does not use this Linux-specific path. **Switches:** No Longshot switch added or changed. HOS_SANDBOX=0 and an existing LIBDECOR_PLUGIN_DIR are preserved; otherwise the builder sets LIBDECOR_PLUGIN_DIR for sandboxed games. **Reviewed:** 026fe6e6689d against 76092c5e5a3b: Read the repository rules and PR template, the change and commit history, and relevant sandbox and launch code. The long sandbox file and reference documentation were partly skimmed; the game and tests were not run.; nothing run (a code review). **Checked and fine:** - A player's explicit LIBDECOR_PLUGIN_DIR and HOS_SANDBOX=0 are left alone. - The directory rejects other .so plugins and relative data paths. - The changed link is replaced by rename rather than removed on every ordinary launch. **Testing:** No commands from the project were run. The author reports a separate headless SDL2 experiment; the Rust checks, game runs and CI remain pending. **Overlaps and merge order:** Not checked; network access is unavailable. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
@ -1279,6 +1400,7 @@ pub fn gather(
i.xdg_data_home = var(env, "XDG_DATA_HOME").map(PathBuf::from).or_else(|| under_home(".local/share"));
i.xdg_config_home = var(env, "XDG_CONFIG_HOME").map(PathBuf::from).or_else(|| under_home(".config"));
i.xdg_runtime_dir = var(env, "XDG_RUNTIME_DIR").map(PathBuf::from);
i.title_bar_dir = libdecor_dir(env).filter(|d| own_folder(d));
Member

L7 (blocking): Checking only the final directory does not prevent a symlinked parent from redirecting the new read rule.

When: If the data directory's longshot component is a symlink to another location containing a real libdecor directory, own_folder accepts that final directory and rules grants the game read access to its unrelated contents.

Do: Validate or securely resolve the path components before granting the rule, and reject redirected paths outside the intended data directory.

**L7** (blocking): Checking only the final directory does not prevent a symlinked parent from redirecting the new read rule. *When:* If the data directory's longshot component is a symlink to another location containing a real libdecor directory, own_folder accepts that final directory and rules grants the game read access to its unrelated contents. **Do:** Validate or securely resolve the path components before granting the rule, and reject redirected paths outside the intended data directory.
Author
Owner

Tests at 026fe6e6 (Linux): the new test fails on the test commit for the bug's reason (no plugin folder) and passes with the fix; build-core: 221 passed, 0 failed, 1 ignored. Clippy not run locally (not installed on that PC); CI runs it. Still no game run.

Tests at 026fe6e6 (Linux): the new test fails on the test commit for the bug's reason (no plugin folder) and passes with the fix; build-core: 221 passed, 0 failed, 1 ignored. Clippy not run locally (not installed on that PC); CI runs it. Still no game run.
Author
Owner

L3 and L7 addressed at 935397f4 (old head 026fe6e6).

  • L3: no unsafe: libdecor's folder now comes from ldconfig -p (64-bit entries), then the listed folders. A system whose loader list does not name it (NixOS) and keeps the plugin elsewhere gets no title bar, on purpose: GTK would abort.
  • L7: the folder is written to, and given a read rule, only when it is a real folder holding nothing but the builder's own links (holds_only_ours). A symlinked parent therefore shows the game no file of anyone else's, and a symlinked data folder still works.
  • L6: still open, no game run yet.

Linux: build-core 222 passed, 0 failed, 1 ignored. Clippy left to CI.

L3 and L7 addressed at 935397f4 (old head 026fe6e6). - **L3:** no `unsafe`: libdecor's folder now comes from `ldconfig -p` (64-bit entries), then the listed folders. A system whose loader list does not name it (NixOS) and keeps the plugin elsewhere gets no title bar, on purpose: GTK would abort. - **L7:** the folder is written to, and given a read rule, only when it is a real folder holding nothing but the builder's own links (`holds_only_ours`). A symlinked parent therefore shows the game no file of anyone else's, and a symlinked data folder still works. - **L6:** still open, no game run yet. Linux: `build-core` 222 passed, 0 failed, 1 ignored. Clippy left to CI.
HumanBean force-pushed fix/gnome-libdecor-abort from 026fe6e668
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
to 935397f47b
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
2026-12-03 23:34:03 +00:00
Compare
Author
Owner
@review
BeanBot requested changes 2026-12-03 23:36:48 +00:00
Dismissed
BeanBot left a comment

Recommendation: Request changes. The new read rule can still be redirected to a player's directory through a symlinked parent. The affected game and desktop paths also still need the requested runs.

The builder selects libdecor's Cairo plugin for sandboxed games, aiming to prevent GTK from aborting while retaining window decorations. The approach avoids the previous unsafe code, but the directory check does not safely bound the new read grant.

Blocking (1): must change before merging.

  1. L7 builder/crates/build-core/src/sandbox_linux.rs:1403: Checking only the final directory does not prevent a symlinked parent from redirecting the new read rule. When: If the data directory's longshot component is a symlink to another location containing a real libdecor directory, own_folder accepts that final directory and rules grants the game read access to its unrelated contents. Do: Validate or securely resolve the path components before granting the rule, and reject redirected paths outside the intended data directory.

Testing before merging (1) (runs on the systems it can change; it doesn't hold the recommendation)

  • L6 builder/crates/build-core/src/sys.rs:212: The changed launch path has not been exercised in the game on the affected desktop or the other Wayland paths it changes. When: The reported SDL2 experiment omitted Landlock and did not execute this builder code, so it cannot show that the game loads the plugin and retains usable decorations. Do: Run the game on the reported GNOME/glycin setup and check startup, moving, resizing and closing; also check windowed launches on KDE and sway.

@fix can do L7.

Since the last review (on 026fe6e668)
Resolved: L3 (The new unsafe allowance is outside the locations permitted by the builder's documented Ru…)
Still open: L6 (The changed launch path has not been exercised in the game on the affected desktop or the…); L7 (Checking only the final directory does not prevent a symlinked parent from redirecting the…)

Checks: Still running: 11 checks.

Also noticed (1; not asked for, not blocking)
  • A redirected directory containing an unrelated symlink named libdecor-cairo.so can have that link replaced or removed by cairo_alone.
More: does it help, other systems, switches, what was read

Does it help: Unproven in the game: the author reports a headless SDL2 window survived with Cairo and reproduced the abort with the normal plugin folder, but has not run the game on an affected desktop.

Other systems: The Linux launch path changes for sandboxed games on GNOME, KDE and sway, including systems without Landlock; game runs on those desktops remain outstanding. Windows does not compile this Linux-only path.

Switches: No switches added or changed. HOS_SANDBOX=0 and an existing LIBDECOR_PLUGIN_DIR are left alone.

Reviewed: 935397f47b against 76092c5e5a: Read AGENTS.md, CONTRIBUTING.md, the pull request template, the diff and commits, the changed launch and sandbox code, and the sandbox documentation; the large source and documentation output was partly skimmed. docs/review-checklist.md is absent, and the referenced sibling Tooling checkout is unavailable.; nothing run (a code review).

Checked and fine:

  • The player's LIBDECOR_PLUGIN_DIR and sandbox-off launches are preserved.
  • The author reports the game-free test fails before the fix and passes at this head.

Testing: No commands from the project or tests were run. The author reports 222 build-core tests passed on Linux and a game-free SDL2 demonstration; CI is still running.

Overlaps and merge order: Unknown; the network is closed.


Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.

**Recommendation: Request changes.** The new read rule can still be redirected to a player's directory through a symlinked parent. The affected game and desktop paths also still need the requested runs. The builder selects libdecor's Cairo plugin for sandboxed games, aiming to prevent GTK from aborting while retaining window decorations. The approach avoids the previous unsafe code, but the directory check does not safely bound the new read grant. **Blocking (1)**: must change before merging. 1. **L7** `builder/crates/build-core/src/sandbox_linux.rs:1403`: Checking only the final directory does not prevent a symlinked parent from redirecting the new read rule. *When:* If the data directory's longshot component is a symlink to another location containing a real libdecor directory, own_folder accepts that final directory and rules grants the game read access to its unrelated contents. **Do:** Validate or securely resolve the path components before granting the rule, and reject redirected paths outside the intended data directory. **Testing before merging (1)** (runs on the systems it can change; it doesn't hold the recommendation) - **L6** `builder/crates/build-core/src/sys.rs:212`: The changed launch path has not been exercised in the game on the affected desktop or the other Wayland paths it changes. *When:* The reported SDL2 experiment omitted Landlock and did not execute this builder code, so it cannot show that the game loads the plugin and retains usable decorations. **Do:** Run the game on the reported GNOME/glycin setup and check startup, moving, resizing and closing; also check windowed launches on KDE and sway. `@fix` can do L7. **Since the last review** (on 026fe6e6689d) Resolved: L3 (The new unsafe allowance is outside the locations permitted by the builder's documented Ru…) Still open: L6 (The changed launch path has not been exercised in the game on the affected desktop or the…); L7 (Checking only the final directory does not prevent a symlinked parent from redirecting the…) **Checks:** Still running: 11 checks. <details> <summary>Also noticed (1; not asked for, not blocking)</summary> - A redirected directory containing an unrelated symlink named libdecor-cairo.so can have that link replaced or removed by cairo_alone. </details> <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven in the game: the author reports a headless SDL2 window survived with Cairo and reproduced the abort with the normal plugin folder, but has not run the game on an affected desktop. **Other systems:** The Linux launch path changes for sandboxed games on GNOME, KDE and sway, including systems without Landlock; game runs on those desktops remain outstanding. Windows does not compile this Linux-only path. **Switches:** No switches added or changed. HOS_SANDBOX=0 and an existing LIBDECOR_PLUGIN_DIR are left alone. **Reviewed:** 935397f47ba3 against 76092c5e5a3b: Read AGENTS.md, CONTRIBUTING.md, the pull request template, the diff and commits, the changed launch and sandbox code, and the sandbox documentation; the large source and documentation output was partly skimmed. docs/review-checklist.md is absent, and the referenced sibling Tooling checkout is unavailable.; nothing run (a code review). **Checked and fine:** - The player's LIBDECOR_PLUGIN_DIR and sandbox-off launches are preserved. - The author reports the game-free test fails before the fix and passes at this head. **Testing:** No commands from the project or tests were run. The author reports 222 build-core tests passed on Linux and a game-free SDL2 demonstration; CI is still running. **Overlaps and merge order:** Unknown; the network is closed. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
HumanBean force-pushed fix/gnome-libdecor-abort from 935397f47b
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
to 5f4c4d5329
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
2026-12-03 23:37:58 +00:00
Compare
Author
Owner

L7 addressed at 5f4c4d53 (old head 935397f4): the plugin folder is now ~/.local/share/longshot-libdecor, directly in the data folder, so there is no folder between that could be a link redirecting the read rule. The leaf itself must still be a real folder holding only the builder's links, which also covers the note about an unrelated libdecor-cairo.so link. build-core on Linux: 222 passed, 0 failed, 1 ignored. L6 (a game run) is still open.

L7 addressed at 5f4c4d53 (old head 935397f4): the plugin folder is now ~/.local/share/longshot-libdecor, directly in the data folder, so there is no folder between that could be a link redirecting the read rule. The leaf itself must still be a real folder holding only the builder's links, which also covers the note about an unrelated libdecor-cairo.so link. build-core on Linux: 222 passed, 0 failed, 1 ignored. L6 (a game run) is still open.
Author
Owner
@review
BeanBot left a comment

Recommendation: Request changes. The title-bar folder can still be redirected through a symlinked parent, exposing files subsequently placed there to the sandboxed game. The game also still needs testing on the affected Wayland desktops.

The builder selects libdecor’s Cairo plugin for sandboxed games, aiming to prevent GTK’s icon loader from aborting on GNOME while retaining a title bar. It adds startup filesystem work and a read rule; the parent-path check remains incomplete.

Blocking (2): must change before merging.

  1. L7 builder/crates/build-core/src/sandbox_linux.rs:1403: Checking only the final directory does not prevent a symlinked parent from redirecting the new read rule. When: If the data directory's longshot component is a symlink to another location containing a real libdecor directory, own_folder accepts that final directory and rules grants the game read access to its unrelated contents. Do: Validate or securely resolve the path components before granting the rule, and reject redirected paths outside the intended data directory.
  2. L8: It conflicts with its base branch: bring it up to date (@​fix or @​rebase try first). (for the author)

Testing before merging (1) (runs on the systems it can change; it doesn't hold the recommendation)

  • L6 builder/crates/build-core/src/sys.rs:212: The changed launch path has not been exercised in the game on the affected desktop or the other Wayland paths it changes. When: The reported SDL2 experiment omitted Landlock and did not execute this builder code, so it cannot show that the game loads the plugin and retains usable decorations. Do: Run the game on the reported GNOME/glycin setup and check startup, moving, resizing and closing; also check windowed launches on KDE and sway.

@fix can do L7.

Since the last review (on 935397f47b)
Still open: L6 (The changed launch path has not been exercised in the game on the affected desktop or the…); L7 (Checking only the final directory does not prevent a symlinked parent from redirecting the…)
New: L8 (It conflicts with its base branch: bring it up to date (@​fix or @​rebase try first).)

Checks: Still running: 11 checks.

More: does it help, other systems, switches, what was read

Does it help: Unproven: a headless SDL2 window survived with the Cairo plugin alone, but the changed launch path has not been tested in the game on GNOME Wayland.

Other systems: The selection also affects KDE Wayland and sway; neither has been tested in the game. Windows does not run the Linux-only path. Systems without a discovered Cairo plugin can lose client-side decorations.

Switches: No switches added or changed. Existing HOS_SANDBOX=0 and a user-provided LIBDECOR_PLUGIN_DIR are left alone.

Reviewed: 5f4c4d5329 against 76092c5e5a: Read the full PR diff, commit list, changes since the ledger head, AGENTS.md, CONTRIBUTING.md and the pull request template. Inspected the changed sandbox and launch-path excerpts and tests; the full changed code files and their surrounding callers were not read in full.; nothing run (a code review).

Checked and fine:

  • The leaf plugin directory itself must be a real directory and contain only permitted symlink names before it receives the read rule.
  • The sandbox-off and user-provided LIBDECOR_PLUGIN_DIR paths remain untouched.

Testing: The author reports 222 build-core tests passed and a headless sway SDL2 reproduction and workaround; no game run has been reported. CI is still running. No commands from the project were run for this review.

Overlaps and merge order: Unknown; network access is closed.


Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.

**Recommendation: Request changes.** The title-bar folder can still be redirected through a symlinked parent, exposing files subsequently placed there to the sandboxed game. The game also still needs testing on the affected Wayland desktops. The builder selects libdecor’s Cairo plugin for sandboxed games, aiming to prevent GTK’s icon loader from aborting on GNOME while retaining a title bar. It adds startup filesystem work and a read rule; the parent-path check remains incomplete. **Blocking (2)**: must change before merging. 1. **L7** `builder/crates/build-core/src/sandbox_linux.rs:1403`: Checking only the final directory does not prevent a symlinked parent from redirecting the new read rule. *When:* If the data directory's longshot component is a symlink to another location containing a real libdecor directory, own_folder accepts that final directory and rules grants the game read access to its unrelated contents. **Do:** Validate or securely resolve the path components before granting the rule, and reject redirected paths outside the intended data directory. 2. **L8**: It conflicts with its base branch: bring it up to date (`@​fix` or `@​rebase` try first). *(for the author)* **Testing before merging (1)** (runs on the systems it can change; it doesn't hold the recommendation) - **L6** `builder/crates/build-core/src/sys.rs:212`: The changed launch path has not been exercised in the game on the affected desktop or the other Wayland paths it changes. *When:* The reported SDL2 experiment omitted Landlock and did not execute this builder code, so it cannot show that the game loads the plugin and retains usable decorations. **Do:** Run the game on the reported GNOME/glycin setup and check startup, moving, resizing and closing; also check windowed launches on KDE and sway. `@fix` can do L7. **Since the last review** (on 935397f47ba3) Still open: L6 (The changed launch path has not been exercised in the game on the affected desktop or the…); L7 (Checking only the final directory does not prevent a symlinked parent from redirecting the…) New: L8 (It conflicts with its base branch: bring it up to date (`@​fix` or `@​rebase` try first).) **Checks:** Still running: 11 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven: a headless SDL2 window survived with the Cairo plugin alone, but the changed launch path has not been tested in the game on GNOME Wayland. **Other systems:** The selection also affects KDE Wayland and sway; neither has been tested in the game. Windows does not run the Linux-only path. Systems without a discovered Cairo plugin can lose client-side decorations. **Switches:** No switches added or changed. Existing HOS_SANDBOX=0 and a user-provided LIBDECOR_PLUGIN_DIR are left alone. **Reviewed:** 5f4c4d532970 against 76092c5e5a3b: Read the full PR diff, commit list, changes since the ledger head, AGENTS.md, CONTRIBUTING.md and the pull request template. Inspected the changed sandbox and launch-path excerpts and tests; the full changed code files and their surrounding callers were not read in full.; nothing run (a code review). **Checked and fine:** - The leaf plugin directory itself must be a real directory and contain only permitted symlink names before it receives the read rule. - The sandbox-off and user-provided LIBDECOR_PLUGIN_DIR paths remain untouched. **Testing:** The author reports 222 build-core tests passed and a headless sway SDL2 reproduction and workaround; no game run has been reported. CI is still running. No commands from the project were run for this review. **Overlaps and merge order:** Unknown; network access is closed. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
HumanBean force-pushed fix/gnome-libdecor-abort from 5f4c4d5329
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
to 4abfe890a9
Some checks failed
CI / What the change needs (pull_request) Successful in 8s
CI / Third-party parts and guide screenshots (pull_request) Successful in 11s
PR description / Title and description (pull_request_target) Failing after 5s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Successful in 15s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Failing after 1m24s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Failing after 12m46s
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Successful in 16m35s
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Successful in 15m51s
CI / Website build and checks (pull_request) Failing after 1m2s
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Failing after 13m50s
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Failing after 50m57s
2026-12-03 23:46:40 +00:00
Compare
Author
Owner

Rebased on main and pushed as 4abfe890 (old head 5f4c4d53).

  • L7: the game is now given only a listing right on the plugin folder (FS_READ_DIR), no right to read any file in it. The plugin is a link into the system's folders, read by their own rule. So wherever a link above the folder leads, and whatever is put there later, no file in it is opened up by this rule. A new test checks that, and the confined-run test now reads the plugin through the link.
  • L8: rebased; the one conflict was a doc comment beside #3132's change.
  • #3132 turned the sandbox off by default; the description now says when this fix applies.
  • L6: still open, no game run.

Linux, rebased: the new test fails on the test commit; with the fix build-core 224 passed, 0 failed, 1 ignored, three runs. One earlier run failed lock::tests::one_copy_per_profile_among_threads_and_other_profiles_at_once (a file this PR does not touch); it passed in the three that followed, and in three on plain main.

Rebased on main and pushed as 4abfe890 (old head 5f4c4d53). - **L7:** the game is now given only a **listing** right on the plugin folder (`FS_READ_DIR`), no right to read any file in it. The plugin is a link into the system's folders, read by their own rule. So wherever a link above the folder leads, and whatever is put there later, no file in it is opened up by this rule. A new test checks that, and the confined-run test now reads the plugin through the link. - **L8:** rebased; the one conflict was a doc comment beside #3132's change. - #3132 turned the sandbox off by default; the description now says when this fix applies. - **L6:** still open, no game run. Linux, rebased: the new test fails on the test commit; with the fix `build-core` 224 passed, 0 failed, 1 ignored, three runs. One earlier run failed `lock::tests::one_copy_per_profile_among_threads_and_other_profiles_at_once` (a file this PR does not touch); it passed in the three that followed, and in three on plain main.
Author
Owner
@review
BeanBot left a comment

Recommendation: Approve. The code is ready: only testing is left. The listing-only rule addresses the redirected-directory read exposure, and the branch is rebased on the supplied base. The game launch path still needs to be exercised on GNOME, KDE and sway before the fix is ready to merge. Recommend approval; not approved on the forge.

Sandboxed games select libdecor’s Cairo plugin to avoid GTK’s loader abort while retaining a plain title bar where Cairo is available. The cost is a different-looking title bar and, on systems where the plugin cannot be found, no title bar.

Testing before merging (1) (runs on the systems it can change; it doesn't hold the recommendation)

  • L6 builder/crates/build-core/src/sys.rs:212: The changed launch path has not been exercised in the game on the affected desktop or the other Wayland paths it changes. When: The reported SDL2 experiment omitted Landlock and did not execute this builder code, so it cannot show that the game loads the plugin and retains usable decorations. Do: Run the game on the reported GNOME/glycin setup and check startup, moving, resizing and closing; also check windowed launches on KDE and sway.

Since the last review (on 5f4c4d5329)
Resolved: L7 (Checking only the final directory does not prevent a symlinked parent from redirecting the…); L8 (It conflicts with its base branch: bring it up to date (@​fix or @​rebase try first).)
Still open: L6 (The changed launch path has not been exercised in the game on the affected desktop or the…)

Checks: Still running: 11 checks.

More: does it help, other systems, switches, what was read

Does it help: Unproven in the game. The author reports that a headless SDL2 window survives with the Cairo-only folder where the GTK plugin aborts, and that the game-free test fails before the fix and passes after it.

Other systems: The launch path changes sandboxed Linux games on GNOME, KDE and sway; none has had a game run reported. Windows is unaffected by the Linux-only path. The plugin must remain readable through an existing system rule.

Switches: No switch added or changed. Existing HOS_SANDBOX defaults to off; an existing LIBDECOR_PLUGIN_DIR is preserved.

Reviewed: 4abfe890a9 against 0a68a1dea8: Read AGENTS.md, CONTRIBUTING.md, the pull request template, the full PR diff, the prior diff and commit list; inspected the changed sandbox and launch paths and tests. The sandbox source output was truncated, so the entire file was not read; recorded runs and documentation were skimmed.; nothing run (a code review).

Checked and fine:

  • The new test reads the plugin through its link, and the rule test checks that files placed in the directory do not receive read permission.
  • The sandbox-off path and a player-provided plugin directory remain unchanged.

Testing: No commands that build or run the project were executed. The author reports 224 build-core tests passed, one ignored, and a headless SDL2 reproduction; CI is still running.

Overlaps and merge order: None found in the supplied information.


Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.

**Recommendation: Approve.** The code is ready: only testing is left. The listing-only rule addresses the redirected-directory read exposure, and the branch is rebased on the supplied base. The game launch path still needs to be exercised on GNOME, KDE and sway before the fix is ready to merge. Recommend approval; not approved on the forge. Sandboxed games select libdecor’s Cairo plugin to avoid GTK’s loader abort while retaining a plain title bar where Cairo is available. The cost is a different-looking title bar and, on systems where the plugin cannot be found, no title bar. **Testing before merging (1)** (runs on the systems it can change; it doesn't hold the recommendation) - **L6** `builder/crates/build-core/src/sys.rs:212`: The changed launch path has not been exercised in the game on the affected desktop or the other Wayland paths it changes. *When:* The reported SDL2 experiment omitted Landlock and did not execute this builder code, so it cannot show that the game loads the plugin and retains usable decorations. **Do:** Run the game on the reported GNOME/glycin setup and check startup, moving, resizing and closing; also check windowed launches on KDE and sway. **Since the last review** (on 5f4c4d532970) Resolved: L7 (Checking only the final directory does not prevent a symlinked parent from redirecting the…); L8 (It conflicts with its base branch: bring it up to date (`@​fix` or `@​rebase` try first).) Still open: L6 (The changed launch path has not been exercised in the game on the affected desktop or the…) **Checks:** Still running: 11 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven in the game. The author reports that a headless SDL2 window survives with the Cairo-only folder where the GTK plugin aborts, and that the game-free test fails before the fix and passes after it. **Other systems:** The launch path changes sandboxed Linux games on GNOME, KDE and sway; none has had a game run reported. Windows is unaffected by the Linux-only path. The plugin must remain readable through an existing system rule. **Switches:** No switch added or changed. Existing HOS_SANDBOX defaults to off; an existing LIBDECOR_PLUGIN_DIR is preserved. **Reviewed:** 4abfe890a917 against 0a68a1dea88d: Read AGENTS.md, CONTRIBUTING.md, the pull request template, the full PR diff, the prior diff and commit list; inspected the changed sandbox and launch paths and tests. The sandbox source output was truncated, so the entire file was not read; recorded runs and documentation were skimmed.; nothing run (a code review). **Checked and fine:** - The new test reads the plugin through its link, and the rule test checks that files placed in the directory do not receive read permission. - The sandbox-off path and a player-provided plugin directory remain unchanged. **Testing:** No commands that build or run the project were executed. The author reports 224 build-core tests passed, one ignored, and a headless SDL2 reproduction; CI is still running. **Overlaps and merge order:** None found in the supplied information. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
HumanBean changed title from WIP: fix(sandbox): the title bar on GNOME is libdecor's Cairo plugin, so GTK no longer aborts the game to fix(sandbox): the title bar on GNOME is libdecor's Cairo plugin, so GTK no longer aborts the game 2026-12-03 23:51:38 +00:00
HumanBean deleted branch fix/gnome-libdecor-abort 2026-12-03 23:51:46 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!3106
No description provided.