Commit graph

14457 commits

Author SHA1 Message Date
Christopher Ferris
9fee99b060 Do not hold hash table lock while backtracing.
There is a deadlock if holding the hash table lock while trying to do
a backtrace. Change the code so that the hash table lock is only held
while actually modifying either g_hash_table, or while modifying an
entry from g_hash_table.

Bug: 22423683
Change-Id: I604ea56f940f22e99da41ea4dcdf97bedaac268d
2015-07-13 12:17:50 -07:00
Elliott Hughes
65dd858239 Fix alignment after variable-length data.
In the serialized output from netd, the strings come first. Some code
assumes -- reasonably enough -- that it can do unaligned reads of pointers,
so we need to ensure alignment after all the strings.

Bug: http://b/21192318
Change-Id: I456639127db9a2583f7f738e6b8103375d9387fd
2015-07-06 14:37:46 -07:00
Dmitriy Ivanov
f643eb38c3 Improve personality initialization
1. Personality parameter should be unsigned int (not long)
2. Do not reset bits outside of PER_MASK when setting
   personality value.
3. Set personality for static executables.

Bug: http://b/21900686
Change-Id: I4c7e34079cbd59b818ce221eed325c05b9bb2303
2015-06-30 18:45:59 -07:00
Erik Kline
754f669076 Pass around struct android_net_context for better behaviour
Group network context elements in to a single struct and
add a version of android_getaddrinfofornet() that accepts it.

The introduction of UID-based routing means that the UID is an
integral part of the network context when evaluating connectivity,
sorting addresses, etc.

Also, introduce a distinction between DNS netids/marks and those
expected to be used by the application.  This can be important
when the network an application is using is not the same as the
network on which DNS queries will be issued.

Additionally, de-duplicate the UDP connect logic (collapse both
_test_connect() and _find_src_addr() into just the latter).

Bug: 19470192
Bug: 20733156
Bug: 21832279
Change-Id: If16c2f4744695f507993afdac078ca105eb5d3e4
(cherry picked from commit 01e37c9665)
2015-06-30 12:12:08 +09:00
Dmitriy Ivanov
f7d5bf334d Lock on dl_interate_phdr
There is possibility of someone dlclosing a library
while dl_iterate_phdr in progress which can lead to
dl_iterate_phdr calling callback with invalid address
if it was unmapped by dlclose.

Bug: http://b/22047255
Change-Id: I3fc0d9fd2c51fb36fd34cb035f37271fa893a7be
2015-06-29 14:48:25 -07:00
Dmitriy Ivanov
06700b2b5e Fix crash when trying to load invalid ELF file.
Bug: http://b/22047255
Bug: http://b/22091640
Change-Id: I6c51cff43287a6ac4b25fa9ce6a6fc3d232fd047
2015-06-25 17:03:26 -07:00
Dimitry Ivanov
fb3357e2eb Revert "[MIPS] Support FR=0 emulation on FR=1 64-bit FP registers"
This reverts commit 40d9e7bf84.

Bug: http://b/22045439
Change-Id: Ia9c56f65d35e404332a462f46460335cef39f0a4
2015-06-24 20:42:33 +00:00
Duane Sand
40d9e7bf84 [MIPS] Support FR=0 emulation on FR=1 64-bit FP registers
Enables running of older MIPS NDK-built apps on mips64r6.

Works with kernel supporting FRE emulation, and old kernels.

