aboutsummaryrefslogtreecommitdiff
path: root/src/processor/exploitability_linux.h
diff options
context:
space:
mode:
authorLiu.andrew.x@gmail.com <Liu.andrew.x@gmail.com>2015-07-28 00:53:44 +0000
committerLiu.andrew.x@gmail.com <Liu.andrew.x@gmail.com>2015-07-28 00:53:44 +0000
commit2997f4590734f904190d46ee4ecf7dd4c8e5019b (patch)
treec6c27a3ae7e39b303bac1b25d46aef8c6b20962c /src/processor/exploitability_linux.h
parentFix incorrect comment. (diff)
downloadbreakpad-2997f4590734f904190d46ee4ecf7dd4c8e5019b.tar.xz
Add support for Linux memory mapping stream and remove ELF header usage
when checking exploitability rating. Linux minidumps do not support MD_MEMORY_INFO_LIST_STREAM, meaning the processor cannot retrieve its memory mappings. However, it has its own stream, MD_LINUX_MAPS, which contains memory mappings specific to Linux (it contains the contents of /proc/self/maps). This CL allows the minidump to gather information from the memory mappings for Linux minidumps. In addition, exploitability rating for Linux dumps now use memory mappings instead of checking the ELF headers of binaries. The basis for the change is that checking the ELF headers requires the minidumps to store the memory from the ELF headers, while the memory mapping data is already present, meaning the size of a minidump will be unchanged. As a result, of removing ELF header analysis, two unit tests have been removed. Arguably, the cases that those unit tests check do not merit a high exploitability rating and do not warrant a solid conclusion that was given earlier. R=ivanpe@chromium.org Review URL: https://codereview.chromium.org/1251593007 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1476 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/processor/exploitability_linux.h')
-rw-r--r--src/processor/exploitability_linux.h51
1 files changed, 0 insertions, 51 deletions
diff --git a/src/processor/exploitability_linux.h b/src/processor/exploitability_linux.h
index 2deb4991..6332b074 100644
--- a/src/processor/exploitability_linux.h
+++ b/src/processor/exploitability_linux.h
@@ -43,17 +43,6 @@
namespace google_breakpad {
-enum LinuxArchitectureType {
- // A 32-bit Linux architecture.
- LINUX_32_BIT,
-
- // A 64-bit Linux architecture.
- LINUX_64_BIT,
-
- // Some other architecture that is not Linux.
- UNSUPPORTED_ARCHITECTURE
-};
-
class ExploitabilityLinux : public Exploitability {
public:
ExploitabilityLinux(Minidump *dump,
@@ -69,46 +58,6 @@ class ExploitabilityLinux : public Exploitability {
// This method checks the exception that triggered the creation of the
// minidump and reports whether the exception suggests no exploitability.
bool BenignCrashTrigger(const MDRawExceptionStream *raw_exception_stream);
-
- // Checks if the minidump architecture is 32-bit or 64-bit.
- LinuxArchitectureType ArchitectureType();
-
- // Loads ELF header data of the module present in the given memory
- // region into the scoped pointer.
- // This method takes a scoped pointer in which the ELF header data is
- // loaded, the memory region containing the ELF header, and the base
- // address of the ELF header.
- template<typename T>
- void LoadElfHeader(MinidumpMemoryRegion *memory,
- uint64_t base_address,
- T *header) {
- for (size_t i = 0; i < sizeof(T); i++) {
- uint8_t my_byte = 0;
- memory->GetMemoryAtAddress(base_address + i, &my_byte);
- *(reinterpret_cast<char *>(header) + i) = my_byte;
- }
- }
-
- // Loads the Program Header Table of the module present in the given
- // memory region into the scoped array.
- // This method takes a scoped array in which the header table data is
- // loaded, the memory region containing the table, the base address of
- // the program header table, and the number of entries in the table.
- template<typename T>
- void LoadElfHeaderTable(MinidumpMemoryRegion *memory,
- uint64_t base_address,
- uint16_t e_phnum,
- T table[]) {
- uint64_t offset = 0;
- for (size_t i = 0; i < e_phnum; i++) {
- T *entry = &table[i];
- for (size_t j = 0; j < sizeof(T); j++) {
- uint8_t my_byte = 0;
- memory->GetMemoryAtAddress(base_address + offset++, &my_byte);
- *(reinterpret_cast<char *>(entry) + j) = my_byte;
- }
- }
- }
};
} // namespace google_breakpad