Commit graph

36388 commits

Author SHA1 Message Date
Treehugger Robot
b409e5e00b Merge "init: call umount unconditionally" 2017-10-24 02:07:48 +00:00
Jake Weinstein
60bc597183 Remove Foreground Boost CPUSet
This functionality was removed at
https://android.googlesource.com/platform/frameworks/base/+/a712d4058f6f85268838
2017-10-23 20:07:22 -04:00
Wei Wang
25dc30f3be init: call umount unconditionally
std::all_of is using std::find_if, which means, if any element the given
predicate returns false, it stops further iteration and just returns false.
std::all_of used in Reboot.cpp will cause umount not to be called on all
block devices if some block device returns false in the middle.

Bug: 68158923
Test: reboot
Change-Id: I43ba6bd0c18018c1ed5fe2b63996552bc51cc67c
2017-10-23 16:25:31 -07:00
Christopher Ferris
2502a60ea1 If the pc is set to zero, the unwind is done.
Bug: 68047085

Test: Ran new unit tests, verified new unwinder does not show an
Test: extra pc zero frame for arm 32 bit processes.
Change-Id: Ic6532e56fbb786a8b7d41638abae777c2d0f1d59
2017-10-23 14:55:16 -07:00
Josh Gao
1f3763ef4a Merge "adb: fix erase-remove_if idiom."
am: c2a2ecb7a5

Change-Id: I98bc2547b3785d8ca14565a6a9b7fac84a7c673e
2017-10-23 21:36:22 +00:00
Treehugger Robot
c2a2ecb7a5 Merge "adb: fix erase-remove_if idiom." 2017-10-23 21:28:32 +00:00
Dan Albert
f281046ed4 Merge "Add missing includes."
am: 74e7c2f4bd

Change-Id: Ib878fd45e2ab1b23e0276adb59ff66c9bbf5e7f8
2017-10-23 20:54:28 +00:00
Treehugger Robot
74e7c2f4bd Merge "Add missing includes." 2017-10-23 20:49:56 +00:00
Mark Salyzyn
5966ae2c6b Merge changes I3e6e5a22,I6eb3f066
am: 75836d5e7f

Change-Id: I871260b9cdf7a1ab5f6d39cd8a491cd31cd94a4d
2017-10-23 20:45:02 +00:00
Treehugger Robot
75836d5e7f Merge changes I3e6e5a22,I6eb3f066
* changes:
  adb: cleanup some portions of client usb interfaces
  adb: clang-format for adb.h and client/usb_windows.cpp
2017-10-23 20:35:28 +00:00
Christopher N. Hesse
bdee15ef71 Merge "libcutils: Fix thread ID on macOS"
am: 6958506e82

Change-Id: If328ec31ff2d52b0852fb8e2eb2e061564504586
2017-10-23 20:32:47 +00:00
Treehugger Robot
6958506e82 Merge "libcutils: Fix thread ID on macOS" 2017-10-23 20:28:26 +00:00
Christopher Ferris
8883b4a06f Merge "Multiple bugfixes, small restructuring."
am: 26b614ddf6

Change-Id: I7a44bbfe9f43981031fc6cc84de08cef79d78e78
2017-10-23 19:22:11 +00:00
Christopher Ferris
26b614ddf6 Merge "Multiple bugfixes, small restructuring." 2017-10-23 19:16:13 +00:00
Jae Shin
a909e5e2a1 Merge changes from topic "rs_vndk_step2"
am: 678efa25a6

Change-Id: Idcab36c112406e3dc1fe4eb9cfd5c345cafc0290
2017-10-23 03:03:05 +00:00
Jiyong Park
324f3ed393 templatize ld.config.txt
am: ecc703c792

Change-Id: Ic9dc2f35a4a9a2c2a56cb24a9ac02e9373ed78df
2017-10-23 03:02:31 +00:00
Jiyong Park
6683a8735b Make default namespace for system processes isolated
am: 246338f90e