Bug: http://b/21555893
Change-Id: I13923fe62cd83ad1d337f13a50f2eda2dfdd906f
(cherry picked from commit d02ec08427)
2015-06-23 10:33:37 -07:00
Elliott Hughes
2b028f5ce4 Fix bad merge of 64e9e71cdb.
Bug: http://b/22029751
Change-Id: I6245fe5f274c9af8a632da5eebe50cf9fe29dc4a
2015-06-23 09:14:16 -07:00
Dmitriy Ivanov
d6d6c0c4f1 Merge "Remove libdl* tests from bionic-unit-tests-static" into mnc-dev 2015-06-22 19:25:37 +00:00
Dmitriy Ivanov
5fa858c565 Merge "Remove text-relocs support for apps targeting M+" into mnc-dev 2015-06-22 19:25:15 +00:00
Dmitriy Ivanov
96ebdcdca0 Remove libdl* tests from bionic-unit-tests-static
Bug: http://b/21900592
Change-Id: I907cc15684b121ec2fbdeca49fc584bb6d2eaacc
(cherry picked from commit de4e27e231)
2015-06-22 12:24:36 -07:00
Yabin Cui
cb06075903 am 8beb0c34: am b245bc75: am 0f455612: Merge "Fix flaky test of timer_create_multiple in L." into lollipop-mr1-cts-dev
* commit '8beb0c34da46a5146a2de8256db8bb42febb283c':
  Fix flaky test of timer_create_multiple in L.
2015-06-19 19:06:22 +00:00
Yabin Cui
8beb0c34da am b245bc75: am 0f455612: Merge "Fix flaky test of timer_create_multiple in L." into lollipop-mr1-cts-dev
* commit 'b245bc750021ce6d220e71625fca66620cdd1f05':
  Fix flaky test of timer_create_multiple in L.
2015-06-19 18:55:51 +00:00
Yabin Cui
b245bc7500 am 0f455612: Merge "Fix flaky test of timer_create_multiple in L." into lollipop-mr1-cts-dev
* commit '0f455612d3325932a851418634a17a61307948c5':
  Fix flaky test of timer_create_multiple in L.
2015-06-19 18:40:59 +00:00
David Srbecky
c08c88b5fc Merge "Add flag that makes linker honor min(p_vaddr)" into mnc-dev 2015-06-19 18:26:21 +00:00
Yabin Cui
0f455612d3 Merge "Fix flaky test of timer_create_multiple in L." into lollipop-mr1-cts-dev 2015-06-19 18:00:53 +00:00
Yabin Cui
410c1adf5f Fix flaky test of timer_create_multiple in L.
Bug: 20677618
Change-Id: I0cb5faf77edce042b10611543180f3e2e73d3d05
2015-06-18 16:19:02 -07:00
Dmitriy Ivanov
34e8e47d32 Add flag that makes linker honor min(p_vaddr)
(cherry picked from commit 8a11628355)

Bug: 21924613
Bug: http://b/21523078
Change-Id: I3f944a08dd2ed1df4d8a807da4fee423fdd35eb7
2015-06-18 23:58:34 +01:00
Christopher Ferris
7d6410e957 Merge "[MIPS] Add optimized string functions" into mnc-dev 2015-06-18 00:18:40 +00:00
Nikola Veljkovic
1d824c3912 [MIPS] Add optimized string functions
Use same string functions for all MIPS architectures.

Bug: 21555893
(cherry picked from commit 38f2eaa07b)

Change-Id: I94521f023d0bb136a4672782148a9f6e77cc6f1e
2015-06-17 17:02:11 -07:00
Dmitriy Ivanov
28154f5c56 Improve library lookup logic
Linker tries to open a library even if it can
be found by soname. This only happens if the
library was previously opened under different
target sdk version.

Bug: http://b/21876587
Bug: http://b/21153477
Bug: http://b/21171302
Bug: https://code.google.com/p/android/issues/detail?id=160921
Change-Id: I7dbbcc3b49933bffd89ca0af55371e1a1f2bf4c2
2015-06-17 16:36:03 -07:00
Dmitriy Ivanov
4d0d31475f Add versions to libm.so symbols
Bug: http://b/20139821
Change-Id: Ifdfcac62d59eb8f0985990aa8512046ecb87449e
(cherry picked from commit 636f5ddddc)
2015-06-17 13:50:37 -07:00
Dimitry Ivanov
6b37515c38 Merge "Revert "Improve library lookup logic"" into mnc-dev 2015-06-17 20:43:23 +00:00
Dimitry Ivanov
1eba2f4ce1 Revert "Improve library lookup logic"
This reverts commit ea4ef52fa4.

