Commit Graph

35632 Commits

Author SHA1 Message Date
Jiyong Park e6474b7fa2 Don't rely on transitively included headers
One must explicitly include what it need.
time.h for clock_gettime

Bug: 37629934
Test: build
Merged-In: I992eac637f373b204aa161b0b26f5563e952c27e
Change-Id: I992eac637f373b204aa161b0b26f5563e952c27e
2017-09-06 15:30:32 +09:00
TreeHugger Robot 2d3cf6799e Merge "templatize ld.config.txt" into oc-mr1-dev 2017-09-01 03:23:17 +00:00
TreeHugger Robot 7e929121b1 Merge "Revert "adbd: lessen security constraints when the device is unlocked"" into oc-mr1-dev 2017-09-01 01:30:51 +00:00
TreeHugger Robot d9d20baf6f Merge "libz is back to LLNDK" into oc-mr1-dev 2017-09-01 00:39:14 +00:00
Jiyong Park 367984602a 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.
Change-Id: I8170e6c3f6ee04b16359791d64cc46bd2714a073
2017-09-01 07:53:56 +09:00
Jiyong Park 697eb2da0d libz is back to LLNDK
For 2016 pixel devices, where VNDK is not fully enforced, move libz back
to LLNDK so that we can pass the CTS without requiring the default
namespace to be isolated.

If we have libz in vndk-sp directory, test_linker_namespaces fails
because /system/lib/vndk-sp/libz.so becomes accessible. In order to make
the lib inaccessible, we have to make the default namespace isolated,
but this can't be done for 2016 pixel devices where VNDK is not fully
enforced. So, we choose to remove /system/lib/vndk-sp/libz.so and keep
the single copy at /system/lib.

Bug: 65018779
Test: android.jni.cts.JniStaticTest#test_linker_namespaces successful on
2016 pixel devices

Change-Id: Ib6b6560b02be69d2015c0afb86acf07c02b30c2f
2017-08-31 22:11:35 +09:00
Bowgo Tsai 9fa61b4df3 Revert "adbd: lessen security constraints when the device is unlocked"
This reverts commit f1d3dbc32f.

With the following changes to move /sbin/adbd to /system/bin/adbd,
we don't need this workaround anymore.

  https://android-review.googlesource.com/#/q/topic:move-adbd-to-system+(status:open+OR+status:merged)

Bug: 63313955
Bug: 63381692
Bug: 64822208
Test: 'adb root' works in VTS for a non-A/B device (userdebug GSI + user boot.img)

Change-Id: Ic1249d6abd7d6e6e7380a661df16d25447853a48
Merged-In: Ic1249d6abd7d6e6e7380a661df16d25447853a48
(cherry picked from commit 0603ec4294)
2017-08-31 16:26:49 +08:00
Jiyong Park 55f05d79f9 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
Change-Id: I2bbe9cc19940c3633c2fb901f9bf8ab813e38c13
2017-08-31 11:52:03 +09:00
Josh Gao a2f1335819 adbd: don't spin if file sync read fails.
Bug: http://b/64508974
Bug: 64709603 (presubmit balking at the line above)
Test: mma
Change-Id: Ifba6a9dea3138b6d2a62c91cc0532f63986c048a
(cherry picked from commit 1d6c01b53d)
2017-08-29 18:54:19 +00:00
Alan Stokes 15e5bd4e2b Merge "Reading from logd in WRAP mode is expected to take a long time, don't abort it after 30s." into oc-mr1-dev 2017-08-29 16:39:52 +00:00
TreeHugger Robot c3090ba2f4 Merge "init.rc: Lock down access to /proc/net/fib_trie" into oc-mr1-dev 2017-08-28 14:36:02 +00:00
Robert Benea 719e71095f Merge "Detect critical preassure" into oc-mr1-dev 2017-08-27 19:52:48 +00:00
Robert Benea c47f2992b5 Detect critical preassure
When close to oom the system tend to become very thrashy
and keeps paging. This change looks at the current working sent and
checks it against swap.

Test: tested on gobo
Bug: 64721547

