| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
Bug: http://b/22047255
Bug: http://b/22091640
Change-Id: I6c51cff43287a6ac4b25fa9ce6a6fc3d232fd047
|
|
|
|
|
|
|
|
| |
(cherry picked from commit 8a1162835597be38705b381ac34c07da17932568)
Bug: 21924613
Bug: http://b/21523078
Change-Id: I3f944a08dd2ed1df4d8a807da4fee423fdd35eb7
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When the Android dynamic linker handles a text relocation,
it first relaxes the permissions on the segment being modified,
performs the modifications, and then restores the page permissions.
The relaxation worked by adding PROT_WRITE to whatever protection
bits were set in the section. In effect, the pages were getting set
to PROT_READ|PROT_WRITE|PROT_EXEC, modified, then restored to
PROT_READ|PROT_EXEC
The SELinux kernel code differentiates between 4 different kinds
of executable memory:
* Executable stack (execstack)
* Executable heap (execheap)
* File-based executable code which has been modified (execmod)
* All other executable memory (execmem)
The execmod capability is only triggered by the kernel when a
dirty but non-executable mmap()ed page becomes executable. When that
occurs, an SELinux policy check is done to see if the execmod capability
is provided by policy.
However, if the page is already executable, and PROT_WRITE is added
to the page, it's considered an execmem permission check, not an execmod
permission check.
There are certain circumstances where we may want to distinguish between
execmod and execmem. This change adjusts the dynamic linker to avoid
using RWX pages, so that an RX -> RW -> RX transition will properly
be detected as an execmod permission check instead of an execmem permission
check.
Bug: 20013628
Change-Id: I14d7be29170b156942f9809023f3b2fc1f37846c
|
|
|
|
|
|
|
|
| |
This reverts commit cb00add1b382d1e3045876d7e1ccbee2fdce976b.
Bug: 20020312
Bug: 20013628
Change-Id: I8baa3d4b6c7fef50c9e2531257d5b96762099eb3
|
|
|
|
|
| |
Bug: 20013628
Change-Id: Idaf8012f00ee1304d429c3b42f9ebc6b648c55b8
|
|
|
|
| |
Change-Id: I4e1cab488d5b2c8e4289da617350a86e72a4ba12
|
|
|
|
| |
Change-Id: I796a4ce86d3fccb8361c19889419c96147ee3c9f
|
|
|
|
| |
Change-Id: Ibf549266a19a67eb9158d341a69dddfb654be669
|
|
|
|
|
|
| |
And fix old style casts.
Change-Id: I37e7a3e3fd852528ea76f02d967c7bd8cd5b06c9
|
|
|
|
|
| |
Bug: 18546535
Change-Id: I479e003deab21e31eb5caa5393067ed1dc558387
|
|
|
|
|
|
|
|
| |
replace lseek() and use pread() instead
add test for library_fd_offset > file_size case
Bug: 17762003
Change-Id: I4555f0be635124efe849c1f226985bcba72ffcbd
|
|
|
|
| |
Change-Id: I9e2aa6c2ba938c8f8d7c74eba32d313c866c77b2
|
|
|
|
|
| |
Bug: 17762003
Change-Id: I8fb267a3155acef3dba534038cf5d1ef00d7154b
|
|
|
|
|
|
|
|
|
|
| |
Get dynamic flags from phdr table's correct entry rather the first
entry, so that the following DT_DEBUG entry can be set.
Also fix the undefined reference to LoadTask::deleter issue under gcc
-O0 option.
Bug: 17524778
Change-Id: I9c679af197b034761fb739d6c980e628ff2ab84c
|
|
|
|
|
|
|
|
|
|
| |
This patch fixes the problem with symbol search order
for dlsym(RTLD_DEFAULT/RTLD_NEXT, .) by loading libraries
and ld_preloads in correct order.
Bug: https://code.google.com/p/android/issues/detail?id=74255
Change-Id: If1ba5c807322409faa914e27ecb675e2c4541f0d
Attempt: 2
|
|
|
|
|
|
| |
This reverts commit a3ad450a2e3fb6b3fe359683b247eba20896f646.
Change-Id: Ia2b838ad2159c643b80c514849582f4b4f4f40e5
|
|
|
|
|
|
|
|
|
| |
This patch fixes the problem with symbol search order
for dlsym(RTLD_DEFAULT/RTLD_NEXT, .) by loading libraries
and ld_preloads in correct order.
Bug: https://code.google.com/p/android/issues/detail?id=74255
Change-Id: I4cf84c70dbaabe99310230dfda12385ae5401859
|
|
|
|
| |
Change-Id: Iad50be617d318ca98883b843229c960ad5b9afa9
|
|
|
|
|
| |
Bug: 15387103
Change-Id: Ifc3608ea65060c1dc38120b10b6e79874f182a36
|
|
|
|
|
|
|
|
| |
* This patch enables dlopen by file descriptor
instead of path/name.
Bug: 15984217
Change-Id: Ib39051e00567fb97070bf96d8ce63993877c0a01
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If the file has no relro segment, the generated relro file will have
length 0, which caused mmap to fail. If the relro file has nonzero size,
but is too short (e.g. because it's for the wrong version of the
library), the linker would segfault while comparing the data. Fix both
these issues: don't try to map a zero length file, and don't try to
compare data that would be beyond the end of the file.
Improve test to explicitly generate two versions of the library: one
with -z relro, and one with -z norelro, so we can test both cases; also
explicitly test the case where the relro file has length 0.
Bug: 14299541
Change-Id: Id8b95585edda90e8bb5de452a35b70ed2d224934
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add flags and a file descriptor to android_dlopen_ext() to allow writing
the RELRO section of the loaded library to a file after relocation
processing, and to allow mapping identical pages from the file over the
top of relocated memory in another process. Explicitly comparing the
pages is required in case a page contains a reference to a symbol
defined in another library loaded at a random base address.
Bug: 13005501
Change-Id: Ibb5b2d384edfaa5acf3e97a5f8b6115c10497a1e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add flags and parameters to android_dlopen_ext() to allow loading a
library at an already-reserved fixed address. If the library to be
loaded will not fit within the space reserved, then the linker will
either fail, or allocate its own address space as usual, according to
which flag has been specified. This behaviour only applies to the
specific library requested; any other libraries loaded as dependencies
will be loaded in the normal fashion.
There is a new gtest included to cover the functionality added.
Bug: 13005501
Change-Id: I5d1810375b20fc51ba6a9b3191a25f9792c687f1
|
|
|
|
| |
Change-Id: Ic9ee7153817c22a252cc4b309283e355b623cab9
|
|
|
|
|
|
|
|
|
|
|
|
| |
Remove the linker's reliance on BSD cruft and use the glibc-style
ElfW macro. (Other code too, but the linker contains the majority
of the code that needs to work for Elf32 and Elf64.)
All platforms need dl_iterate_phdr_static, so it doesn't make sense
to have that part of the per-architecture configuration.
Bug: 12476126
Change-Id: I1d7f918f1303a392794a6cd8b3512ff56bd6e487
|
|
|
|
|
|
|
|
|
| |
Do not use the magic number 0xFFFFFFFFU to represent the max value of an address
as it's not correct on 64bit platform. We should use UINTPTR_MAX instead.
Change-Id: I1fc6f5864a651b2eddea2333cb0788f9d9223270
Signed-off-by: Qiming Shi <qiming.shi@intel.com>
Signed-off-by: Weiwu Chen <weiwu.chen@intel.com>
|
|
|
|
|
|
|
| |
Addition of support for AArch64 in the linker64 target.
Change-Id: I8dfd9711278f6706063e91f626b6007ea7a3dd6e
Signed-off-by: Marcus Oakland <marcus.oakland@arm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We don't need our own architecture macros; the standard ones will do.
This patch also fixes some __x86_64__ tests to be USE_RELA tests instead,
because they're not actually x86_64-specific.
I've cleaned up architecture-specific code slightly so where possible
all the code corresponding to a particular architecture is together.
This patch also fixes a bug in LP64 DT_PLTGOT handling, which should be
an error rather than falling through into DT_DEBUG! There was another #ifdef
bug where we'd only report unexpected DT_ entries on MIPS.
Change-Id: Id1d04e372611f641c1aa278a18e379f28af9eaf5
|
|
|
|
|
|
|
| |
Based on I8dc3e2cb596f75dc58ae82e4dc58f8c177dd3323 by
Pavel Chupin <pavel.v.chupin@intel.com>.
Change-Id: Icd582d277cbe273477b450f2848343d72c86ec9f
|
|
|
|
| |
Change-Id: I2c1f3d34c33685799aade8866eec44479ff9f963
|
|
|
|
| |
Change-Id: I24f30bd0c1120bcf85d77f5c4e69f0fefe9a2478
|
|
|
|
|
|
| |
(cherry picked from commit 88ff15c2c279d2bbe3569101b36cd2aa0931a0a9)
Change-Id: I4aabbe911d30aea8ace69e29bb6e980a4e89de90
|
|
|
|
|
|
| |
(cherry picked from commit 96362fb9d11beef6233aa03db396f25688e70860)
Change-Id: Ib075a6dfc45d5d0746d8b278f317dd9b8d772f2a
|
|
|
|
| |
Change-Id: I9fb3c7c0d4b4ffef0eeaf092d4e30ffe63a08671
|
|
|
|
| |
Change-Id: Ifa9408e9859c6f79444715bed4808b7c13fdced5
|
|
|
|
|
|
|
|
| |
This is primarily for MIPS exutables that do not have a
DT_MIPS_RLD_MAP entry.
Change-Id: I4c221d92debcfed961eeee2515123f3fb21ec8e6
Signed-off-by: Chris Dearman <chris@mips.com>
|
|
I still want to break linker_format out into its own library so we can reuse
it for malloc debugging and so forth. (There are many similar pieces of code
in bionic, but the linker's one seems to be the most complete/functional.)
Change-Id: If3721853d28937c8e821ca1d23cf200e228a409a
|