Fix potential crashes during unwind when checking for signal frames and the current PC is invalid.
The same bug was fixed for aarch64 in https://reviews.llvm.org/D126343.
Differential D129856
[libunwind][SystemZ] Use process_vm_readv to avoid potential segfaults uweigand on Jul 15 2022, 7:42 AM. Authored by
Details
Fix potential crashes during unwind when checking for signal frames and the current PC is invalid. The same bug was fixed for aarch64 in https://reviews.llvm.org/D126343.
Diff Detail
Event TimelineComment Actions process_vm_readv was introduced in Linux 3.2; is it okay to use it unconditionally for you? (aarch64 support was only added in Linux 3.7, so we were guaranteed to have the syscall available for it.)
Comment Actions Well, while s390x Linux support long precedes Linux 3.2, it's still over 10 years old and all Linux distributions currently in support have a more recent kernel. So I think it's fine to rely on in unconditionally.
|
For aarch64, I went through syscall instead of the libc process_vm_readv wrapper because the latter wasn't guaranteed to be present even when the kernel supported the syscall (e.g. on Android 5). If you don't have that constraint, it'd be cleaner to just use the libc wrapper (assuming it's available on SystemZ).