Commit Graph

63210 Commits

Author SHA1 Message Date
Arve Hjønnevåg 5ec14a7fb2 Merge "trusty: keymaster: Add set_attestation_key" 2020-09-14 18:32:13 +00:00
Jooyung Han 7bfe477b3d init: "init subcontext" in default mount namespace
"init subcontext" is responsible to handle a few commands in vendor
context. To support Vendor APEX, "init subcontext" is now started in
"default" mount namespace so that those commands can access /apex/*.

For example, insmod should see the contents of /apex to install kernel
modules in apexes.

Bug: 162701747
Test: adb shell ps -ef | grep init
      => check pid of <init subcontext>
      adb shell readlink /proc/<pid: init>/ns/mnt
      adb shell readlink /proc/<pid: init subcontext>/ns/mnt
      => check if these are equal
Change-Id: Icd5e862e52d78635e83824b267b6d32d8f3e9eea
2020-09-14 17:40:45 +09:00
Inseob Kim 2a8c714145 Freeze com.android.sysprop.init API
Bug: 145259948
Test: m com.android.sysprop.init-check-api
Change-Id: I5909c16390c35b5e5adf4c82eed191cc9ae82014
2020-09-14 13:51:27 +09:00
Hridya Valsaraju 72a0f10f51 Setup ueventd to support DMA-BUF heaps
Test: tested on cuttelfish with DMA-BUF heaps enabled.
Bug: 168333162
Change-Id: I2e7ed71d329edbb77319ca3cfbc4f0bf6be8fd98
2020-09-11 14:42:31 -07:00
Dylan Katz 806b3d8619 Removed RWLock fuzzer
The class being fuzzed here was too simple for a fuzzer to be effective at finding crashes that were not working as intended.
To resolve the issue noted in 163775285 would require the fuzzer to simply use RWLock exactly as intended, defeating the point of fuzzing it.
Because of this, we have made the decision to remove this class. It should have a fairly small impact on coverage. In the future,
perhaps a better approach would be fuzzing pthread's rwlock methods directly.
Test: Made sure the project still builds without RWLock_fuzz.

Signed-off-by: Dylan Katz <dylan.katz@leviathansecurity.com>
Change-Id: Id5e77d053dc800a982176802dc506d26b54d810f
2020-09-11 11:03:02 -07:00
Treehugger Robot 3bede4f44f Merge "Remove persist.sys.fuse == false code paths" 2020-09-11 15:00:27 +00:00
vichang 277c702dc3 Merge "Add a new public library libicu.so" 2020-09-11 10:19:37 +00:00
Zim c46c2350e5 Remove persist.sys.fuse == false code paths
Since Android R, the FUSE prop is always on and FUSE-off is no longer
supported

Test: m
Bug: 160159282
Change-Id: I6db20fe8cbf8d260ba21fed5da289eacd4e53ef5
2020-09-11 11:06:29 +01:00
Treehugger Robot 316298d7b0 Merge "adb: fix `push --sync` with multiple inputs." 2020-09-11 04:55:49 +00:00
Yifan Hong 135508168a Merge changes from topic "modules_partition"
* changes:
  fastboot: add modules partition
  rootdir: Add modules directory
2020-09-11 00:25:24 +00:00
Arve Hjønnevåg 0c32a253df trusty: keymaster: Add set_attestation_key
Add tool to provision keymaster attestation keys.

Bug: 154033394
Test: keys from soft_attestation_cert then VtsHalKeymasterV4_0TargetTest

Change-Id: Ic96e9a8676991b3126bbae99118a1f23ee0744a5
2020-09-10 16:43:20 -07:00
David Anderson 1f8c18ee55 Merge "libsnapshot: Refactor cow_reader decompression." 2020-09-10 23:05:08 +00:00
Tom Cherry 9481c67321 Merge "init: do not create dev.mnt. properties for emulated mounts" 2020-09-10 20:47:35 +00:00
Treehugger Robot 0ceb0339aa Merge "logd: don't require chatty to pass CTS" into android11-tests-dev 2020-09-10 18:39:07 +00:00
Tom Cherry e1bcd93326 init: do not create dev.mnt. properties for emulated mounts
dev.mnt. properties are primarily intended for tuning parameters for
mounts such as /system and /data but don't have much use for emulated
mounts.

There are additional emulated mounts created for each user on a
device, so if too many users are created, init would otherwise create
too many dev.mnt. properties, filling the property file that backs
these properties, and preventing more properties from being
generated.

Therefore, this change stops init from creating dev.mnt. properties
for emulated mounts.

Bug: 156721033
Test: user creation stress test doesn't create large numbers of
properties

Change-Id: I6475956719b7c938b8289189abfef661140d526d
2020-09-10 18:09:25 +00:00
Xin Li 8484c0a7ca Merge "Merge Android R" 2020-09-10 17:22:00 +00:00
David Anderson 511c4bc601 libsnapshot: Refactor cow_reader decompression.
Bug: 162274240
Test: cow_api_test
Change-Id: I12c177f3ebb7bb0550669bd5edbdbbde6f572cfd
2020-09-09 21:54:48 -07:00
Xin Li e1ebeab9c5 Merge Android R
Bug: 168057903
Merged-In: I88f6774ca9985fb50f015756b8f8508d4691dc62
Change-Id: Iefe2872d29836b77344479ad2552a9c03d81bdcb
2020-09-09 20:21:27 -07:00
Akilesh Kailash c7c7252289 Merge "libsnapshot:Snapuserd: IO path support with dm-snapshot target" 2020-09-10 01:59:38 +00:00
Akilesh Kailash 2c6c0bff7d libsnapshot:Snapuserd: IO path support with dm-snapshot target
Integrate Snapuserd daemon with libsnapshot library and handle
IO requests from dm-snap and dm-snap-persistent.

Tested all the 3 COW operations on a compressed
cow-device file generated through vab_converter_payload.

BUG: 163046732
Test: Added test case to independently test snapuserd IO path.
      Manual test on compressed cow file generated and verifying
      md5sum.

Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: I9d017ac671733a93c3bc21344228260224640c78
[Palmer: clean up some build issues]
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
2020-09-10 00:27:50 +00:00
Tom Cherry cec1c89ac3 Merge "logd: Fix ClearUidLogs() when writer_active_ is true" am: 5f2474e430
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1424008

Change-Id: I88f6774ca9985fb50f015756b8f8508d4691dc62
2020-09-09 23:07:33 +00:00
Tom Cherry 5f2474e430 Merge "logd: Fix ClearUidLogs() when writer_active_ is true" 2020-09-09 22:41:22 +00:00
Tom Cherry b31cbd6bdd logd: don't require chatty to pass CTS
Remove a few tests that require logd to implement chatty to not
require chatty to pass CTS.  Note that these tests are already removed
in AOSP and won't be required in S.

Bug: 168100439
Test: these tests don't run
Merged-In: Ie12898617429a75b6caff92725aa7145650f8fc6
Change-Id: Ia81042a48e9675f2ad3ad75a10ec4d60c96ff712
2020-09-09 21:26:46 +00:00
Tom Cherry 2adbece108 logd: Fix ClearUidLogs() when writer_active_ is true
Previously ClearUidLogs() would Compress() the log buffer in all
cases, however that is the wrong behavior when writer_active_ is true
and would leave the SerializedLogChunk object in an invalid state.  If
more logs are written to the log, then write_offset() will be higher
than the compressed size of the log, violating a CHECK() when later
decompressing the log.

This change does not call Compress() in ClearUidLogs() if
writer_active_ is true.  It upgrades a check in Compress() from a
simple if statement to a CHECK() to prevent against this happening in
the future.

It adds a test that exercises the previously failing path.

Bug: 166187079
Test: unit tests
Change-Id: Ic5fbcf16f724af1c20170b8f4e6e2daadf6a9529
2020-09-09 20:26:59 +00:00
Josh Gao 1b65ebe2e0 adb: fix `push --sync` with multiple inputs.
Previously, when push --sync was used with multiple files, we tried to
stat a remote file with pending acknowledgements still in the socket
buffer, which leads to an abort when we read ID_OKAY instead of the
response we were expecting.

This patch changes the behavior to always wait for acknowledgements if
we're pushing with --sync (or `adb sync`). This results in a ~100ms
regression during a 10 second sync of every file on the system image,
but that's not very much, so perhaps we should consider doing this
always.

Bug: http://b/166155032
Test: test_device.py
Change-Id: I7110243071ba5fbaa77dcc76f42a19d9ed2b4195
2020-09-08 18:07:47 -07:00
Nikita Ioffe 4e311d69b5 Merge "Only store result of mount_all that mounted userdata" am: edc501d674
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1420053

Change-Id: I444f74692633b2bc4f5bcf03cd036b5c52b120aa
2020-09-08 23:10:11 +00:00
Nikita Ioffe edc501d674 Merge "Only store result of mount_all that mounted userdata" 2020-09-08 22:37:52 +00:00
Nikita Ioffe 9ede7ec273 Only store result of mount_all that mounted userdata
During boot sequence there can be multiple calls to mount_all. For the
userspace reboot to correctly remount userdata, we need to store the
return code of the one that was responsible in mounting userdata.

Test: adb root
Test: adb shell setprop init.userspace_reboot.is_supported 1
Test: adb reboot userspace
Test: checked dmsg
Bug: 166353152
Change-Id: Id0ae15f3bcf65fa54e4e72b76f64716c053af7fb
2020-09-08 21:58:43 +01:00
Treehugger Robot 91f3227436 Merge "Move PropertyMap from libutils to libinput" am: 01a30c0d2b
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1396177

Change-Id: I02919926ccbc4127f9c9c2a2b66eb2a7334c7270
2020-09-08 16:17:05 +00:00
Treehugger Robot 01a30c0d2b Merge "Move PropertyMap from libutils to libinput" 2020-09-08 16:03:36 +00:00
Alistair Delva e751aae086 Merge "Make libsparse vendor_available" am: 5a6f49dde7
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1419608

Change-Id: I83571db0c33bcf6768598ed630fe99f470483788
2020-09-08 15:35:14 +00:00
Alistair Delva 5a6f49dde7 Merge "Make libsparse vendor_available" 2020-09-08 15:15:19 +00:00
David Anderson 9bd7d9bd18 Merge "libsnapshot: Add a tool for estimating non-A/B OTA sizes with the new COW format." am: f9a436a052
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1411189

Change-Id: Iecd270c757577315cd485aad52e268ca601fb5fe
2020-09-04 19:29:15 +00:00
David Anderson f9a436a052 Merge "libsnapshot: Add a tool for estimating non-A/B OTA sizes with the new COW format." 2020-09-04 18:55:22 +00:00
David Anderson f4ebaca8a7 libsnapshot: Add a tool for estimating non-A/B OTA sizes with the new COW format.
This tool allows users to estimate the COW size for a non-A/B update.
It works by scanning the partitions of two target-files packages, and
identifying moved or copied blocks, and simulating the impact in the new
COW format.

It has two modes:

    estimate_cow_from_non_ab_ota -ota_tf <path>

Will estimate the COW size for a full OTA. For an incremental OTA, you
need two target files packages:

    estimate_cow_from_non_ab_ota -source_tf <path> -ota_tf <path>

There is an optional -compression argument which accepts either "none"
or "gz".

Bug: 161497962
Test: manual test
Change-Id: I335059cd870a464f34c5d644eefefdc76775386e
2020-09-03 19:04:34 -07:00
Treehugger Robot 9bfc688fe9 Merge "Return bytes written in CowWriter" am: b745a960f8
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1419388

Change-Id: Id707e37c7cb64d05922c7db9db0d0b26685136c4
2020-09-03 22:31:45 +00:00
Treehugger Robot b745a960f8 Merge "Return bytes written in CowWriter" 2020-09-03 22:01:25 +00:00
Elliott Hughes 4c4af77b16 Merge "ashmem: ensure ashmem fds are CLOEXEC." am: a2f248724c
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1419610

Change-Id: I7d6f11a48f423951b0811b3d754508542b809dcd
2020-09-03 21:23:38 +00:00
Elliott Hughes a2f248724c Merge "ashmem: ensure ashmem fds are CLOEXEC." 2020-09-03 21:06:03 +00:00
Kelvin Zhang 8e75a38edd Return bytes written in CowWriter
delta_generator in update_engine needs to know number of bytes written
to estimate cow image sizes. This change modifies CowWriter::Finalize to
return relevant information.

Test: unnitest
Change-Id: I7cf6b9124b90f089a7c5f3850c38200f82da18e6
2020-09-03 15:59:17 -04:00
Elliott Hughes 790ef05793 ashmem: ensure ashmem fds are CLOEXEC.
Fix the memfd_create(2) path and add the missing unit test.

Bug: https://issuetracker.google.com/165667331
Test: treehugger
Change-Id: Ibb5c1d0f9d7caba1df04d1f03e82e55026d9f86a
2020-09-03 10:54:20 -07:00
Alistair Delva 9e28cd32fd Make libsparse vendor_available
We are porting cuttlefish to Android, it currently uses libsparse to
desparse Android filesystems to be used directly as disk images by
crosvm. Making this library available to 'vendor' enables us to support
desparsing downloaded images on-device as well.

Bug: 167675429
Change-Id: I8ae4a916cfb0b2002dd9e462f32e8cb0e533d821
2020-09-03 08:43:46 -07:00
Siarhei Vishniakou 1329696700 Move PropertyMap from libutils to libinput
The input code is the only customer of PropertyMap. For easier
maintenance and eventual removal of it, move it to libinput.

Currently, the caller is responsible for managing the lifecycle of the
returned outMap when calling PropertyMap::load. However, the fact that
the function call allocates new memory is not obvious from the function
signature.

In a separate commit, I will refactor the function to return
Result<unique_ptr<>> to make it less errorprone.
In this commit, only move the files around to make code reviews easier.

Bug: 163171599
Test: atest inputflinger_tests
Change-Id: I316084886c3f09a1776fdb449d2f03d0563b66c1
2020-09-02 20:54:38 -07:00
Treehugger Robot bc2fbe9ce4 Merge "Create directories under /data/local/tests at boot" am: 480335dfd6
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1416432

Change-Id: I3136907e6137b8045e884b9cbffbe096951b8010
2020-09-03 03:07:06 +00:00
Treehugger Robot 480335dfd6 Merge "Create directories under /data/local/tests at boot" 2020-09-03 02:26:10 +00:00
Kelvin Zhang 756e361551 Merge "Enable libsnapshot_cow in recovery builds" am: 0b26cbb6b1
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1416091

Change-Id: Ia4e0b0c1447336ac2d149ef6273decd9d6d0e790
2020-09-03 00:45:20 +00:00
Kelvin Zhang 0b26cbb6b1 Merge "Enable libsnapshot_cow in recovery builds" 2020-09-03 00:11:43 +00:00
Kelvin Zhang f6219e2d56 Enable libsnapshot_cow in recovery builds
update_engine is enabled in recovery mode, needs to link with
libsnapshot_cow

Test: mm -j
Change-Id: Ia4823c866b16f47cd03dda1779701e957a77aed6
2020-09-02 20:08:46 -04:00
David Anderson 4852a2654a Merge "liblp: fix host lpdump cannot work issue" am: 29e7b2af30
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1320937

Change-Id: Ifc77676b6f750c98557f42707f4ca9a96f05cad7
2020-09-02 17:57:42 +00:00
David Anderson 29e7b2af30 Merge "liblp: fix host lpdump cannot work issue" 2020-09-02 17:36:00 +00:00