mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-19 12:56:06 +00:00
fix(proot): fchdir takes the open directory's path instead of walking it again (#2553)
* fix(proot): fchdir takes the open directory's path instead of walking it again * fix(proot): fchdir keeps trailing-period names and rechecks the binding's parent The descriptor path now carries the same final marker the walk produced, so a directory whose name ends with a period is not truncated. The parent of the matching binding is resolved again, so a binding whose ancestor was replaced by a symlink takes the full walk as before. The check script gains a trailing-period directory. * fix(proot): fchdir requires the binding's parent to be a directory
This commit is contained in:
1 parent
bb05e20d1b
commit
f33181e430
4 files changed
+226
-1
No files matched your search
@@ -204,7 +204,7 @@ call can be answered in-process with the 0014 design.
|
||||
| syscalls | why proot traps them | can it bypass proot? |
|
||||
|---|---|---|
|
||||
| `openat`/`open`/`creat`, `newfstatat`/`stat`/`lstat`, `statx`, `faccessat`/`access`, `readlinkat` (exit), `mkdirat`, `unlinkat`, `renameat(2)`, `symlinkat`, `linkat`, `fchmodat`, `fchownat`, `utimensat`, `truncate`, `*xattr`, `inotify_add_watch`, `name_to_handle_at` | path translation (guest → host), plus exit fixups for `readlink` and `rename` | **Yes, through libc wrappers.** The prototype covers open, stat, statx, access, readlink, opendir and fopen; the write family is next. Raw `svc` and glibc's internal callers (ld.so, fts, realpath, nss) still go to proot. |
|
||||
| `chdir`/`fchdir`, `getcwd` (exit) | proot emulates the cwd; until 0014 the kernel's cwd never moved | With 0014 the kernel's cwd follows the guest's. `getcwd` stays in proot (cheap, rare). |
|
||||
| `chdir`/`fchdir`, `getcwd` (exit) | proot emulates the cwd; until 0014 the kernel's cwd never moved | With 0014 the kernel's cwd follows the guest's. With 0028 `fchdir` takes the path of the open directory from `/proc/<pid>/fd` instead of walking it again. `getcwd` stays in proot (cheap, rare). |
|
||||
| `execve`/`execveat` | runs the loader, maps `PT_INTERP` inside the rootfs, shebangs, tracks `/proc/self/exe` | **No.** This is the core of what proot is for. Costs 0.4–0.8 ms per exec; the session scripts already avoid exec-heavy loops (`nap`). |
|
||||
| `brk` (entry and exit) | heap emulation: programs are mapped by proot's loader, so the kernel's brk area is the loader's | No (`PR_SET_MM` needs `CAP_SYS_RESOURCE`). **Fewer calls:** `GLIBC_TUNABLES=glibc.malloc.top_pad=…` grows the heap in larger steps. |
|
||||
| `bind`, `connect`, `accept(4)`, `getsockname`, `getpeername` | `sun_path` of Unix sockets | Same-path binds (runtime dir, files dir) need no translation, but the filter can't see the address. Possible fast-path candidate. |
|
||||
|
||||
Reference in new issue
Block a user