Commit Graph

71929 Commits

Author SHA1 Message Date
TreeHugger Robot b9f40f83eb Merge "libdm: Make ExtractBlockDeviceName() return its result" into sc-dev am: 232ec664b1 am: 10e14c95bc
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15584612

Change-Id: I3b11fd3d20d34a9440ddb74e96a75922877534c7
2021-08-17 06:07:10 +00:00
TreeHugger Robot 9e6087a88e Merge "Rename two local variables" into sc-dev am: d95943088e am: caef6def08
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15584611

Change-Id: I5080775507f23eb67293aadc3e2ce4e7f42e3fd1
2021-08-17 06:07:02 +00:00
TreeHugger Robot 10e14c95bc Merge "libdm: Make ExtractBlockDeviceName() return its result" into sc-dev am: 232ec664b1
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15584612

Change-Id: I687f47d10a8aa8c955aab5e3c630f2c735e82c19
2021-08-17 05:52:19 +00:00
TreeHugger Robot caef6def08 Merge "Rename two local variables" into sc-dev am: d95943088e
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15584611

Change-Id: I1a7057d9dd955d425446985cf2ab16955efaa8ce
2021-08-17 05:52:07 +00:00
TreeHugger Robot 232ec664b1 Merge "libdm: Make ExtractBlockDeviceName() return its result" into sc-dev 2021-08-17 05:38:09 +00:00
TreeHugger Robot d95943088e Merge "Rename two local variables" into sc-dev 2021-08-17 05:38:07 +00:00
TreeHugger Robot e9aa841c95 Merge "Handle long responses by keymint IPC." into sc-dev am: a707c28937 am: ec759fe14d
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15515450

Change-Id: Iab05aa4155a10ff9c0fcfcfbb1bd1a7e3dbf25b0
2021-08-16 20:37:19 +00:00
TreeHugger Robot ec759fe14d Merge "Handle long responses by keymint IPC." into sc-dev am: a707c28937
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15515450

Change-Id: I87baacb3d5ac3854d648cecea3a615132e0d36db
2021-08-16 20:24:24 +00:00
TreeHugger Robot a707c28937 Merge "Handle long responses by keymint IPC." into sc-dev 2021-08-16 20:07:15 +00:00
Bart Van Assche 96b21cc589 libdm: Make ExtractBlockDeviceName() return its result
From https://engdoc.corp.google.com/eng/doc/devguide/cpp/styleguide.md:
"Prefer using return values over output parameters: they improve
readability, and often provide the same or better performance (see the C++
Primer)." Implement this advice for ExtractBlockDeviceName(). This patch
does not change any functionality.

Bug: 194450129
Test: mm libfs_mgr libdm_test
Merged-In: I6363781163eba08e6128507b403200f472f68a59
Change-Id: I7d340b33281ebccded0836cd0b5a293e941f4043
Ignore-AOSP-First: Already in AOSP.
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2021-08-16 11:04:35 -07:00
Bart Van Assche c554240e64 Rename two local variables
Improve code readability by renaming 'device' into 'loop_device' and
'device_fd' into 'loop_fd'.

Bug: 194894000
Test: Built Android images and installed these on an Android device.
Merged-In: Ia9c2d7a525e727f8706e66631b97fc4678c6a4d9
Change-Id: I3fa0c9ca53277b621bb5b81aca394a3079c6e0a3
Ignore-AOSP-First: Already in AOSP.
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2021-08-16 11:04:18 -07:00
Max Bires ab96ce997a Merge "Make RemoteProvisioner required for KeyMint cc_bin" into sc-dev am: 98f87ca8a7 am: a19f6e3940
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15481660

Change-Id: I6cee24f3f1bc7d5ad7c41d726d2a505b9ef5bd13
2021-08-15 18:27:05 +00:00
Max Bires a19f6e3940 Merge "Make RemoteProvisioner required for KeyMint cc_bin" into sc-dev am: 98f87ca8a7
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15481660

