fix(proot): lay out ARM64 programs like the kernel so large reservations fit (#2279)

This commit is contained in:
MaxsTechReview authored and GitHub committed 2026-11-08 10:43:57 -05:00
1 parent 2bd7df5e1a
commit 74c0f2127a
2 files changed
+27

No files matched your search

+10
View File
@@ -142,6 +142,16 @@ Prototype (inert unless `PROOT_FASTPATH` is set; see `docs/development/proot-per
`statx` (`newfstatat`) and `memfd_create`. Syscalls outside the trampoline and sessions
without `PROOT_FASTPATH` are unchanged. `bench/statx-trap.c` traps `statx` and checks an
existing directory still reads as one.
- `0026-arm64-kernel-program-layout.patch` - on ARM64, PRoot put its loader at 128 GiB, a PIE
program at 192 GiB and its interpreter at 252 GiB. Android kernels give a process a 39-bit
(512 GiB) address space, so those three split the low half into holes of 64 GiB or less, and a
program that reserves one large contiguous range there could not get it. The Linux kernel loads
a PIE program at two thirds of the address space (`ELF_ET_DYN_BASE`, 0x5555555000 with 39 bits)
and keeps the range below it free; the loader, program and interpreter now sit there too, which
leaves 64 GiB to 336 GiB free as on a native kernel. Switch emulators that run guest code
natively reserve 256 GiB above 64 GiB for guest memory: under PRoot the reservation failed and
the first guest instruction faulted forever. 48-bit address spaces and 32-bit programs are
unchanged in practice.
Old kernel fixes: