android_system_core/libunwindstack/tests
Christopher Ferris 8726d3a448 Fix handling of possible bad gnu_debugdata_size.
Rather than use a std::vector for backing memory, allocate the memory
using a new with nothrow, and in MemoryBuffer use realloc. Since
the size field is coming from the elf, it could be corrupted or
intentionally crafted to cause problems.

In addition, add some other protections to make sure that overflows
don't occur.

Bug: 146215949

Test: Ran unit tests with jemalloc and scudo to verify that they
Test: both behave the same way.
Change-Id: If14243ce382ba5403a6bacd0ec673452c6b7c3be
2019-12-19 16:48:15 -08:00
..
files Use elf offset in signal step check. 2019-12-04 22:29:59 +00:00
ArmExidxDecodeTest.cpp Fix build with new googletest 2019-11-10 04:08:25 +00:00
ArmExidxExtractTest.cpp
DexFileData.h
DexFilesTest.cpp Fix support finding global variables. 2019-12-03 17:35:00 -08:00
DexFileTest.cpp Revert "Check for data races when reading JIT/DEX entries." 2019-04-05 18:23:32 +00:00
DwarfCfaLogTest.cpp Add a name for all test suites 2019-12-11 12:46:20 -08:00
DwarfCfaTest.cpp Add a name for all test suites 2019-12-11 12:46:20 -08:00
DwarfDebugFrameTest.cpp Add a name for all test suites 2019-12-11 12:46:20 -08:00
DwarfEhFrameTest.cpp Add a name for all test suites 2019-12-11 12:46:20 -08:00
DwarfEhFrameWithHdrTest.cpp Add a name for all test suites 2019-12-11 12:46:20 -08:00
DwarfMemoryTest.cpp Remove CHECK in AdjustEncodedValue. 2018-12-20 08:40:58 -08:00
DwarfOpLogTest.cpp Add a name for all test suites 2019-12-11 12:46:20 -08:00
DwarfOpTest.cpp Add a name for all test suites 2019-12-11 12:46:20 -08:00
DwarfSectionImplTest.cpp Add a name for all test suites 2019-12-11 12:46:20 -08:00
DwarfSectionTest.cpp Replace MOCK_METHODN with MOCK_METHOD macro. 2019-10-11 14:30:18 -07:00
ElfCacheTest.cpp Switch case to suite to follow new gtest naming. 2019-06-20 16:18:57 -07:00
ElfFake.cpp
ElfFake.h Fix handling of possible bad gnu_debugdata_size. 2019-12-19 16:48:15 -08:00
ElfInterfaceArmTest.cpp
ElfInterfaceTest.cpp Fix handling of possible bad gnu_debugdata_size. 2019-12-19 16:48:15 -08:00
ElfTest.cpp Use elf offset in signal step check. 2019-12-04 22:29:59 +00:00
ElfTestUtils.cpp
ElfTestUtils.h
GenGnuDebugdata.cpp
IsolatedSettings.cpp Move to isolated testing. 2019-07-17 18:08:32 -07:00
JitDebugTest.cpp Fix support finding global variables. 2019-12-03 17:35:00 -08:00
LocalUnwinderTest.cpp Add test mapping to run the libunwind tests. 2019-09-03 13:32:51 -07:00
LocalUpdatableMapsTest.cpp Fix LocalUpdatableMaps 2019-09-16 18:28:38 -07:00
LogFake.cpp
LogFake.h
MapInfoCreateMemoryTest.cpp Move to isolated testing. 2019-07-17 18:08:32 -07:00
MapInfoGetBuildIDTest.cpp Avoid signed extension of chars for build ids. 2019-01-30 12:09:11 -08:00
MapInfoGetElfTest.cpp Add support for displaying soname in an apk. 2019-03-13 17:07:46 -07:00
MapInfoGetLoadBiasTest.cpp Handle when bias is different in elf headers. 2019-10-08 17:36:06 +00:00
MapInfoTest.cpp Handle when bias is different in elf headers. 2019-10-08 17:36:06 +00:00
MapsTest.cpp Fix copy / move behaviour of Maps object. 2019-03-05 13:05:36 +00:00
MemoryBufferTest.cpp Internalize subclasses of Memory 2019-06-11 12:09:18 -07:00
MemoryCacheTest.cpp Internalize subclasses of Memory 2019-06-11 12:09:18 -07:00
MemoryFake.cpp Implement support for linker rosegment option. 2018-10-03 20:48:45 -07:00
MemoryFake.h Implement support for linker rosegment option. 2018-10-03 20:48:45 -07:00
MemoryFileTest.cpp Internalize subclasses of Memory 2019-06-11 12:09:18 -07:00
MemoryLocalTest.cpp Internalize subclasses of Memory 2019-06-11 12:09:18 -07:00
MemoryOfflineBufferTest.cpp Switch case to suite to follow new gtest naming. 2019-06-20 16:18:57 -07:00
MemoryOfflineTest.cpp Internalize subclasses of Memory 2019-06-11 12:09:18 -07:00
MemoryRangesTest.cpp Internalize subclasses of Memory 2019-06-11 12:09:18 -07:00
MemoryRangeTest.cpp Internalize subclasses of Memory 2019-06-11 12:09:18 -07:00
MemoryRemoteTest.cpp Internalize subclasses of Memory 2019-06-11 12:09:18 -07:00
MemoryTest.cpp
RegsFake.h Add BuildId to frame information. 2019-03-26 08:04:40 -07:00
RegsInfoTest.cpp Fix off by one error. 2018-10-23 18:10:41 +01:00
RegsIterateTest.cpp Merge "Include PSTATE in tombstones on arm64." 2019-11-19 14:07:37 +00:00
RegsStepIfSignalHandlerTest.cpp
RegsTest.cpp Fix offsets when shared lib split across maps. 2018-12-18 11:22:14 -08:00
SymbolsTest.cpp Add a name for all test suites 2019-12-11 12:46:20 -08:00
TestLocal.cpp
TestUtils.cpp Add a few leak check tests. 2019-01-25 12:35:19 -08:00
TestUtils.h Add a few leak check tests. 2019-01-25 12:35:19 -08:00
UnwinderTest.cpp Switch case to suite to follow new gtest naming. 2019-06-20 16:18:57 -07:00
UnwindOfflineTest.cpp Use elf offset in signal step check. 2019-12-04 22:29:59 +00:00
UnwindTest.cpp Internalize subclasses of Memory 2019-06-11 12:09:18 -07:00
VerifyBionicTerminationTest.cpp Add test of undefined return address. 2019-08-30 23:29:34 -07:00