Change-Id: I2f2d2799ab57031a3c3b24830c0e10376e035acd
2017-10-23 03:01:58 +00:00
Justin Yun
e96c957e57 vndk: add vendor/lib(64)/vndk for vendor namespace
am: b5ddc5ae6b

Change-Id: I1e22e9a994932e3e93cbbafb8d5defd5efd69b7c
2017-10-23 03:01:12 +00:00
Justin Yun
c82e43034b Implement system namespace for vendor process
am: 333845c710

Change-Id: I0fda3fe689832b0b5cc13a381dacdd633886e27a
2017-10-23 03:00:13 +00:00
Jiyong Park
6d9f5e4012 Use the legacy linker namespace configs when target is sanitized
am: 614c5521a3

Change-Id: I80ff3cb047a9ad351590524a5602cdc0f9df3e61
2017-10-23 02:59:15 +00:00
Jiyong Park
b9d74495b1 Permit /system/lib/vndk-sp/hw/ for 'sphal' namespace
am: b5c0fc3ceb

Change-Id: Ic74e02582c7c2f5b7e9900bf77026168a2947fd2
2017-10-23 02:57:57 +00:00
Justin Yun
1cd1a2b812 Add system/${LIB}/vndk to default namespace for vendor.
am: e373672afd

Change-Id: I4f4e47bb297ec604f79007260883112da5de67e1
2017-10-23 02:56:40 +00:00
Jiyong Park
8b8c187ba2 Add [test] section for /data/[nativetest|benchmarktest]
am: c8ae86afdd  -s ours

Change-Id: I271a1ad9a3fc22ef055df3ca4509447cc8e1a8b0
2017-10-23 02:55:14 +00:00
Jae Shin
678efa25a6 Merge changes from topic "rs_vndk_step2"
* changes:
  fix: boot fails on ASAN builds with VNDK restriction
  templatize ld.config.txt
  Make default namespace for system processes isolated
  vndk: add vendor/lib(64)/vndk for vendor namespace
  Implement system namespace for vendor process
  Use the legacy linker namespace configs when target is sanitized
  Permit /system/lib/vndk-sp/hw/ for 'sphal' namespace
  Add system/${LIB}/vndk to default namespace for vendor.
  Add [test] section for /data/[nativetest|benchmarktest]
  /data/nativetest[64] processes are running with the new ns config
2017-10-23 02:43:52 +00:00
Jiyong Park
257de3def5 fix: boot fails on ASAN builds with VNDK restriction
Fix the bug that caused boot failure on ASAN builds with VNDK
restriciton. The major cause is because incorrect (old) ld.config.txt
was used when the build is sanitized, which prevented the dynamic linker
to find some VNDK libs that only exist in /system/lib/vndk; the old
ld.config.txt does not have the directory in its search paths. So, this
CL fixes the problem by having the same ld.config.txt for both sanitized
and non-sanitizied builds.

Furthermore, ld.config.txt is modified so that dependency to
libclang_rt* libs are redirected to those in /system/lib directory. This
ensures that the sanitizer runtime libs are not dual loaded but are
provided for both platform and vendors.

Bug: 65217017
Test: SANITIZE_TARGET=integer_overflow SANITIZE_TARGET_DIAG=integer_overflow m
on 2017 pixel devices. The build is successful and the device boots to
the UI.

Merged-In: I0e21e20d9aca340b984968e07d4ce542ae10fd31
Change-Id: I0e21e20d9aca340b984968e07d4ce542ae10fd31
(cherry picked from commit faefa6bd36)
2017-10-23 02:42:47 +00:00
Jiyong Park
ecc703c792 templatize ld.config.txt
Lists of libraries in between the linker namespaces are no longer
hard-coded in ld.config.txt, but instead come from Soong.

Bug: 37139976
Test: build 2017 pixel device with BOARD_VNDK_VERSION=current m -j
Test: the device is bootable, basic functionalities (camera, camcorder,
wifi, bt, gps, etc.) work.
Merged-In: I8170e6c3f6ee04b16359791d64cc46bd2714a073
Change-Id: I8170e6c3f6ee04b16359791d64cc46bd2714a073

