Commit graph

44282 commits

Author SHA1 Message Date
Vic Yang
cc8009ff04 libunwindstack: Move DwarfOp callback table to rodata section
There are currently two copies of DwarfOp callback tables in
data.rel.ro section, and that is 16KB of dirty memory per process on a
64-bit platform.

To reduce memory usage, we introduce a layer of indirection so that
all instances of DwarfOp can share a single callback table.  We also
get rid of the pointers for op names in the callback table so that the
entire table can be placed in rodata section.

Test result shows 1MB saving on cuttlefish, and 750KB saving on a Go
device (32-bit ARM).

Bug: 112073665
Test: Boot on cuttlefish and a Go device.
Change-Id: Idf90a513f37534ab1ef30d5742a9d3ea779f3661
2019-01-24 11:11:15 -08:00
Yabin Cui
c87d1ed611 Merge "Add setuid/setgid capabilities to simpleperf_app_runner." 2019-01-24 18:39:13 +00:00
Treehugger Robot
c1a6554391 Merge "meminfo: Add support to track working set with idle page tracking." 2019-01-24 18:25:10 +00:00
Treehugger Robot
be38989da0 Merge "fs_mgr: overlayfs: test: test mount -o rw,remount command" 2019-01-24 16:26:58 +00:00
Treehugger Robot
8dd6e5922b Merge "libfs_avb: support loading vbmeta structs from any partition" 2019-01-24 16:16:13 +00:00
Christopher Ferris
3c1d6b836a Merge "Fix memory leak in UnwinderFromPid object." 2019-01-24 15:23:09 +00:00
Neil Fuller
48a92d715d Move APEX symlink creation to alternative module
Move APEX symlink creation to alternative module, one that
is targeted at /system not /. Also added comments to reflect
the tenuous connection between the module chosen and the
symlink creation.

Tested with:
rm -rf out/target/product/taimen/system \
  && make droid \
  && ls -l out/target/product/taimen/system/usr

Test: See above
Bug: 122985829
Bug: 123333111
Change-Id: I841dd42827ac2e082505ebf039f40fd394514e54
2019-01-24 13:01:38 +00:00
Treehugger Robot
6b6259a083 Merge "Add search paths for asan build" 2019-01-24 12:23:36 +00:00
Treehugger Robot
24a2c1a70c Merge "Do SetUpDmVerity only once for the same mount point" 2019-01-24 11:06:03 +00:00
Neil Fuller
792fd03955 Merge "Add a symlink for the ICU .dat file" 2019-01-24 10:02:26 +00:00
Bowgo Tsai
278749d74c libfs_avb: support loading vbmeta structs from any partition
This commits adds the following two public functions into
class AvbHandle, and verified by 'libfs_avb_test':

static AvbUniquePtr LoadAndVerifyVbmeta();  // loads inline vbmeta.
static AvbUniquePtr LoadAndVerifyVbmeta(    // loads offline vbmeta.
    const std::string& partition_name, const std::string& ab_suffix,
    const std::string& ab_other_suffix, const std::string& expected_public_key,
    const HashAlgorithm& hash_algorithm, bool allow_verification_error,
    bool load_chained_vbmeta, bool rollback_protection,
    std::function<std::string(const std::string&)> custom_device_path = nullptr);

The first function LoadAndVerifyVbmeta() will be used to replace Open(),
in a separate CL in the future. Many libfs_avb internal utils are added
into avb_util.cpp as well, which are verified by
'libfs_avb_internal_test'.

Bug: 112103720
Bug: 117960205
Test: atest libfs_avb_test
Test: atest libfs_avb_internal_test
Change-Id: I807b8af0b69c9a4511f6f120e9754aca5442830e
2019-01-24 17:43:25 +08:00
Suren Baghdasaryan
7e15ad7ecb Merge changes from topic "revert move sched_policy functions"
* changes:
  DO NOT MERGE: Revert "Add libprocessgroup into VNDK"
  DO NOT MERGE: Revert "libcutils: Move sched_policy functions into libprocessgroup"
  DO NOT MERGE: Revert "Add dependencies on libprocessgroup for sched_policy users"
