[PATCH] D46566: Add a CIE with length 0 unconditionally.
Fangrui Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu May 10 11:31:44 PDT 2018
MaskRay added a comment.
https://code.woboq.org/userspace/glibc/sysdeps/generic/unwind-dw2-fde.c.html#645
for (; ! last_fde (ob, this_fde); this_fde = next_fde (this_fde))
`last_fde` is defined at https://code.woboq.org/userspace/glibc/sysdeps/generic/unwind-dw2-fde.h.html#162 . It does not check whether it reaches the end of `.eh_frame` (`DWARF2_OBJECT_END_PTR_EXTENSION` seems not defined). If there is no length=0 terminator, the pointer will run beyond the end of `.eh_frame` and run into successive sections (out-of-bound read), segfault or stop somewhere. This issue is usually latent/benign and I can only catch this in some internal statically-linked configuration. I don't have time to read the whole source code of how glibc/libgcc_s libunwind to understand why this routine is sometimes called but sometimes not.
Repository:
rLLD LLVM Linker
https://reviews.llvm.org/D46566
More information about the llvm-commits
mailing list