(cherry picked from commit 367984602a)
2017-10-23 02:40:37 +00:00
Jiyong Park
246338f90e Make default namespace for system processes isolated
The default namespace for system process now becomes isolated, which
means it can load only the libs that are in search.paths and under
permitted.paths.

/system/framework, /system/app, /system/priv-app, /vendor/app, /data,
etc are added to the permitted paths since libart should be able to
dlopen odex files under the locations.

Following directories become unavailable:
/system/lib/vndk
/system/lib/vndk-sp

Bug: 37013858
Bug: 64888291
Bug: 64950640
Test: 2017 pixel devices builds and boots
Test: android.jni.cts.JniStaticTest#test_linker_namespaces passes
Merged-In: I2bbe9cc19940c3633c2fb901f9bf8ab813e38c13
Change-Id: I2bbe9cc19940c3633c2fb901f9bf8ab813e38c13
(cherry picked from commit 55f05d79f9)
2017-10-23 11:10:32 +09:00
Justin Yun
b5ddc5ae6b vndk: add vendor/lib(64)/vndk for vendor namespace
When the vndk is extended by vendor, the libs in vendor/lib(64)/vndk
will override system/lib(64)/vndk libs. Vendor binaries will search
vndk libs in vendor/lib(64)/vndk prior to system/lib(64)/vndk.

Also, remove a workaround for libsdm-color.so

Bug: 65032513
Test: build and boot check for libsdm-color.so will be loaded on boot
Test: currently no libs exist on vendor/lib(64)/vndk. No test for it
Merged-In: I99ed37eb1a9e92c83533e2d92c9c06db11f01e97
Change-Id: I99ed37eb1a9e92c83533e2d92c9c06db11f01e97
(cherry picked from commit 3094de9684)
2017-10-23 11:10:31 +09:00
Justin Yun
333845c710 Implement system namespace for vendor process
For vendor process default namespace searches as following order:
1. /vendor/lib/(hw|egl), /vendor/lib: Vendor libs + VNDK-vnd-ext
2. /system/lib/vndk-$(ver): VNDK libs
3. /vendor/lib/vndk-sp-$(ver): VNDK-SP-vnd-ext
4. /system/lib/vndk-sp-$(ver): VNDK-SP
and searches system namespace (/system/lib) only for LL-NDK libs.
This configuarion is used only with BOARD_VNDK_VERSION is defined.

Bug: 37192038
Test: build with 'BOARD_VNDK_VERSION=current' and boot

Merged-In: If9778b9266a084846ba8fe73e6bff25828359d33
Change-Id: If9778b9266a084846ba8fe73e6bff25828359d33
(cherry picked from commit 24c29f1be4)
2017-10-23 11:10:30 +09:00
Jiyong Park
614c5521a3 Use the legacy linker namespace configs when target is sanitized
The new linker namespace config causes problem when the target is
sanitized: vendor libs which are loaded in the sphal namespace can't
link against to libclang_rt* libs which are in /system/lib directory
because the directory is not allowed for sphal namsapce.

Long-term solution would be installing libclang_rt* to both /system/lib
and /vendor/lib so that vendor libs can link against to the one in
/vendor/lib.

Until the work is done, let's just disable the new linker namespace
config when the target is to be sanitized.

Bug: 63535130
Test: make SANITIZE_TARGET=integer_overflow
SANITIZE_TARGET_DIAG=integer_overflow builds and boots to the UI

Merged-In: I6afb69885aaa3d25e554b9ca699a572248bfc50a
Change-Id: I6afb69885aaa3d25e554b9ca699a572248bfc50a
(cherry picked from commit fff6f75fc1)
2017-10-23 11:10:29 +09:00
Jiyong Park
b5c0fc3ceb Permit /system/lib/vndk-sp/hw/ for 'sphal' namespace
android.hidl.memory@1.0-impl.so is a SP-HAL located in
/system/lib/vndk-sp/hw. This can't be moved to /vendor/lib since it is a
framework HAL.

