Repository navigation
fix: set the sandbox helper Chromium actually reads setuid - #587
Merged
Merged
Conversation
Chromium looks for chrome-sandbox in cef/, beside libcef.so, not beside lich-shell. The deb, rpm and AUR packages installed a root-owned 4755 copy beside lich-shell and left the one in cef/ at 755, so on a desktop that denies unprivileged user namespaces (Ubuntu's AppArmor policy) Chromium found an unusable helper and aborted the window with SIGTRAP. nfpm cannot mark a file inside the window's tree setuid: a second entry for the same destination collides, and the archlinux packager drops a setuid bit read from the source file. The mode is set from the install script instead, wired to post_upgrade for pacman too. The AUR PKGBUILD chmods the copy in cef/, and lich-shell's --no-sandbox decision checks that same file.
…side-libcef # Conflicts: # CHANGELOG.md
This was referenced Sep 11, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A user's lich 0.49.0 on Ubuntu opened no window: every launch ended in
signal: trace/breakpoint trap (core dumped)about a second in. Chromium looks for its setuid sandbox helper incef/, besidelibcef.so, not besidelich-shell. The deb, rpm and AUR packages installed a root-owned 4755 copy besidelich-shelland left the one incef/at 755, so on a desktop that denies unprivileged user namespaces (Ubuntu's AppArmor policy) Chromium fell back to the helper, found it unusable and aborted.chmod 4755oncef/chrome-sandboxis what got that user's window open.Which file Chromium reads
Measured without AppArmor by forcing the fallback:
lich-shell --ozone-platform=headless --disable-namespace-sandboxon the installed AUR package exits 133, and the FATAL reads "You need to make sure that /usr/lib/lich/shell/cef/chrome-sandbox is owned by root and has mode 4755", with a root 4755 copy sitting besidelich-shellthe whole time.Packaging
nfpm cannot mark one file of the window's tree setuid: a second
contentsentry forcef/chrome-sandboxfails withcontent collision, and the archlinux packager drops a setuid bit read from the source file (it writesint64(fs.FileMode), and Go keeps setuid outside the Unix permission bits). The mode now comes frompostinstall.sh; pacman runs that only on a first install, so it is wired toarchlinux.scripts.postupgradeas well. The stray copy is gone from all three formats, and the package managers remove it on upgrade. The trade-off, written into the ceiling:rpm -Vandpacman -Qkkreport a mode mismatch on the helper.The AUR
package()chmods the copy incef/instead of installing a second one.lich-shell
sandbox_available()checked the helper beside the executable, so it could count a machine as sandboxed when its only usable helper was one Chromium never reads. It now checkscef/chrome-sandbox, pinned by a test.Not in this PR, each on its own branch: the user-namespace probe only tries
unshare, which Ubuntu's AppArmor allows before denying the id maps, so a tarball install on Ubuntu still skips--no-sandbox; and the window's stderr, where this FATAL was printed, never reacheslich.logorlich rage.Test plan
cargo fmt --check,cargo clippy --release --all-targets -- -D warningsandcargo test --release(13 passed) inshell/mainand from this branch around stub binaries, installed in containers with dpkg (Debian 12), rpm (Fedora 42) and pacman (Arch).main:chrome-sandbox4755 andcef/chrome-sandbox755. Upgrade to this branch: stray copy removed,cef/chrome-sandbox4755 root. Fresh install: 4755 rootpackage()under fakeroot:cef/chrome-sandboxis-rwsr-xr-x root rootin the archiveinstall.shon clean Debian 12, Fedora 42 and Arch containers installs the v0.49.0 window andlich doctorfinds it