1
0
Fork 0
mirror of https://github.com/tobast/libunwind-eh_elf.git synced 2024-12-31 23:23:43 +01:00
libunwind-eh_elf/src/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
..
Gcreate_addr_space.c (Logical change 1.249) 2004-08-19 13:39:10 +00:00
Gget_proc_info.c (unw_get_proc_info): Don't freak out if dwarf_make_proc_info() fails. 2005-05-03 09:13:17 +00:00
Gget_save_loc.c (Logical change 1.249) 2004-08-19 13:39:10 +00:00
Gglobal.c Adjust for sigset_t to intrmask_t renaming. 2005-05-03 09:13:17 +00:00
Ginit.c [X86-64] For local unwinding, we have a defence mechanism against 2008-06-16 14:35:53 -06:00
Ginit_local.c [X86-64] For local unwinding, we have a defence mechanism against 2008-06-16 14:35:53 -06:00
Ginit_remote.c [X86-64] For local unwinding, we have a defence mechanism against 2008-06-16 14:35:53 -06:00
Gis_signal_frame.c [X86-64] For local unwinding, we have a defence mechanism against 2008-06-16 14:35:53 -06:00
Gregs.c (tdep_access_reg): When writing RAX/RDX, update eh_args[] and 2005-05-03 09:13:17 +00:00
Gresume.c [X86-64] For local unwinding, we have a defence mechanism against 2008-06-16 14:35:53 -06:00
Gstep.c [X86-64] For local unwinding, we have a defence mechanism against 2008-06-16 14:35:53 -06:00
init.h Implement a ip -> dwarf_reg_state cache. 2006-07-26 21:18:49 -06:00
is_fpreg.c Include "libunwind_i.h" instead of "tdep.h". 2005-05-20 09:48:08 +00:00
Lcreate_addr_space.c (Logical change 1.249) 2004-08-19 13:39:10 +00:00
Lget_proc_info.c (Logical change 1.249) 2004-08-19 13:39:10 +00:00
Lget_save_loc.c (Logical change 1.249) 2004-08-19 13:39:10 +00:00
Lglobal.c (Logical change 1.249) 2004-08-19 13:39:10 +00:00
Linit.c (Logical change 1.249) 2004-08-19 13:39:10 +00:00
Linit_local.c (Logical change 1.249) 2004-08-19 13:39:10 +00:00
Linit_remote.c (Logical change 1.249) 2004-08-19 13:39:10 +00:00
Lis_signal_frame.c (Logical change 1.249) 2004-08-19 13:39:10 +00:00
longjmp.S Mark Wielaard <mwielaard@redhat.com> writes: 2007-10-01 08:35:01 -06:00
Lregs.c (Logical change 1.249) 2004-08-19 13:39:10 +00:00
Lresume.c (Logical change 1.249) 2004-08-19 13:39:10 +00:00
Lstep.c (Logical change 1.249) 2004-08-19 13:39:10 +00:00
offsets.h [X86-64]: Instead of auto-generating _u_context_i.h, hardcode the 2007-08-06 19:58:12 -06:00
regname.c Fix missing NELEMS -> ARRAY_SIZE adjustment. 2005-05-03 09:13:17 +00:00
setcontext.S Mark Wielaard <mwielaard@redhat.com> writes: 2007-10-01 08:35:01 -06:00
siglongjmp.S Mark Wielaard <mwielaard@redhat.com> writes: 2007-10-01 08:35:01 -06:00
ucontext_i.h (UC_MCONTEXT_{R8-R15,RDI,RSI,RBX,RDX,RAX,RCX}: New macros. 2005-05-03 09:13:17 +00:00
unwind_i.h Include "libunwind_i.h" instead of "tdep.h" and "internal.h". 2005-05-20 09:48:08 +00:00