Bug: 62930720
Test: 2017 pixel builds and boots with BOARD_VNDK_VERSION on
Merged-In: I9c456983ef68120c5e8c629efc6dd66a26220ecb
Change-Id: I9c456983ef68120c5e8c629efc6dd66a26220ecb
(cherry picked from commit 7d4cf3fd33)
2017-10-23 11:10:28 +09:00
Justin Yun
e373672afd Add system/${LIB}/vndk to default namespace for vendor.
With BOARD_VNDK_VERSION=current, vndk libs will be installed in
system/${LIB}/vndk. To make them available for vendor, it must be
added to default namespace.

Bug: 63866913
Test: build and boot with BOARD_VNDK_VERSION=current
Merged-In: I9e467a6125fc89513754b56a2420975559144f98
Change-Id: I9e467a6125fc89513754b56a2420975559144f98
(cherry picked from commit 90a2487776)
2017-10-23 11:10:27 +09:00
Jiyong Park
c8ae86afdd Add [test] section for /data/[nativetest|benchmarktest]
We have both system and vendor tests in the same directory
/data/nativetest. Since we can't distinguish system and vendor tests at
runtime, we choose to run all of them with the legacy namespace
configuration where /system/lib and /vendor/lib are both accessible
without any restriction. Furthermore, /system/lib/vndk-sp is added to
the list of accessible directories for tests since some libs (such as
libion.so) exist only in the directory but not in /system/lib.

This will change in the future when we install system and vendor tests
into different directories (vendor tests goes into ./vendor subdir).
Then, we will run the tests with [system] or [vendor] configurations
depending on their paths.

