[libcxx-commits] [PATCH] D90898: [libunwind] Unwind through aarch64/Linux sigreturn frame
Ryan Prichard via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Dec 2 22:37:26 PST 2020
rprichard added a comment.
> That could work. Some similar approaches:
> - process_vm_readv
> - pipe+write
> - open /proc/self/mem
FWIW, Bionic doesn't expose the `process_vm_readv` syscall wrapper function until API 23 (M, Android 6.0). The first version of Android to support AArch64 is API 21 (L, Android 5.0). Maybe libunwind could call `syscall` instead.
Also, with respect to execute-only memory (XOM), there are a couple of mitigating factors:
- As long as the function has unwind info, libunwind won't try to read the memory at the PC.
- Execute-only memory broke another security mitigation, PAN (see here <https://source.android.com/devices/tech/debug/execute-only-memory> and here <https://www.vdoo.com/blog/pan-and-xom-when-security-features-collide>), so it only shipped in Android 10. It was removed from Android 11 and from the upstream Linux kernel. Even on Android 10, I think it was only supported on sufficiently-new devices (e.g. not the Pixel 2), and at least for the Pixel 3, the kernel doesn't seem to enforce XOM anymore as of Android 10 QPR3. e.g. I still see `--x` pages, but it's now possible to read them w/o segfaulting. The first page I linked mentioned backporting a 4.9 kernel patch disabling XOM. Maybe the feature would be resurrected eventually, though.
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
More information about the libcxx-commits