[libcxx-commits] [PATCH] D126343: [libunwind] Use process_vm_readv to avoid potential segfaults

Shoaib Meenai via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue May 24 16:23:16 PDT 2022


smeenai created this revision.
smeenai added reviewers: danielkiss, MaskRay, rprichard, uweigand.
Herald added subscribers: libcxx-commits, StephenFan, kristof.beyls.
Herald added projects: libunwind, All.
Herald added a reviewer: libunwind.
smeenai requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

We've observed segfaults in libunwind when attempting to check for the
Linux aarch64 sigreturn frame, presumably because of bad unwind info
leading to an incorrect PC that we attempt to read from. Use
process_vm_readv to read the memory safely instead.

The s390x code path should likely follow suit, but I don't have the
hardware to be able to test that, so I didn't modify it here either.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D126343

Files:
  libunwind/src/UnwindCursor.hpp
  libunwind/test/bad_unwind_info.pass.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D126343.431831.patch
Type: text/x-patch
Size: 4621 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220524/9226ba61/attachment.bin>


More information about the libcxx-commits mailing list