[Lldb-commits] [PATCH] D34352: [linux] Change the way we load vdso pseudo-module

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Jun 19 08:08:09 PDT 2017


labath created this revision.
Herald added a subscriber: emaste.

This is basically a revert of https://reviews.llvm.org/D16107 and parts of https://reviews.llvm.org/D10800, which were
trying to get vdso loading working. They did this by implementing a
generic load-an-elf-file from memory approach, which is not correct,
since we cannot assume that an elf file is loaded in memory in full (it
usually isn't, as there's no need to load section headers for example).
This meant that we would read garbage instead of section sizes, and if
that garbage happened to be a large number, we would crash while trying
to allocate a buffer to accomodate the hypothetical section.

Instead of this, I add a bit of custom code to load the vdso to
DynamicLoaderPOSIXDYLD (which already needed to handle the vdso
specially). I determine the size of the memory to read using
Process::GetMemoryRegionInfo, which is information coming from the OS,
and cannot be forged by a malicious/misbehaving application.


https://reviews.llvm.org/D34352

Files:
  source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
  source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h
  source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
  source/Plugins/ObjectFile/ELF/ObjectFileELF.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34352.103045.patch
Type: text/x-patch
Size: 13990 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20170619/9bae5a61/attachment.bin>


More information about the lldb-commits mailing list