Bug: 63597267
Test: run bionic-unit-tests
Test: run linker-unit-tests
Merged-In: I810003b2da0b30335200c130f484ea7b041f9f80
Change-Id: I810003b2da0b30335200c130f484ea7b041f9f80
(cherry picked from commit c034a43d44)
2017-10-23 11:10:26 +09:00
Jiyong Park
433fe3a8a2 /data/nativetest[64] processes are running with the new ns config
Native tests under /data/nativetest[64] directory is now running with
the same linker namespace configuration as /system/bin/* processes.

This allows us to stop mimicing the linker namespace configuration of the
/system/bin/* processes using LD_LIBRARY_PATH.

Bug: 63597267
Test: run bionic-unit-tests
Test: run linker-unit-tests
Merged-In: If8e2ed0b8016e4e07bf6829735b8e02f952042d0
Change-Id: If8e2ed0b8016e4e07bf6829735b8e02f952042d0
(cherry picked from commit 9d1e50b809)
2017-10-23 11:10:25 +09:00
Christopher N. Hesse
684b442b9f libcutils: Fix thread ID on macOS
macOS 10.12 / Xcode 8 actively prohibit the syscall(2)
usage.

Change-Id: I91ff16600a76e97d0b9b5db7e8905b969fb3482f
2017-10-22 22:58:41 +02:00
Josh Gao
4dfaa88610 adb: fix erase-remove_if idiom.
This probably doesn't have any actual effect, because there should only
be one smartsocket listener so this will happen to work, but this looks
sketchy.

Test: mma
Test: adb server nodaemon & (sleep 1; adb kill-server)
Change-Id: Id00ab1fc1fc029949c675ae6e3b1a77f3e9e4c69
2017-10-20 18:03:48 -07:00
Josh Gao
6f580d8b84 libunwindstack: add method to iterate across registers.
Add a function to iterate over Regs with a human-friendly name and the
value of the register, to make it easy to string-format registers.

Test: mma
Change-Id: I8f33830fa79b245b5030b7bc9bc3c1c7ced80c75
2017-10-20 13:52:56 -07:00
Josh Gao
ebea0ef256 libbacktrace: expose BacktraceMap's unwindstack::Memory.
Test: mma
Change-Id: Icd2b891b121b90d55e3ac45037a59c24221a2496
2017-10-20 13:52:56 -07:00
Josh Gao
358de18b27 libunwindstack: expose UnwindStackMap::GetFunctionName.
Test: mma
Change-Id: I8736ff5c2ed7c5e64eb68df5f4eccfed614612c7
2017-10-20 13:52:56 -07:00
Josh Gao
45c4a56f1d libbacktrace: expose libunwindstack Unwind routine.
Test: backtrace_test32/64 on hikey960
Change-Id: Iae6e342a8ffd13b4d5f76b39dd434c827f7a4d9e
2017-10-20 13:52:56 -07:00
Christopher Ferris
e69f470933 Multiple bugfixes, small restructuring.
- Move the load bias stored out of ElfInterface into Elf. For the compressed
  sections, the load bias was not the same as the data from the uncompressed
  section.
- Move the initialization of the compressed section into Init. It was too easy
  to forget to call the init of the compressed section.
- Do not automatically add in load bias to the pc before calling ElfInterface
  code. Do all of the pc manipulations in the Elf object.
- Change the interface GetFunctionName code to pass in the load_bias instead
  of modifying the pc inside the code.
- Modify the Step function to pass in the elf offset, not add it to the pc.
  It is necessary to have two different relative values when executing the
  Step: a pc that is relative to the beginning of the elf for the reading data
  the actual instructions when trying to determine if this is in a signal
  frame, and a pc that is relative to the map for finding the appropriate
  unwind information.
- Add a feature to Unwinder so that an unwind can be stopped if it ends up
  in map that has a specified suffix. This is so that the ART unwinding
  code doesn't require skipping the compressed section. Instead, stop at
  if trying to unwind through a known suffix code that means the code is
  in java code. This is important because the compressed section data is
  not only used by the jave compiled code, so that will continue to work.
- Fix tests for restructuring, add new tests for new functionality.

Test: Ran art test 137-cfi using new unwinder as default.
Test: Ran new unit tests.
Change-Id: I42e658c64c5e14f698ba34944a3043afac967884
2017-10-20 11:15:32 -07:00
Tom Cherry
be96bdb09d Merge "init: clean up subcontext_test"
am: 4e2a8e375e

Change-Id: I0ab7401d36d32c5e0df7dc68286117a1ac60d2f8
2017-10-20 14:40:02 +00:00
Tom Cherry
4e2a8e375e Merge "init: clean up subcontext_test" 2017-10-20 14:36:31 +00:00
Steven Moreland
fea6f56069 Merge "init language extension for lazy HIDL services."
am: 0f40200577

Change-Id: I7b42d2b6af8c9d53a7adb97643d040037ab96b00
2017-10-20 06:43:34 +00:00
Treehugger Robot
0f40200577 Merge "init language extension for lazy HIDL services." 2017-10-20 06:38:42 +00:00
Steven Moreland
e055d73396 init language extension for lazy HIDL services.
This associates every service with a list of HIDL services
it provides. If these are disabled, hwservicemanager will
request for the service to startup.

Bug: 64678982
Test: manual with the light service
Change-Id: Ibf8a6f1cd38312c91c798b74574fa792f23c2df4
2017-10-19 20:38:47 -07:00
Josh Gao
e79d41bf0b Merge "liblogcat: avoid double close."
am: 76ecdd6a95

Change-Id: I00e92081207181bd836499fc3c84279ad15a50a0
2017-10-20 02:13:47 +00:00
Josh Gao
76ecdd6a95 Merge "liblogcat: avoid double close." 2017-10-20 02:07:28 +00:00
Tom Cherry
f0b4e4daee Merge "init: add SelabelInitialize() for subcontext"
am: cba7f57119

Change-Id: I0ea0c99c5848aeaa5fd463e347bd76c5b471b7ef
2017-10-20 00:54:39 +00:00
Treehugger Robot
cba7f57119 Merge "init: add SelabelInitialize() for subcontext" 2017-10-20 00:43:29 +00:00