Bug: http://b/21876587
Bug: http://b/21153477
Bug: http://b/21171302
Bug: https://code.google.com/p/android/issues/detail?id=160921
Change-Id: I23ddbd69294023c56c9cbabad29d26c8f736ab43
2015-06-17 20:42:20 +00:00
Dmitriy Ivanov
462df82902 Merge "Improve library lookup logic" into mnc-dev 2015-06-17 17:15:06 +00:00
Elliott Hughes
d49850d6ab Fixes for building gdbserver (and gdb) out of the box.
Bug: http://b/21695943
Change-Id: Iadb600b2ae619515d7038a4db9bf464ba31adb36
(cherry picked from commit 895241efbb)
2015-06-16 16:59:49 -07:00
Dmitriy Ivanov
ea4ef52fa4 Improve library lookup logic
Linker tries to open a library even if it can
be found by soname. This only happens if the
library was previously opened under different
target sdk version.

Bug: http://b/21876587
Bug: http://b/21153477
Bug: http://b/21171302
Bug: https://code.google.com/p/android/issues/detail?id=160921
Change-Id: I769a04b6b1368a107d43f399297be14050338bbc
2015-06-16 16:52:21 -07:00
Tim Murray
848276051a Merge "Add support for cortex-a53 in bionic." into mnc-dev 2015-06-16 20:47:17 +00:00
Tim Murray
c34df8b280 Add support for cortex-a53 in bionic.
allows -mcpu=cortex-a53 to be passed as part of a command line.

Change-Id: Id4203a9fd197f4c3b661bad21ac58c32819fd687
2015-06-16 13:43:19 -07:00
Dmitriy Ivanov
420574690c Add version to libc.so symbols
Bug: http://b/21617095
Bug: http://b/20139821
Change-Id: If3d42d2a0b4a0c49721fd9b9ecbb4f7bee5a1eff
(cherry picked from commit 665607a6b7)
2015-06-16 11:08:01 -07:00
Elliott Hughes
929be68849 Hide accidentally-exposed __clock_nanosleep.
Bug: http://b/21858067
Change-Id: Iaa83a5e17cfff796aed4f641d0d14427614d9399
(cherry picked from commit b1304935b6)
2015-06-16 10:44:24 -07:00
Elliott Hughes
f1c85411a8 Avoid name collision with user_fpsimd_state in <asm/ptrace.h>.
We don't want to use <asm/ptrace.h> because (a) it'll drag in a bunch of
namespace pollution and (b) the registers should be "long double" for
userspace, not the kernel's uint128s. So just use a slightly different
name for our struct (which matches the traditional names for these structs
anyway).

Bug: http://b/21695943
Bug: https://code.google.com/p/android/issues/detail?id=86712
Change-Id: I8812ca98cfe6b649dbd31f7d6aea41928ba2acbd
(cherry picked from commit 0577733c2e)
2015-06-15 19:02:40 -07:00
Dan Albert
cce405a134 Add a sys/procfs.h.
Needed for building gdbserver out of the box.

Bug: http://b/21695943
Bug: https://code.google.com/p/android/issues/detail?id=86712
Change-Id: Ieadda2b595f08bfddfa61fcd68006b8e7c1a438d
(cherry picked from commit bf18c61798)
2015-06-15 18:39:02 -07:00
Elliott Hughes
7051c0f2a5 Fix two accidentally leaked mips64 symbols.
Bug: http://b/21857154
Change-Id: Ie1fb63f54c6c527b8c1172e8f6ce48f23fca9b41
(cherry picked from commit 469b418784)
2015-06-15 18:36:48 -07:00
Sharvil Nanavati
fdcaeac1a9 am 00cef820: am 64e9e71c: Define nonportable pthread mutex macros with the _NP suffix.
* commit '00cef82013c0826bb43c11651d25de8b99335618':
  Define nonportable pthread mutex macros with the _NP suffix.
2015-06-15 15:48:00 +00:00
Dmitriy Ivanov
3e6f780754 Remove text-relocs support for apps targeting M+
Remove support of text-relocations for apps targeting sdk version > 22

