linux-user, fix: Hide helper threads through saved procfs fds - #419
Open
y347812075 wants to merge 1 commit into
Open
linux-user, fix: Hide helper threads through saved procfs fds#419y347812075 wants to merge 1 commit into
y347812075 wants to merge 1 commit into
Conversation
Chromium's namespace sandbox keeps procfs directory descriptors across a shared chroot. Once the absolute /proc path becomes unreachable, LATX no longer recognized /proc/self/task and exposed its host-only RCU helper in st_nlink. ChatGPT 42.3.0 then failed the zygote thread-count check and triggered INT3 unless launched with --no-sandbox. Recognize saved current-process task descriptors by comparing their procfs device and inode with ../../self/task. Apply the guest thread count to fstat, fstatat with AT_EMPTY_PATH, and statx while leaving other processes' task directories unchanged. Add a focused x86_64 guest regression and a native two-thread helper covering saved proc root and task descriptors, AT_EMPTY_PATH, statx, and the other-PID negative case. Validated with the focused procfs and namespace integration tests and three ChatGPT default-sandbox launches reaching "Launching app" without INT3. Signed-off-by: yuerengan <y347812075@163.com>
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.
Summary / 变更说明
sandbox chroot makes the absolute
/procpath unreachable.fstat,fstatat(AT_EMPTY_PATH), andstatx(AT_EMPTY_PATH)results for the currentprocess's
/proc/self/taskdirectory.../../self/taskdevice/inode matchingso another PID's task directory is never rewritten.
saved proc-root/task descriptors and the other-PID negative cases.
This fixes ChatGPT 42.3.0 / Chromium 151 zygote startup under the default
sandbox. Before the fix, LATX exposed a host-only helper as
st_nlink=4whileChromium expected
3, causing anINT3;--no-sandboxavoided that path.Validation / 验证
./latxbuild/build64.sh— passed.test-cef-procfs-chroot.sh— passed; coversfstat,fstatatandstatxfor saved self-task fds plus all three other-PID negative cases.
test-proc-thread-count.sh— passed.test-cef-userns-exec.sh— passed.test-cef-userns-nested.sh— passed.-Wall -Wextra -Werror— passed.scripts/checkpatch.pl— exit 0, no errors; one generic new-fileMAINTAINERS reminder.
Launching app, startedNetworkService, and did not trigger the originalINT3.Checklist / 检查项
CONTRIBUTING.md. / 我已阅读CONTRIBUTING.md。git commit -s). /每个提交都包含 DCO 签署(
git commit -s)。are not applicable. /
我已提供相关构建或测试结果,或说明了不适用的原因。