2019-01-24 06:57:55 +00:00
Sandeep Patil
061b71339c meminfo: Add support to track working set with idle page tracking.
Also adds a tool to make use of this if it exists call 'wsstop'

Bug: 111694435
Test: wsstop -d 3 -n 100 1

Change-Id: I50415f0bdc09c09b5b414cf0e4fff8f2907c5823
Signed-off-by: Sandeep Patil <sspatil@google.com>
2019-01-23 22:53:46 -08:00
Jiyong Park
59e355c441 Add search paths for asan build
Bug: 123292626
Test: aosp_cf_x86_pasan boots
Change-Id: Ifdc86285cbb2d7eb2b1e39983981e7b81aec59c9
2019-01-24 15:08:06 +09:00
Treehugger Robot
ed3f1a584a Merge "Modify mkbootimg.py to support boot image header version 2" 2019-01-24 05:33:53 +00:00
Suren Baghdasaryan
c4a02d25a9 DO NOT MERGE: Revert "Add libprocessgroup into VNDK"
This reverts commit dad4749731.

Reason for revert: Broke AOSP

Change-Id: I019e1226a65b31495984cf47ad471771b4880c45
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2019-01-23 20:44:47 -08:00
Suren Baghdasaryan
b5394db682 DO NOT MERGE: Revert "libcutils: Move sched_policy functions into libprocessgroup"
This reverts commit facd40d0e1.

Reason for revert: Broke AOSP

Change-Id: Id333417d4970ced800ab801bddfed880cafa056d
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2019-01-23 20:44:09 -08:00
Suren Baghdasaryan
1bef8c550c DO NOT MERGE: Revert "Add dependencies on libprocessgroup for sched_policy users"
This reverts commit 02843339f9.

Reason for revert: Broke AOSP

Change-Id: I62f91c0adf440b5da0a145862b04dd27a7016faf
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2019-01-23 20:43:28 -08:00
David Anderson
2e1c5ac5fd Don't error on block size mismatches.
liblp treats the term "block size" ambiguously when it compares the logical
hardware block size with the file system block size (which for all
intents and purposes must be 4K). This warning is thus spurious on
devices with say a 512 logical block size. However, liblp's block size
should at least be a multiple of this, so change the check accordingly.

Bug: 123317012
Test: liblp_test gtest
Change-Id: I0f41f6bae60a512ab8d313e487c28606daa661a6
2019-01-23 19:24:03 -08:00
David Anderson
c98b1efd4c Merge "Expose IsFilePinned through FiemapWriter." 2019-01-24 03:14:55 +00:00
Treehugger Robot
e72308c6b1 Merge "vndk: do not use prebuilt ld.config.<ver>.txt" 2019-01-24 02:47:06 +00:00
Treehugger Robot
a8bd23124c Merge "Added a new socket to Zygote init scripts." 2019-01-24 01:11:58 +00:00
Josh Gao
74ccdf984b adb: convert more stuff to unique_fd.
Test: adb_test
Test: adbd_test
Test: test_device.py
Change-Id: Ie75f0b811d2c75d508e6ecffb40579308f5789d0
2019-01-23 17:11:13 -08:00
LongPing Wei
9f2e84e507 Do SetUpDmVerity only once for the same mount point
SetUpDmVerity won't return true twice for the same partition and it will
leads to failure when verify-boot is enabled on multi-fstab-lines.

Test: make
Change-Id: I5ce35e9c6b2d47fd0f599e36046e1ad2b0a35ffa
2019-01-23 23:30:13 +00:00
Mark Salyzyn
91ed3340d5 fs_mgr: overlayfs: test: test mount -o rw,remount command
WAI: Using mount -o rw,remount command can only work after the
overlays are setup.  After the second 'adb disable-verity' or
'adb remount -R' has been issued; the first only disables
verity and does not setup the backing storage.  If mount remount
command is issued after the first on an overlayfs system, it will
report a r/o filesystem.

