1
0
Fork 0
mirror of https://github.com/tobast/libunwind-eh_elf.git synced 2024-12-23 03:53:43 +01:00
libunwind-eh_elf/include/tdep-x86_64
Arun Sharma 649f1fb344 [X86-64] For local unwinding, we have a defence mechanism against
bad/missing unwind information, which could result in libunwind
dereferencing bad pointers. This mechanism is based on msync(2) system
call and significantly reduces the chances of a bad pointer
dereference in libunwind.

The original idea was to turn this mechanism on only when necessary
i.e. libunwind didn't find proper unwind information for a IP.

There are a couple of problems in the current implementation.

* The flag is global and is modified without locking
* The flag isn't reset when starting a new unwind

The attached patch makes ->validate a per-thread setting by moving it
into struct cursor from unw_local_addr_space and resets it to false
when starting a new unwind. As a result, cursor->as_arg points to the
cursor itself instead of the ucontext (for the local case).

This was found to reduce the number of msync() system calls from an
application using libunwind significantly.

Signed-off-by: Paul Pluzhnikov <ppluzhnikov@google.com>
Signed-off-by: Arun Sharma <arun.sharma@google.com>
2008-06-16 14:35:53 -06:00
..
dwarf-config.h Restore more files wiped out by Bitkeeper->CVS->GIT transition. 2006-07-26 15:09:39 -06:00
jmpbuf.h Rename: include/x86_64/jmpbuf.h -> include/tdep-x86_64/jmpbuf.h 2005-05-20 09:48:08 +00:00
libunwind_i.h [X86-64] For local unwinding, we have a defence mechanism against 2008-06-16 14:35:53 -06:00