Commit graph

71869 commits

Author SHA1 Message Date
David Anderson
5932ed07db libsnapshot: Fix new partitions not transitioning in second-stage init.
Bug: 196922070
Test: vts_libsnapshot_test
Merged-In: If8a7afde218fd719e4426dc1dda41f53a4e6544b
Change-Id: If8a7afde218fd719e4426dc1dda41f53a4e6544b
2021-09-15 00:43:20 +00:00
David Anderson
0a6f250242 libsnapshot: Fix missing source partitions when adding a new partition.
When adding a new partition, don't attempt to map a source partition
during boot, because none exists. Instead use the base device.

Bug: 196922070
Test: vts_libsnapshot_test
Change-Id: Ice6015237b0a76a0210819994433e52159376393
Merged-In: Ice6015237b0a76a0210819994433e52159376393
2021-08-25 00:02:39 +00:00
Bart Van Assche
d5a663fde4 Reduce the queue depth of loop devices used by the zram driver am: 1a9cad816d
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15584614

Change-Id: Id0a6c5b0e7c9cb118df02a9be768b3f68dde43a9
2021-08-18 20:04:09 +00:00
Bart Van Assche
1a9cad816d Reduce the queue depth of loop devices used by the zram driver
Make the queue depth of loop devices identical to that of the underlying
storage device. This patch reduces latency by lowering the queue depth.
With this patch applied I see the following:

 # cat /sys/block/loop30/queue/nr_requests
32

Bug: 194450129
Test: Built Android images, installed these and verified that the queue depth of loop devices is 32 instead of 256.
Merged-In: Ifa16084c7df3a54d9559c2388abc4a8392ff88c6
Change-Id: Icc89e1f88d2f0ade2805999afef556b15b7ff8eb
Ignore-AOSP-First: Already in AOSP.
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2021-08-18 11:00:31 -07:00
TreeHugger Robot
b155a9a8a1 Merge "libdm: Export ExtractBlockDeviceName()" into sc-dev am: de0cc6cc59
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15584613

Change-Id: I1221648f11e6fd2ccae40b1ad5d335c31ff8efa1
2021-08-17 05:52:31 +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
de0cc6cc59 Merge "libdm: Export ExtractBlockDeviceName()" into sc-dev 2021-08-17 05:38:11 +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
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
9e54a90e54 libdm: Export ExtractBlockDeviceName()
Make this function available to libdm users. A caller outside libdm will
be added by a later patch.

Bug: 194450129
Test: mm libfs_mgr libdm_test
Merged-In: I3e3560f3cdef8978eac644d5b53cf3851209c0c2
Change-Id: Ic05cc84565952662178bb649ec97cad6f76dcf92
Ignore-AOSP-First: Already in AOSP.
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2021-08-16 11:04:40 -07: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
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
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
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
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
d92cd94d81 Merge "fastbootd: Delete all VAB partitions during "flashall"." into sc-qpr1-dev 2021-08-12 18:00:22 +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
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 e98afa2687)
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 aea9781530)
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
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
f3fea37772 Merge "Revert "Add systrace tag for system property"" into sc-dev 2021-07-23 17:04:39 +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 d14a178d01)
Merged-In: I90eddf2a87397449b241e5acaaa8d4a4241d73a9
2021-07-22 19:46:29 -07: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 18e0f65cbf)
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
440bad0bdd trusty:storageproxyd: Add wakelock to the UFS commands
We add a wakelock to the sequence of UFS commands so that
the sequence will not be disrrupted when devices get suspended.

Bug: 193456223
Test: Trusty storage tests
Merged-In: Ib90f8b284017cf261d2a2aea940834a42c21de02
Change-Id: Ib90f8b284017cf261d2a2aea940834a42c21de02
2021-07-16 14:29:05 -07:00
Wenhao Wang
c66e99bf24 trusty:storageproxyd: Fix return paths on errors
The function send_ufs_rpmb_req is missing return paths on errors.
This patch fixes it so that any UFS command failure will return
error code to the function caller.

Bug: 193855098
Test: Trusty storage tests
Merged-In: I391ecff9ed3f892b7c3adae0ceeb18930791326f
Change-Id: I391ecff9ed3f892b7c3adae0ceeb18930791326f
2021-07-16 19:50:50 +00:00
TreeHugger Robot
db4a23996d Merge "task_profiles.json: add taskprofile for dex2oat boot_complete policy" into sc-dev 2021-07-12 18:51:11 +00:00
Wei Wang
3745ce7aa8 task_profiles.json: add taskprofile for dex2oat boot_complete policy
Since installation time is also critical and sometime we want a finer
control on its behavior for vendor. Instead of set dex2oat to background
group, add a new task profile.

The default policy is to mirror SP_BACKGROUND to be compatible with
legacy devices.

Test: Boot
Bug: 188947181
Signed-off-by: Wei Wang <wvw@google.com>
Change-Id: I7d5e113d1c368205f712eadad27775de226131ce
2021-07-08 11:00:02 -07:00
Devin Moore
91ef4dacce init: remove extra space in list of bootconfig values
If a bootconfig argument has a list of values, it has a space between
them in /proc/bootconfig.

Example:
BOARD_BOOTCONFIG := parameter=value1,value2,value3

In /proc/bootconfig, it looks like:
parameter = "value1", "value2", "value3"

Before this CL, that example would end up with the value string of:
"value1, value2, value3"

To keep consistent behavior with kernel cmdline the value string should be:
"value1,value2,value3"

Test: Boot cuttlefish with test bootconfig params and verify ro.boot.*
Bug: 192257482
Merged-In: Iccdec451f53330162fa2c9ad2b7c2630f32b4168
Change-Id: Iccdec451f53330162fa2c9ad2b7c2630f32b4168
2021-07-08 16:53:59 +00:00
Nikita Ioffe
b7f123fb66 Merge "Also populate lastUpdateMillis in ActivateFlattenedApexesIfPossible" into sc-dev 2021-07-08 13:14:05 +00:00
Nikita Ioffe
b47f266671 Also populate lastUpdateMillis in ActivateFlattenedApexesIfPossible
Test: m
Bug: 192647837
Change-Id: I11dca132168d6a30372d7a68fe590894d3cc5ccf
Merged-In: I11dca132168d6a30372d7a68fe590894d3cc5ccf
2021-07-08 11:27:18 +00:00
Max Bires
dfbb22c8e7 Merge "Client side implementation of Trusty IRPC HAL" into sc-dev 2021-07-08 03:00:24 +00:00
Suren Baghdasaryan
add9a25335 libprocessgroup: Remove unnecessary permissions change in uid/pid hierarchy
When a new process is launched it ensures that all files under its uid/
and uid/pid hierarchy are accessible by the user/group of that process.
If the directory already exists that means the access permissions have
been already set before, therefore we do not need to reset them again.
This also avoids a race between two processes in the same uid with one
process being launched and walking the uid/ directory while the other
process is being killed and changing the content of that directory. In
such a race the process walking uid/ might find the uid/pid directory of
the process being killed but by the time it tries to set its permissions
the directory might be removed because the process got killed. The
change eliminates the possibility of this race.

Bug: 192421915
Bug: 192512069
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: I182298c36f6b0b4580ab59e440bd3aea16f5fbfe
2021-07-07 19:42:03 +00:00