Add a test that confirms that at least this supported behavior is
working, we do not test the corner case.

In the case of overlayfs, we have declared we will not support the
mount remount operation until then; we would need to modify toybox
to add logic that resides inside adb remount service.  toybox is
allowed to be adjusted to compile under Android and bionic, but it
is not supposed to have code that is specific to Android.

Fix last test to before this one to move us back into this state.
Fix the adb_sh command parser to handle properly quoting arguments
as it passes them to adb, since we will need it working for this
added test.

Report the product serial number of build description to aid triage.

Test: adb-remount-test.sh
Bug: 109821005
Bug: 122602260
Bug: 123079041
Change-Id: Ida051dbe2a918182db97f0f22f64b299e3c0a068
2019-01-23 14:41:49 -08:00
David Anderson
c7ca3b6760 Expose IsFilePinned through FiemapWriter.
This is needed for gsid to verify whether a file is pinned.

Bug: 122556707
Test: manual test
Change-Id: I662402294028597241ce11f86421f6ebb4a3cd6b
2019-01-23 13:54:19 -08:00
Chris Wailes
e45bda10e2 Added a new socket to Zygote init scripts.
This change adds new socket declarations to the init scripts for the
Zygote processes.  This socket is used for communication between the
System Server and the Blastula pool.

Bug: 68253328
Topic: zygote-prefork
Test: build image; flash device; launch apps
Change-Id: I5dbb87770b1a3100c6c122bb39ca854006bb0b0d
Merged-In: I5dbb87770b1a3100c6c122bb39ca854006bb0b0d
2019-01-23 13:37:27 -08:00
Josh Gao
776c2ec08c adbd: compile for host.
Preparatory step for testing adb on GCE on non-linux hosts: instead of
pointing them at a device (emulated or otherwise), point them at adbd
running on a linux host instead.

Test: adbd & adb connect localhost:5555; adb -e wait-for-device shell
Change-Id: Ib22d51a4fc9e6e68f71bf1b3b9b2e1b0bd844760
2019-01-23 12:59:41 -08:00
Henry Daitx
09158b1d5a Merge "Fix fastdeploy failure in Windows" 2019-01-23 20:52:01 +00:00
Tom Cherry
4e904768f7 Update fs_mgr tests for new fstab format and add to TEST_MAPPING
And fix a bug in the meantime, where mounts with no filesystem
specific mount options were incorrectly having an empty string in
their set of mount options.

Test: this test
Change-Id: I9b1f14d00a90f8b95a13fcecb3cfa7fe10a2f96a
2019-01-23 11:28:00 -08:00
Tri Vo
57b2e8cd01 Read selinux_denial_metadata from /vendor
selinux_denial_metadata contains device-specific information, so it is
being moved to /vendor.

Bug: 5159394
Test: bug information is still preserved in avc logs, e.g.
audit(0.0:248): avc: denied { read } for
name="u:object_r:vendor_default_prop:s0" dev="tmpfs" ino=18012
scontext=u:r:platform_app:s0:c512,c768
tcontext=u:object_r:vendor_default_prop:s0 tclass=file permissive=0
b/79617173 app=com.android.systemui
Change-Id: I23293e715b5d793a54466a128ccd57f44370cf5a
2019-01-23 09:58:37 -08:00
Christopher Ferris
4aec66e810 Fix memory leak in UnwinderFromPid object.
Actually make the destructor virtual so that objects in
UnwinderFromPid get freed.

Also, explicitly make the DexFiles and JitDebug destructors virtual.

Bug: 123099840

Test: Ran UnwindTest.local_from_pid thousands of times.
Change-Id: I8bf11c0eb3587fa82f5f14f4723ea5c91da0fd46
2019-01-23 09:49:28 -08:00
Christopher Ferris
a5e0d695fa Merge "Fix flaky signal tests." 2019-01-23 17:39:09 +00:00
Tri Vo
c8137f93f7 selinux: account for /product hash
We need to be able to tell if /product was updated independently
/system.  Otherwise, the device might accidentally load the
precompiled_policy after a /product sepolicy update.