Change-Id: Ifdee480b05d57c18f488365c7329b78417eb2774
2021-08-15 18:09:28 +00:00
Max Bires 98f87ca8a7 Merge "Make RemoteProvisioner required for KeyMint cc_bin" into sc-dev 2021-08-15 17:55:48 +00:00
Xin Li ba6fff6d8a [automerger skipped] Merge stage-aosp-sc-ts-dev before making it an upstream am: dc9e8e5084 -s ours am: 78993f1baf -s ours
am skip reason: Merged-In I3735e0752a6e502536000bd3102abda30cbd58fe with SHA-1 84b4353790 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15547707

Change-Id: Ieca4545d31f830b896c014e64e5026ada2cb8604
2021-08-13 21:20:26 +00:00
Xin Li 78993f1baf [automerger skipped] Merge stage-aosp-sc-ts-dev before making it an upstream am: dc9e8e5084 -s ours
am skip reason: Merged-In I3735e0752a6e502536000bd3102abda30cbd58fe with SHA-1 84b4353790 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15547707

Change-Id: If7b98731765d23bafcf1299c4be89eb09e050771
2021-08-13 20:53:29 +00:00
The Android Open Source Project 938071b497 [automerger skipped] Merge ab/7633965 am: 65335e200f -s ours
am skip reason: Merged-In I7afea72a15b1a2a7aa676bddd12ea4a2dd896f81 with SHA-1 bbedda71e1 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15547467

Change-Id: I376a4b7daf86c6b881ea91ffecd61a13f7310793
2021-08-13 19:33:43 +00:00
Xin Li dc9e8e5084 Merge stage-aosp-sc-ts-dev before making it an upstream
Bug: 169893837
Merged-In: I3735e0752a6e502536000bd3102abda30cbd58fe
Change-Id: I0e78f7e9c3f27e44d1c04bbd138e840829a3dc84
2021-08-13 18:27:12 +00:00
The Android Open Source Project 65335e200f Merge ab/7633965
Bug: 169893837
Merged-In: I7afea72a15b1a2a7aa676bddd12ea4a2dd896f81
Change-Id: Id30ca5943b34b6fffc1f203667b5a59a79950f67
2021-08-12 22:27:46 +00:00
Eric Biggers 577e7667d2 Merge "fs_mgr: Look for fstab file in /system/etc" into sc-qpr1-dev am: 1312688506
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15522163

Change-Id: I2c3b74e114c212a941a38131026dbd2e1aad2114
2021-08-12 21:32:53 +00:00
Eric Biggers 1312688506 Merge "fs_mgr: Look for fstab file in /system/etc" into sc-qpr1-dev 2021-08-12 21:15:37 +00:00
David Anderson 6b1da7ba5b Merge "fastbootd: Delete all VAB partitions during "flashall"." into sc-qpr1-dev am: d92cd94d81
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15523335

Change-Id: I33e1ea6d6235e5028f278bbe0ea21e14dc3c3416
2021-08-12 18:17:02 +00:00
David Anderson d92cd94d81 Merge "fastbootd: Delete all VAB partitions during "flashall"." into sc-qpr1-dev 2021-08-12 18:00:22 +00:00
Tri Vo 2f153a4a8f Merge "trusty: storage: Allow starting without /data mounted" into sc-dev am: c87ea84d20 am: aa51f69d7a
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15479651

Change-Id: I3522901062c52f91e08be7b432e696a9881c222a
2021-08-11 16:22:00 +00:00
Tri Vo aa51f69d7a Merge "trusty: storage: Allow starting without /data mounted" into sc-dev am: c87ea84d20
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15479651

Change-Id: I47de7199ac5226fdd20ca39e0f29d2aa0237b91f
2021-08-11 16:09:19 +00:00
Tri Vo c87ea84d20 Merge "trusty: storage: Allow starting without /data mounted" into sc-dev 2021-08-11 16:02:35 +00:00
David Anderson 340e78d0f6 fastbootd: Delete all VAB partitions during "flashall".
With VAB we encourage a smaller super partition, so make sure we delete
"other" slot partitions during flashing. Otherwise, we may not have
enough space in super.

