Conversation
This was referenced Sep 26, 2026
|
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.



On Ubuntu 25.10 and later, no coreutils command runs under PRoot. Ubuntu now ships the Rust coreutils (uutils) as one multi-call binary that works out which command it is from
AT_EXECFN, and under PRoot that value is the path of PRoot's loader instead of the program. With the v5.4.1 release binary, only Docker is needed to see it:The same commands work in
ubuntu:24.04. How the command is started makes no difference, and every script that starts with#!/usr/bin/envfails throughenv. It is the guest's coreutils that fail, so an Ubuntu 25.10+ rootfs is affected on any host. Theprootpackage in Ubuntu 26.04 is 5.4.0 and behaves the same.This is also why the
ubuntu-26.04jobs of this repository's CI report 41 failed checks in "Execute test suite" (hidden bycontinue-on-error) while theubuntu-24.04jobs report none, for example in https://github.com/proot-me/proot/actions/runs/35549493565: the shell tests run the host's coreutils under PRoot. The first commit here brings the 41 down to 4, and the second fixes those 4, which fail for reasons of their own (see below), so both jobs report none.Why PRoot gets it wrong
The kernel sets
AT_EXECFNto the file it executes, and under PRoot that is the loader, extracted to/tmp/prooted-*. The loader already fixes the vector on the program's stack, pointingAT_EXECFNtoargv[0](seesrc/loader/loader.c), and that is whatgetauxval(3)returns. The kernel keeps its own copy of the vector, though, and two interfaces return that copy unchanged:prctl(PR_GET_AUXV)(Linux 6.4 and later) and/proc/self/auxv. uutils readsAT_EXECFNthrough rustix, which asksPR_GET_AUXVfirst and falls back to/proc/self/auxvon older kernels, so both have to agree with the stack.What the first commit changes
execve(2)returns, PRoot records whereargv[0]is on the new stack, which is the address the loader puts inAT_EXECFN.prctl(PR_GET_AUXV)now also stops at its exit, under seccomp as well, andAT_EXECFNis pointed toargv[0]in the buffer the kernel filled./proc/self/auxvor/proc/<own pid>/auxvread-only is redirected to a copy of the kernel's vector withAT_EXECFNfixed the same way. The copy is written to a temporary file the first time the program opens it and removed at its nextexecve(2). QEMU's user-mode emulation answers this file the same way, and rustix opens it with a plainopen(2)for that reason. Fixing the data as it is read instead would mean tracing everyread(2),pread64(2),readv(2), and so on made on that descriptor, including throughdup(2)andfork(2), and PRoot leaves all of those untraced under seccomp. A binding over the file, such as the onebind_proc_pid_auxv()makes for a ptraced tracee, takes precedence.Only
AT_EXECFNchanges. The other entries the loader rewrites on the stack (AT_PHDR,AT_PHENT,AT_PHNUM,AT_BASE,AT_ENTRY) still read as the loader's through these two interfaces, as before.test/auxv.batsruns a new helper,test/execfn.c, which printsAT_EXECFNas read throughgetauxval(3),PR_GET_AUXV, and/proc/self/auxv(through stdio). It covers a 64-bit build and a 32-bit one, which is skipped without multilib, likeexec-m32. The Bats step of the CI now runs it. On master only thegetauxval(3)case passes.What the second commit changes
It fixes the four checks that still fail on Ubuntu 26.04 for reasons outside PRoot, and makes the scripts it touches pass shellcheck, since the CI lints every changed script.
$PROOTstays unquoted, under a directive, becausememcheckprefixes it with valgrind.test-5996858dandtest-carehwcpexpectLD_SHOW_AUXVto print a clearedAT_HWCAPas0, which glibc 2.43 prints as0x0. Both prerequisite checks were also missing a space before a].test-82ba4ba1expectschown root.root /rootto fail for a non-root user, but the uutilschownreturns success without callingchown(2)when the owner would not change. The check now uses a file the user owns.test-ggggggggbinds/binelsewhere and then runstestfrom$PATH. PRoot names that command by its path under the bind, where Ubuntu 26.04's relative symlink/bin/test -> ../lib/cargo/bin/coreutils/testdoes not resolve, as it would not under a real bind mount either. The shell's builtintestchecks the same thing without depending on that.Results
This repository's workflows, run on this branch in my fork because the runs here wait for approval:
ubuntu-26.04, with and without seccompubuntu-24.04, with and without seccompRuns: master, first commit, both commits. With both commits, every job passes 131 checks and skips 5, the Bats step passes in all four, and shellcheck, the unit tests, and the aarch64 cross-compile pass.
On an Ubuntu 26.04 machine (Linux 7.0.0, glibc 2.43, GCC 15.2, x86_64), with and without
PROOT_NO_SECCOMP=1,test/auxv.batspasses 1 of 5 cases on master and 5 of 5 with this change, including the 32-bit build the CI runners skip. I also checked forked children and threads, a program exec'd by one that had already read the file, short and zero-lengthPR_GET_AUXVbuffers, and a write-only open, which still fails withEACCES. No temporary file is left behind. A fork+exec loop and an open+close loop take the same time before and after (medians within 2%, same minimums).Termux's fork has the same fix in two parts: termux/proot#353 fixes
AT_EXECFNinPR_GET_AUXV, and termux/proot#392 answers/proc/self/auxvwith a copy. The first commit follows the same approach.