Bug: 119305624
Test: boot aosp_taimen, precompiled policy is loaded
Test: If either of these hashes
/system/etc/selinux/plat_sepolicy_and_mapping.sha256
/product/etc/selinux/product_sepolicy_and_mapping.sha256
are removed, then init falls back to compiling sepolicy at boot time.
Change-Id: I3d658335cf66bcb7123109de701309039b1ae5ba
2019-01-23 09:23:22 -08:00
Martin Stjernholm
d35c4ccc40 Merge changes from topic "runtime-ld-configs"
* changes:
  Make libdexfile_external.so accessible from binaries and libraries in /system.
  The runtime namespace needs to be visible since libopenjdk is loaded through dlopen().
2019-01-23 17:03:12 +00:00
Treehugger Robot
39624169e7 Merge changes I72aaf4d6,I420cb87c,Iab7c6cf7,Ic4388e20
* changes:
  fs_mgr: overlay: support non-DAP A/B devices
  fs_mgr: overlayfs: test: check for existence of userspace fastboot
  fs_mgr: overlayfs: test: check for ext4 dedupe needing overlay
  fs_mgr: overlayfs: validate that kernel supports scratch filesystem
2019-01-23 16:39:22 +00:00
Mark Salyzyn
264b7dfa5e fs_mgr: overlay: support non-DAP A/B devices
Loosen some tests and borrow logic from retrofit Dynamic Android
Partitions (DAP) A/B devices.  In non-DAP A/B device case
/mnt/scratch is used, backed by the system other partition.

Tested on taimen with CONFIG_OVERLAY_FS added to its pre 4.6 kernel,
and BOARD_EXT4_SHARE_DUP_BLOCKS := true added to board config. Also
tested on a retrofit DAP A/B device and an untouched taimen.

Test: adb_remount_test.sh
Bug: 120448575
Change-Id: I72aaf4d68db1c3ac380aba425346ab6443cadad3
2019-01-23 16:38:33 +00:00
Hridya Valsaraju
ad518bd4d7 Modify mkbootimg.py to support boot image header version 2
Boot image with header version 2 supports inclusion of
DTB image within the boot image.

Bug: 111136242
Test: unpack_bootimg.py is able to extract DTB added by
mkbootimg.py

Change-Id: Ie6ae2507aa0c1960c73077d618aacafb83ae8459
2019-01-23 08:35:46 -08:00
Martin Stjernholm
c02464ced9 Make libdexfile_external.so accessible from binaries and libraries in /system.
There are dependencies on libdexfile_external from some central libraries
that are widely used (b/123186083).

One example is vendor/bin/hw/android.hardware.media.omx@1.0-service, which
requries the link from "system" to "runtime" in the [vendor] section.

The direct dependants are libunwindstack and simpleperf, so it's enough to
link from namespaces containing /system/{lib,lib64,bin}.