Bug: 195930130
Test: set_active, flashall, ensure other slot is deleted
Change-Id: Ic6a4f60e8f4c7abb8af7b38228753ad8ed85eedf
Merged-In: Ic6a4f60e8f4c7abb8af7b38228753ad8ed85eedf
2021-08-11 00:29:07 +00:00
Janis Danisevskis 5f4770944a Handle long responses by keymint IPC.
The KeyMint TA may send responses that are longer thant the 8K buffer
that the KeyMint HAL holds. This patch introduces
trusty_keymaster_call_2 which can grow the receive buffer on demand.

Ignore-AOSP-First: No mergepath from AOSP.

Bug: 195622501
Test: VTS and CTS test for regression testing.
Change-Id: Ia06e590e547e649ca81cda9a71851f334970788f
2021-08-10 15:08:20 -07:00
David Anderson 4b30ee6a6a Use std::shared_ptr in Epoll's callback list. am: 2cf268ab9f am: 81c5a30224 am: bbedda71e1 am: 4905ce5086
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15128087

Change-Id: I0a9321f57e57ab9e6cdfcd7aca62f94c101e9f8f
2021-08-10 22:05:23 +00:00
David Anderson 8fe5dbd779 Use std::shared_ptr in Epoll's callback list. am: 2cf268ab9f am: 5e66f7148b am: 6fa3c6a94a am: 5ca4715fcd
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15128087

Change-Id: I548e1a74906071703007415a73345f02b550f354
2021-08-10 22:05:15 +00:00
Eric Biggers 4056ccc2e5 fs_mgr: Look for fstab file in /system/etc
Look for the fstab file in /system/etc as an alternative to /, in order
to allow fstab files to be installed using the "prebuilt_etc" Soong
module.

This new path is meant to be used by the vendor ramdisk only. As before,
fstabs should *not* be placed in /system/etc on the system partition.

In more detail: sometimes, multiple nearly-identical fstabs need to be
installed to a device, with the correct one being selected at boot time
(b/191417025 as well as other cases that partners have run into).  To
avoid error-prone duplication of configuration files, these fstabs
should be generated from a template by the build system instead of being
duplicated in the source tree.  But if this is done, the usual way of
installing fstabs (PRODUCT_COPY_FILES) can't be used; they need to be
made into real build system modules instead.

Currently, the "prebuilt_etc" Soong module can't correctly install the
vendor_ramdisk copy of the fstab(s), since it will install it into the
/system/etc directory whereas Android currently requires that the
vendor_ramdisk copy of the fstab(s) be placed in the root directory.