Change-Id: I93d42def93cbc03a01a54988fd5286ec9f124e36
2017-08-25 19:01:54 -07:00
Nick Kralevich 15ffc53f6d init.rc: Lock down access to /proc/net/fib_trie
Make /proc/net/fib_trie only readable to root.

Bug: 31269937
Test: Device boots, file has appropriate permissions.
Change-Id: I0d01ce5c043d576344a6732b0b9ff93d62fcaa34
2017-08-25 12:55:52 -07:00
Alan Stokes e0515d6dba Reading from logd in WRAP mode is expected to take a long time,
don't abort it after 30s.

Adds a new CTS test to verify the behaviour.

Bug: 64143705
Test: New and existing CTS tests pass. Manual testing with logcat.

(cherry picked from commit 64acdf77d6)

Change-Id: Ic2ec131a3aee293ee865c46e62566ddd82ec2507
2017-08-25 18:21:36 +01:00
Justin Yun 3094de9684 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
Change-Id: I99ed37eb1a9e92c83533e2d92c9c06db11f01e97
2017-08-25 12:30:44 +09:00
TreeHugger Robot feee3cce8a Merge "fastboot: bail out if failed to generate fs image" into oc-mr1-dev 2017-08-23 23:28:14 +00:00
Jin Qian f0ecf57e56 fastboot: bail out if failed to generate fs image
we don't want to continue fastboot process if failed to
generate fs image. Print an error message and exit early.

Bug: 64915319
Change-Id: I5506d2a7a5063c188685633d6c3890239f9d658e
2017-08-23 13:58:47 -07:00
TreeHugger Robot 9495196e20 Merge "Move trusty reference implementations to /vendor" into oc-mr1-dev 2017-08-23 02:09:07 +00:00
Justin Yun 24c29f1be4 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

Change-Id: If9778b9266a084846ba8fe73e6bff25828359d33
2017-08-22 13:40:22 +09:00
Hung-ying Tyan 063a3fa4d2 Move trusty reference implementations to /vendor
Trusty implementations are provided by vendors. This patch moves
the AOSP reference implementations to the vendor partition.

Bug: 63085384
Test: Build gordon_peak which adopts trusty as the TEE and confirm
      that libtrusty and gateway.trusty are moved to /vendor.
Test: Build marlin which does not adopt trusty as the TEE and confirm
      that this patch has no effect on the build result.
Test: mmm BOARD_VNDK_VERSION=current system/core/trusty
Change-Id: I7f6d897b86c69d06923a18d28154760e006dd193
2017-08-22 11:23:45 +08:00
Andreas Huber b9beeed5a3 Fix use-after-free of stack-allocated temporary string.
Bug: 64848081
Test: built and successfully booted again
Merged-In: I93c899249bf2cc5ab8d880c0eaff471518e73121

Change-Id: I08e6f71a7c5151544b9434eb0d362a236202cd31
2017-08-21 15:54:43 -07:00
Andrew Hsieh 202fedd1fe Merge "gatekeeperd: use std::unique_ptr" into oc-mr1-dev 2017-08-18 19:12:16 +00:00
Justin Yun 2c9140f54e Make libvndksupport look for default namespace as well.
In vendor process, libvndksupport must look for "default" namespace,
instead of "sphal" namespace to open hal libraries.

Bug: 63411330
Test: Boot the device.
Change-Id: I26208b6f47708f83e0679fd72ca7471ade84fff9
2017-08-18 15:20:20 +09:00
TreeHugger Robot 0bb4cb6fa2 Merge "Move adbd from root to system" into oc-mr1-dev 2017-08-18 03:52:36 +00:00
TreeHugger Robot f34814e06c Merge "Make the rs namespace visible" into oc-mr1-dev 2017-08-18 03:07:50 +00:00
TreeHugger Robot d14e75d43e Merge "fastboot: Add --disable-verity and --disable-verification options." into oc-mr1-dev 2017-08-18 01:34:50 +00:00
Justin Yun 68b0ec6487 gatekeeperd: use std::unique_ptr
std::unique_ptr is available in this scope. Substitue the UniquePtr to
std::unique_ptr.

