History log of /external/libunwind/src/os-linux.h
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
7d46a21e0a2cb561e4cad57b101a7137e01023dc 14-Nov-2013 Christopher Ferris <cferris@google.com> For current process, check memory accesses.

When attempting to unwind the current process, the library simple reads and
writes to memory for memory accesses. Unfortunately, if an unwind winds up
with invalid data, then the process can segfault. Add a guard to all memory
accesses that verifies that reads/writes are valid before attempting them.

For now, this guard is a nop on all systems except linux systems.

Also, modify the adjust_ip function to use the access_mem function
so that all reads go through the right function.

Bug: 11652982
Change-Id: I9d1feacae585374f6bf1d899f8a006ec9ecb47c4
/external/libunwind/src/os-linux.h
890e23eb9d3ffd9be2a025189a21794b5ed0e0ff 21-Sep-2012 Tommi Rantala <tt.rantala@gmail.com> Prefer NULL over zero
/external/libunwind/src/os-linux.h
851f14281c2fefb596c8e6b2e356c553a3f5cc87 30-Oct-2011 Arun Sharma <asharma@fb.com> Fix some compiler warnings
/external/libunwind/src/os-linux.h
6a072982ddd0b8c1597ac2aa17559732c8b5e763 02-Mar-2011 Zachary T Welch <zwelch@codesourcery.com> Fix file descriptor leakage in maps_init

If mmap fails, be sure to close the maps file before returning an error.

Signed-off-by: Zachary T Welch <zwelch@codesourcery.com>
Signed-off-by: Ken Werner <ken.werner@linaro.org>
/external/libunwind/src/os-linux.h
5a1d3c6fd765e45b97f478c9db3a2d4cdaa75c69 22-Feb-2010 Arun Sharma <aruns@google.com> Remove bogus check on scan_string which is guaranteed to fail every time.
/external/libunwind/src/os-linux.h
b56375e76a0e23b6e464d994bc6a790e086b91db 07-Oct-2009 Paul Pluzhnikov <ppluzhnikov@google.com> Reduce stack use and apply CONFIG_DEBUG_FRAME to more code.

Currently, libunwind allocates several PATH_MAX entries on stack, while
trying to find a binary via /proc/.../maps.

However stack space may be at premium (especially when sigaltstack is used),
and PATH_MAX on Linux is 4096, while SIGSTKSZ is only 8192 on x86.

Attached patch eliminates multiple PATH_MAX stack allocations, and simplifies
code in maps_next, at the cost of being unable to do anything if we can't
mmap one page. It appears to me that under such low-memory conditions,
libunwind will fail shortly elsewhere anyway.

This patch also disables more of debug_frame-handling code when
CONFIG_DEBUG_FRAME is undefined.

Tested on Linux/x86_64 with and without CONFIG_DEBUG_FRAME, no regressions.
/external/libunwind/src/os-linux.h
253f3e57386cea5b4877a92d11038f9b6ad0444d 18-Oct-2007 Curt Wohlgemuth <curtw@cup.hp.com> [Linux] Fix potentially overlapping memory-copy to use memmove() instead
of memcpy().
/external/libunwind/src/os-linux.h
03e05b41386fd5797cb8cd62eff7f0ba77c4e07e 22-Aug-2007 David Mosberger-Tang <davidm@panda.mostang.com> Fix two minor compiler-warnings.
/external/libunwind/src/os-linux.h
af2503e2230f59a8b87ae5b71ef57e7e18b24a98 26-Jul-2006 David Mosberger-Tang <davidm@koala.localdomain> Fix bug in libunwind-ptrace which can cause reading of random data.

(maps_next): After reading less than a full buffer of data, copy
remaining data to the top of the buffer so as to maintain the
invariant that all data between mi->buf and mi->buf_end is valid.
This avoids maps_next() parsing uninitialized data.
/external/libunwind/src/os-linux.h
6c61288b9c5b3c967937d9ab12113bc7e368e433 29-Jun-2004 hp.com!davidm <hp.com!davidm> (scan_dec): Don't skip over a character unless it's really a digit.
(scan_char): Don't skip over NUL terminator.

(Logical change 1.238)
/external/libunwind/src/os-linux.h
2f210753bd631692bd93f4d0a90e9195424075b9 21-Apr-2004 mostang.com!davidm <mostang.com!davidm> (maps_init): Correct initialization of mi->buf.
(maps_close): Don't forget to unmap mi->buf if it's non-NULL.

(Logical change 1.209)
/external/libunwind/src/os-linux.h
5de4b351e7624889db611e10dd3034e0176db5ee 21-Apr-2004 mostang.com!davidm <mostang.com!davidm> (struct map_iterator): Add members "buf_size", "buf", and "buf_end".
(maps_init): Try to mmap() a one-page buffer and, if successful,
initialize the new map_iterator members based on it.
(maps_next): If the one-page buffer is available, use it to read
/proc/PID/maps. This avoids expensive lseek() calls which,
in the case of /proc lead to T(n) = O(n^2) behavior.

(Logical change 1.208)
/external/libunwind/src/os-linux.h
64c702cea7c2de53ff1ff93dfe76e065036b4e3e 31-Mar-2004 mostang.com!davidm <mostang.com!davidm> (ltoa): New inline function.
(skip_whitespace): Likewise.
(scan_hex): Likewise.
(scan_dec): Likewise.
(scan_char): Likewise.
(scan_string): Likewise.
(maps_init): Avoid stdio operations since they're not async-signal
safe.
(maps_next): Likewise.
(maps_close): Likewise.

(Logical change 1.199)
/external/libunwind/src/os-linux.h
cfded02a05f7fd5314ca4619b53005955a60acee 29-Mar-2003 hp.com!davidm <hp.com!davidm> (maps_close): Do nothing if mi->fp is already NULL.

(Logical change 1.71)
/external/libunwind/src/os-linux.h
824d6619b500a86ff2fc680268357f0215d59b0c 08-Feb-2003 mostang.com!davidm <mostang.com!davidm> (Logical change 1.45)
/external/libunwind/src/os-linux.h
5f94e2d488701fccd474245df3ad6f51aff2a05e 08-Feb-2003 mostang.com!davidm <mostang.com!davidm> Initial revision
/external/libunwind/src/os-linux.h