Earlier I proposed adding a "prebuilt_fstab" module to handle this quirk
(https://r.android.com/1744033).  However, it was requested to instead
always look for the fstabs in /etc too, in order to allow "prebuilt_etc"
to be used and because /etc is the appropriate place for this file.
This change implements that suggestion (but actually using /system/etc,
since that is where "prebuilt_etc" actually installs it).

Bug: 191417025
Test: Tested that a device boots both with this, both before and after
      http://ag/15075136 which uses the new location.
Change-Id: Id083070e51ae85959167e4615cd96b31a0b1bd6a
Merged-In: Id083070e51ae85959167e4615cd96b31a0b1bd6a
(cherry picked from commit e98afa2687eb56184dad8569b929eba04fb93068)
2021-08-10 14:55:03 -07:00
David Anderson 4905ce5086 Use std::shared_ptr in Epoll's callback list. am: 2cf268ab9f am: 81c5a30224 am: bbedda71e1
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15128087

Change-Id: I833f5fceb7db60dcebbdb49a0a8e5af0c55fea9c
2021-08-10 21:42:07 +00:00
David Anderson 5ca4715fcd Use std::shared_ptr in Epoll's callback list. am: 2cf268ab9f am: 5e66f7148b am: 6fa3c6a94a
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15128087

Change-Id: Ia7e9b4e5e294c5633163359f1fe8835d67400495
2021-08-10 21:38:40 +00:00
David Anderson bbedda71e1 Use std::shared_ptr in Epoll's callback list. am: 2cf268ab9f am: 81c5a30224
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15128087

Change-Id: I7afea72a15b1a2a7aa676bddd12ea4a2dd896f81
2021-08-10 21:19:35 +00:00
David Anderson 6fa3c6a94a Use std::shared_ptr in Epoll's callback list. am: 2cf268ab9f am: 5e66f7148b
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15128087

Change-Id: Ie32637ad0fc07205c9df915fdbcd5dc1a9154701
2021-08-10 21:18:25 +00:00
David Anderson 81c5a30224 Use std::shared_ptr in Epoll's callback list. am: 2cf268ab9f
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15128087

Change-Id: I87c13501dddf402605de939f51fb894c53039943
2021-08-10 21:09:03 +00:00
David Anderson 5e66f7148b Use std::shared_ptr in Epoll's callback list. am: 2cf268ab9f
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15128087

Change-Id: I57974f85be50fdea6ec6e10d9038a16061763f61
2021-08-10 21:08:21 +00:00
David Anderson 2cf268ab9f Use std::shared_ptr in Epoll's callback list.
Ignore-AOSP-First: Awaiting security triage
Bug: 187862380
Bug: 184569329
Test: CtsInitTestCases
Change-Id: Ibb34a6b8a5675dbc515b7f8a43d7eecf2084510c
(cherry picked from commit aea97815308ab98faf1599c16d6190b787d34941)
2021-08-09 21:25:49 +00:00
Max Bires 58aa431069 Make RemoteProvisioner required for KeyMint cc_bin
This change adds the RPK apk back into the image for Trusty Keymint
devices, though the functionality will still be disabled by the
server check-in for now.

Ignore-AOSP-First: Will be CP'ed to AOSP
Bug: 194509629
Test: atest RemoteProvisionerUnitTests
Change-Id: Ic20ca119bd9c0614f7559b24ad60718c813a0cca
2021-08-06 05:58:24 -07:00
Tri Vo 84b4353790 trusty: storage: Allow starting without /data mounted
Bug: 187105270
Test: m
Change-Id: I3735e0752a6e502536000bd3102abda30cbd58fe
Merged-In: I3735e0752a6e502536000bd3102abda30cbd58fe
2021-08-06 05:38:27 +00:00
Akilesh Kailash c2460a7ca0 Crash during OTA merge may lead to blocks with stale data am: 533c2f6d55
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15413918

Change-Id: I09207d3a7d285d116be9b1fce86e62d5115124f5
2021-07-29 22:46:48 +00:00
Akilesh Kailash 533c2f6d55 Crash during OTA merge may lead to blocks with stale data
This is a corner case wherein a crash during OTA
merge can lead to missing of some COW operations to be
merged thereby some blocks may end up with stale data.

Fix here is to avoid any re-ordering of COW operations.
Merge the COW operations as present in the COW file.

New tests have been added to cow_snapuserd.

Bug: 194955361
Test: cow_snapuserd_test, Incremental OTA
Signed-off-by: Akilesh Kailash <akailash@google.com>
Merged-In: Id895fe7a3d6b4510676490a86d0caf62dec9b079
Change-Id: I14900b9537c4deb7824547e1dfe80f15274bdda4
Ignore-AOSP-First: manual merge from aosp
2021-07-29 16:30:01 +00:00
TreeHugger Robot 87968625aa Merge "Revert "Add systrace tag for system property"" into sc-dev am: f3fea37772
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15347267

Change-Id: Iae76d80f7da355df8a36c4c1df1383828c3610f3
2021-07-28 14:53:54 +00:00
TreeHugger Robot f3fea37772 Merge "Revert "Add systrace tag for system property"" into sc-dev 2021-07-23 17:04:39 +00:00
Eric Biggers 0ac3af350e Revert "init: make reboot_on_failure not apply to manually stopped services" am: 1fda6f1bf1
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15367046

Change-Id: Ib9ece424c47adcf0466e7b5f55a3dbca080e2a14
2021-07-23 16:19:46 +00:00
Eric Biggers 1fda6f1bf1 Revert "init: make reboot_on_failure not apply to manually stopped services"
This reverts commit 1c51525f66 because it
accidentally made reboot_on_failure be a no-op for all services.  This
is because Reap() itself calls KillProcessGroup() on devices with a
vendor level >= R, which in turn sets SVC_STOPPING.  I had overlooked
this somehow, probably because I didn't consider that a service can
consist of multiple processes.

It turns out that real FDE devices don't actually need the above commit
because FDE devices aren't allowed to have updatable apexes enabled, and
without updatable apexes enabled, apexd exits automatically and
therefore doesn't have to be stopped.  This can be verified by using the
aosp_cf_x86_phone_noapex build target, rather than aosp_cf_x86_phone
which I had used for testing before.  So just revert it for now.

Bug: 194370048
Change-Id: I90eddf2a87397449b241e5acaaa8d4a4241d73a9
(cherry picked from commit d14a178d01fd1690cf8c9f69dd8672b29f946a10)
Merged-In: I90eddf2a87397449b241e5acaaa8d4a4241d73a9
2021-07-22 19:46:29 -07:00
David Drysdale 9a67d7331e TrustyKeyMint: support boot, vendor patchlevels am: 830ea32e77
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15341992

Change-Id: Ibd1d3fc1b0529a15bae62a4ce917c81ee392e1ca
2021-07-22 08:28:12 +00:00
Bowgo Tsai 94b21c0c8c Revert "Add systrace tag for system property"
Revert "Add systrace tag for system property"

Revert "Add systrace tag for system property"

Revert "Adding system property tracing"

Revert submission 1403568-sysprop_trace

Reason for revert: makes property get/set non-reentrant
Reverted Changes:
I6f85f3f52:Add systrace tag for system property
Id2b93acb2:Adding system property tracing
Id78992d23:Add systrace tag for system property
I1ba9fc7bd:Add systrace tag for system property

Ignore-AOSP-First: b/193050299#comment17

Bug: 193050299
Change-Id: I9305003531c6a86194d55dc72c613337d213b53d
Merged-In: I9305003531c6a86194d55dc72c613337d213b53d
Test: build and boot a device
(cherry picked from commit 18e0f65cbf86b141bd621a1adb0f384b99f86e29)
2021-07-22 04:52:40 +00:00
David Drysdale 830ea32e77 TrustyKeyMint: support boot, vendor patchlevels
- Invoke TrustyKeymaster::ConfigureVendorPatchlevel() from
   remote keymint Initialize(), using vendor patchlevel retrieved
   from property.
 - Add TrustyKeymaster::ConfigureVendorPatchlevel() method to
   send the CONFIGURE_VENDOR_PATCHLEVEL message.
 - Add message type values for
   CONFIGURE_{VENDOR,BOOT}_PATCHLEVEL messages.

Bug: 193423844
Test: manual VTS test on device
Merged-In: Ie42345112b08ef9c669535cef2de60ea77da15b4
Change-Id: Ie42345112b08ef9c669535cef2de60ea77da15b4
Ignore-AOSP-First: manual merge from aosp
2021-07-21 16:48:05 +01:00
Wenhao Wang 51d8108034 trusty:storageproxyd: Add wakelock to the UFS commands am: 440bad0bdd
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15312385

Change-Id: Ibef57e04b61ee7a7fc35b4811aa4a10d0737a409
2021-07-17 00:47:06 +00:00