Bug: http://b/20013628
Change-Id: I2127739544480c747315e32df15dfbd1b79de4f5
2015-06-12 15:09:54 -07:00
Sharvil Nanavati
00cef82013 am 64e9e71c: Define nonportable pthread mutex macros with the _NP suffix.
* commit '64e9e71cdb7d88397e510e1986d494b797ed3b45':
  Define nonportable pthread mutex macros with the _NP suffix.
2015-06-12 20:13:46 +00:00
Sharvil Nanavati
64e9e71cdb Define nonportable pthread mutex macros with the _NP suffix.
Change-Id: I1066352e5b2607f64daf6aeb0030d0bbe88ead8d
2015-06-12 10:56:17 -07:00
Dmitriy Ivanov
ae1e75458a Merge "Make path to apk compliant with jar url format" into mnc-dev 2015-06-11 21:55:09 +00:00
Dmitriy Ivanov
38263dd91a Fix l_addr for the linker
Bug: http://b/21765603
Change-Id: I97710ef2436eac2160e29ba3e4521f6e63a1907c
(cherry picked from commit 175dae92d7)
2015-06-10 20:05:48 -07:00
Elliott Hughes
25ac753f47 Add process_vm_readv and process_vm_writev.
Bug: http://b/21761353
Change-Id: Ic8ef3f241d62d2a4271fbc783c8af50257bac498
(cherry picked from commit be57a40d29)
2015-06-10 18:55:06 -07:00
Elliott Hughes
eeb1d33a31 Merge "Statically linked executables should honor AT_SECURE." into mnc-dev 2015-06-11 00:55:40 +00:00
Dmitriy Ivanov
79b3877a13 Fix application_sdk_versions_smoke test
Bug: http://b/21364029
Change-Id: I9716d6b0ea7fae6483629a290dbe695b68526588
2015-06-10 16:55:50 -07:00
Elliott Hughes
66c3b2db2f Statically linked executables should honor AT_SECURE.
Bug: http://b/19647373
Change-Id: I10e7682d9cec26a523f1a3597ca5326c3ca42ebe
(cherry picked from commit 1801db3d3f)
2015-06-10 16:10:18 -07:00
Dmitriy Ivanov
07f4f5f9ed Check if strtab exists before using it
Bug: http://b/21696087
Change-Id: I1e22d5fd6fe2faead332249493123c9a085081e9
(cherry picked from commit 624b8f17a1)
2015-06-10 15:25:48 -07:00
Christopher Ferris
511cfd9dc8 Allow NULL in pthread_mutex_lock/unlock.
The pthread_mutex_lock and pthread_mutex_unlock were allowed to
fail silently on L 32 bit devices when passed a NULL. We changed
this to a crash on 32 bit devices, but there are still games that make
these calls and are not likely to be updated. Therefore, once again
allow NULL to be passed in on 32 bit devices.

Bug: 19995172
Change-Id: If7e8860075ecd63c0064d80f64e226fad7bd3c26
2015-06-09 18:46:15 -07:00
Dmitriy Ivanov
524f1f1efe Make path to apk compliant with jar url format
Bug: http://b/21726698
Bug: http://b/8076853
Change-Id: I8c1942a98fe3119746b4dc9f60a7ff215ea7009c
2015-06-09 13:47:46 -07:00
Ying Wang
26e663d479 Fix Mac checkbuild.
Bug: 21669400
Change-Id: I54691661605a2e2c1871781964aed343840b8560
(cherry-pick from commit 33c2d441b8)
2015-06-08 12:20:16 -07:00
Christopher Ferris
e49af9bca5 Export two dlmalloc functions everywhere.
The functions dlmalloc_inspect_all and dlmalloc_trim get
exported on devices that use dlmalloc, so be consistent and
export them everywhere.

Bug: 21640784
(cherry picked from commit f9554a1776)

Change-Id: I1000221423c16c356bb6301e55f726db01c3f209
2015-06-06 13:25:56 -07:00