Bug: 63686260
Test: build and boot
Change-Id: Ib8ea3fb5c49c0e92d962f65f1139b073168f8698
2017-08-17 14:58:23 +09:00
David Zeuthen 34c001bff2 fastboot: Add --disable-verity and --disable-verification options.
This can be used to disable verity and/or verification when flashing a
build to a device. It works with both 'fastboot flashall' and
'fastboot flash vbmeta /path/to/vbmeta.img'.

Bug: 62903976
Test: Manually tested.
Merged-In: Iad22d42a9dd5befd70ecd0224803721a10a28d90
Change-Id: Iad22d42a9dd5befd70ecd0224803721a10a28d90
(cherry picked from commit b6ea435a20)
2017-08-17 09:28:53 +08:00
Jiyong Park 421a5e46b7 Make the rs namespace visible
This allows us to dlopen libRS_internal.so directly from the rs
namespace, not from the sphal namespace.

Bug: 64747884
Test: VtsHalRenderscriptV1_0TargetTest successful on the device built
with BOARD_VNDK_VERSION=current and [system] namespace config is applied
to /data/nativetest[64]/* processes.

Change-Id: I0b441791e395798e80a84592ca01e771bb1c201a
2017-08-16 23:32:54 +09:00
Narayan Kamath b669c3311b Merge "zip_archive: reject files that don't start with an LFH signature." into oc-mr1-dev 2017-08-16 13:58:49 +00:00
Christopher Ferris 0ef26c63da Merge "Decrease size of LogBufferElements to 32 bytes." into oc-mr1-dev 2017-08-15 23:54:30 +00:00
TreeHugger Robot 46691ee85c Merge "Remove nvram trusty implementation." into oc-mr1-dev 2017-08-15 23:46:44 +00:00
Elliott Hughes 2e93eda69c Don't include the build number in the adbd binary.
We want repeatable builds for minimal OTAs.

Bug: http://b/64634017
Bug: 64709603 (presubmit balking at the line above)
Test: repeated builds after `touch daemon/main.cpp` keep same md5sum
Change-Id: Iedeb44377ea45bbf20e2212760802198a57dc14a
2017-08-15 20:07:04 +00:00
Christopher Ferris 2cf55995a1 Decrease size of LogBufferElements to 32 bytes.
- Remove virtual from the destructor.
- Remove mTag and derive it when calling getTag().
- Add a boolean mDropped to tell when a message is dropped.
- When dropping a message, and it contains valid tag data, reallocate
  the message to only contain the tag data.
- Add the packed tag to the class.

This saves about ~150K of PSS on a typical log stream since it moves the
size of the LogBufferElement from 48 bytes to 32 bytes which puts it in
a smaller bin.

Bug: 63792187

Test: Builds, unit tests pass.
Change-Id: Ia5afce343ea3d344fcecd78c648338e94f5c9312
(cherry picked from commit 74e74f96a7)
2017-08-15 13:03:13 -07:00
Narayan Kamath c1a56dcab7 zip_archive: reject files that don't start with an LFH signature.
Bug: 64211847
Test: zip_archive_test

Change-Id: I275e7c4da05ceeb20401b560c72294f29ef63642
2017-08-15 13:44:05 +01:00
Hung-ying Tyan 98a48d8e4b Remove nvram trusty implementation.
Bug: 64705490
Test: build pass
Change-Id: I32a1565ec935fff1c45540442134a37b55702752
2017-08-15 18:52:42 +08:00
TreeHugger Robot f7ad622264 Merge "Mark libsync as LL-NDK" into oc-mr1-dev 2017-08-15 10:23:26 +00:00
TreeHugger Robot acda9cba2e Merge "Add libft2.so to ll-ndk for rs namespace" into oc-mr1-dev 2017-08-15 10:16:17 +00:00
TreeHugger Robot 5f89f548fe Merge "Improvements to lmkd" into oc-mr1-dev 2017-08-15 00:47:44 +00:00
Josh Gao 68995633a9 debuggerd_handler: print pid and process name.
am: 30b69aab46

Change-Id: Iac44ddf6f6b4a1d4e4f3f8132280c437fdb7e43e
2017-08-14 18:06:26 +00:00
Bowgo Tsai 93defc17f3 Move adbd from root to system
Bug: 63910933
Test: normal boot sailfish, checks adb works
Test: recovery boot sailfish, checks adb works
Test: normal boot bullhead, checks adb works
Test: recovery boot bullhead, checks adb works

Change-Id: I1b27910c06a4172ca718b3344736ec8e3429f477
2017-08-14 17:59:08 +08:00
Jiyong Park 058e0919f6 Mark libsync as LL-NDK
libsync is used both by platform (e.g. libui.so) and by same-process
HALs (e.g. android.hardware.graphics.mapper@2.0-impl.so). Therefore it
is eligible for either VNDK-SP or LL-NDK. Among the two choices, LL-NDK
was selected because it is already an NDK and is just a thin wrapper
around a few kernel ioctls.

However, since libui (which is a vendor_available:true library) is using
more symbols that are not available to NDK clients, the extra symbols
are exposed as # vndk tag so that they are only available to VNDK
clients, but not to NDK clients.

Bug: 63866913
Test: BOARD_VNDK_VERSION=current m -j successful (2017 pixel)
Test: the built image is bootable
Change-Id: I60f883c049bd9b4562e6ce34d34ead47ba28af5f
2017-08-14 15:28:11 +09:00
Justin Yun 513f76394a Add libft2.so to ll-ndk for rs namespace
libft2.so is changed to ll-ndk that is available only for rs
namespace.

Bug: 64425518
Test: build and boot with BOARD_VNDK_VERSION=current
Change-Id: I991dc774ca9b92fb6e95a7656243a6a4ecdc0ab9
2017-08-14 12:18:29 +09:00
Josh Gao 30b69aab46 debuggerd_handler: print pid and process name.
Bug: http://b/64483618
Test: manual

(cherry picked from commit 81e6c0b613)

Change-Id: Icd957ccd21c2ce072f4cdf973b94de08fb0c5567
2017-08-11 22:01:36 -07:00
Robert Benea caeaa655c1 Improvements to lmkd
- Don't show misleading messages, add the correct description for
  the reason of process killing
- Don't kill Launcher3 upgrade the score to perceptible (200)
- Limit the verbose logging

Test: tested on gobo
Bug: 64316273
Change-Id: Ic7c13853d939afe4f20cdaa5b488b6e1810f5ddf
2017-08-11 16:13:57 -07:00
Justin Yun 077dc8fca4 Mark libziparchive as VNDK in Android.bp
As a VNDK module, Android.bp must have 'vndk' tag as well as
'vendor_available: true'.

The 'vndk' tag for VNDK module is formated as below:
vndk: {
    enabled: true,
},

VNDK modules will be installed both in system/lib(64) as normal and
in system/lib(64)/vndk as a vendor variant.

Bug: 63866913
Test: build and boot with BOARD_VNDK_VERSION=current
Change-Id: Iec5d3496e91a99f3e6b0c816c67ad279672ff36a
2017-08-12 00:52:14 +09:00
TreeHugger Robot 28d4818037 Merge "Move libz vndk-sp from ll-ndk" into oc-mr1-dev 2017-08-11 15:13:42 +00:00
Hung-ying Tyan 5505eb783b Revert "Move trusty reference implementations to /vendor"
The CL is not complete and will cause build break when BOARD_VNDK_VERSION is set.

This reverts commit 7d81b4e081.

Change-Id: If9632fb7ee8147c39f1ad0860ddc3bed62ba89db
2017-08-11 08:02:21 +00:00
Justin Yun dadd3a846f Move libz vndk-sp from ll-ndk
The ABI of libz is not as stable as it is for ll-ndk.

Bug: 37617391
Test: build and boot
Change-Id: I883bc6fda268e98cc7cdd5888264170c58688794
2017-08-10 17:39:30 +09:00