Test: Flash and boot
Test: Flash and boot with Runtime APEX enabled (http://r.android.com/q/topic:art-move-libs-to-runtime-apex)
Bug: 123186083
Bug: 113373927
Change-Id: I081aa7392c875202acdaf1185c2ff28e17ac7e76
2019-01-23 15:45:59 +00:00
Neil Fuller
f40156d69c Add a symlink for the ICU .dat file
The ICU .dat file was moved into the runtime APEX file
in commit b6d855f081c232309961f31c7c7c8a76abf79c3c.
There are some apps that know the old location and its
absence causes them to fail.

This change adds a symlink from the old directory to
the new directory. The ICU .dat file changes its name
with every ICU major release so this is simpler than
linking the file itself.

Bug: 119293618
Bug: 120853401
Bug: 122985829
Test: make droid / inspect output
Test: Confirm broken app works on an internal master build
Change-Id: I452dcb5e52975011c9ebd3db2caa621bbefedaf3
2019-01-23 12:03:48 +00:00
Henry Daitx
f788f67c23 Fix fastdeploy failure in Windows
adb --fastdeploy creates a TemporaryFile to which the stdout for a shell
command is redirected. This happens while the file is still open (the
TemporaryFile object holds the file handle). In Linux this works, but
Windows blocks the operation with an error of "The process cannot access
the file because it is being used by another process".

This change closes the file before the shell tries to write to it.

Test: mm -j 72
Test: adb install --fastdeploy --force-agent --local-agent /mnt/raid/boat-attack-apk/boat-attack-swappy.apk

Bug: 122592986
Change-Id: Iaaaf62cda43e4714d7f979e6a690549b383a7b82
2019-01-23 11:00:45 +00:00
Justin Yun
ebe4e2404b vndk: do not use prebuilt ld.config.<ver>.txt
Regardless of VNDK version, use template ld.config.txt instead of
using prebuilt ld.config.txt.

Bug: 74658756
Bug: 123209911
Test: PRODUCT_EXTRA_VNDK_VERSIONS=27 m -j vndk_snapshot_package
Change-Id: I0eb527b71e56c555079c524542508a093bf53111
2019-01-23 19:22:29 +09:00
Nicolas Geoffray
1cab2c6bec Merge "Conscrypt should only link against bionic." 2019-01-23 09:08:42 +00:00
Sandeep Patil
62b80fa3ad Merge "meminfo: Pull ReadVmallocInfo() out of the SysMemInfo class." 2019-01-23 05:17:16 +00:00
Josh Gao
54d1e31c63 Merge "adb: win32: improve console output on Windows 10" 2019-01-23 03:59:27 +00:00
Josh Gao
89a6fdc4b3 Merge "adb: win32: LinePrinter Unicode support" 2019-01-23 03:47:21 +00:00
Treehugger Robot
932e77137c Merge "fs_mgr: overlayfs: erofs is in staging" 2019-01-23 00:36:17 +00:00
Mark Salyzyn
52490faabe fs_mgr: overlayfs: test: check for existence of userspace fastboot
If there is no userspace fastboot, then overlayfs has a corner case
bug where overlay content is not wiped when the partition is flashed.
We will report a warning instead.

This is done to reduce the flakiness of the test results as we do not
intend to fix this specific corner case in the short term.  We would
require to record a sha representing the flash image, and the risks
were evaluated as too high of an impact on libavb to add interfaces
to expose the signatures, especially at first stage mount time.  All
new devices must support Dynamic Android Partitions (DAP), which
means they all have support for userspace fastboot, it will be
considered a misconfiguration and thus the position is we will not
fix this issue and only use this test adjustment to deal with legacy
products.  If a legacy non-DAP product wishes to close the issue
today, they must supply a user space fastboot.

Test: adb-remount-test.sh
Bug: 109821005
Bug: 123079041
Change-Id: I420cb87c19e3e184a974dfc373fb17c097d4858f
2019-01-22 15:28:38 -08:00
Mark Salyzyn
3fe0a8164d fs_mgr: overlayfs: test: check for ext4 dedupe needing overlay
Check if any system partition looks like it has ext dedupe or
rather shared_blocks feature enabled, if so then we expect
overlayfs to kick in.  We do this to deal with any flakiness
in the test when right-sizing is not applied to the platform.

Minor: older devices mounted persist to /persist.

Test: adb-remount-test.sh
Bug: 109821005
Bug: 123079041
Change-Id: Iab7c6cf7f24f2c446aeb149e3f65d6793a42c6ea
2019-01-22 15:28:23 -08:00
Mark Salyzyn
89b88b4e2d fs_mgr: overlayfs: validate that kernel supports scratch filesystem
Check for /sys/fs/<fs_type> existence to confirm kernel has
the file system type available.

Test: adb-remount-test.sh
Bug: 109821005
Bug: 123079041
Change-Id: Ic4388e2044bccea8b8edc7762d4ac9b3047206ac
2019-01-22 15:28:11 -08:00