Commit graph

73586 commits

Author SHA1 Message Date
Samiul Islam
b18fea1abb Create utility method for calculating supplemental_uid from app_uid
Every app will now have a corresponding supplemental process associated
with it. We need an utility method to map one to the other.

Implementation details: supplemental process uid will be between range
20k-30k. As such, it will be a 10k offset from app id. See ag/16621743.

Bug: 211763739
Test: atest installd_service_test
Ignore-AOSP-First: Feature is being developed in internal branch
Change-Id: I2b6d6b086985bcb24c837eaa95a937d429d6a583
Merged-In: I2b6d6b086985bcb24c837eaa95a937d429d6a583
(cherry picked from commit 1c7acfdb67)
2022-03-02 13:29:40 +00:00
Treehugger Robot
1e80f2d47d Merge "vts_fs_test: Statically link libfs_mgr." 2022-03-02 02:29:44 +00:00
David Anderson
0a9c083b87 vts_fs_test: Statically link libfs_mgr.
Bug: 222065493
Test: builds
Change-Id: I9ce4aa2594a4e946c79a51f0ed3d2121c7eaee36
2022-03-01 14:12:26 -08:00
Bart Van Assche
8b162ac936 Merge changes I5a6f587e,I972f4e60,Ib8e1e87f
* changes:
  Introduce the RunService() method
  Introduce the ConfigureMemcg() method
  Introduce the Service::CheckConsole() method
2022-03-01 15:20:03 +00:00
Bart Van Assche
bd73665e68 Introduce the RunService() method
The Service::Start() method is so long that its length negatively
affects readability of the code. Hence this patch that splits
Service::Start().

Test: Booted Android in Cuttlefish.
Change-Id: I5a6f587ecc5e6470137de6cceda7e685bce28ced
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-03-01 15:17:33 +00:00
Bart Van Assche
f2222aab6a Introduce the ConfigureMemcg() method
The Service::Start() method is so long that its length negatively
affects readability of the code. Hence this patch that splits
Service::Start().

Test: Booted Android in Cuttlefish.
Change-Id: I972f4e60844bb0d133b1cca1fd4e06bb89fc5f37
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-03-01 15:17:33 +00:00
Bart Van Assche
847b80a112 Introduce the Service::CheckConsole() method
The Service::Start() method is so long that its length negatively
affects readability of the code. Hence this patch that splits
Service::Start().

Test: Booted Android in Cuttlefish.
Change-Id: Ib8e1e87fbd335520cbe3aac2a88d250fcf3b4ff0
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-03-01 15:17:33 +00:00
David Drysdale
b99ace4af1 Merge "Include correct authorization_set.h header" 2022-03-01 10:31:26 +00:00
Wei Wang
a323e0233d Merge "Support process path for WriteFileAction" 2022-03-01 00:06:57 +00:00
Treehugger Robot
8e4b2bfd5b Merge "Update to KeyMint & iRPC v2" 2022-02-28 21:46:00 +00:00
Shawn Willden
0485712141 Update to KeyMint & iRPC v2
Bug: 221390931
Test: run vts -m vts_treble_vintf_vendor_test
Change-Id: I1749439700f78433d31b52067edb32a031cc8777
2022-02-28 09:35:43 -07:00
Rick Yiu
9221b1eeae Support process path for WriteFileAction
Currently, there is no distinguish between SetTaskProfiles and
SetProcessProfiles in WriteFileAction because they use the same task
path. Add ProcFilePath attribute so that WriteFileAction could use
a separate path for process in SetProcessProfiles.

Bug: 218684257
Test: function works
Change-Id: I004b8c8799240c54f1ef1fed0566fa5057341cf4
2022-02-26 12:38:03 +00:00
Devin Moore
192b5569b0 Merge "Update init/README.md to mention bootconfig for androidboot argument" 2022-02-25 23:00:17 +00:00
Treehugger Robot
5a1f51b070 Merge "Fix OkOrFail<status_t> conversion ambiguities" 2022-02-25 21:15:57 +00:00
Atneya Nair
dde6034eac Fix OkOrFail<status_t> conversion ambiguities
OkOrFail<status_t> has specialized conversions for Result<int, StatusT>
to avoid ambiguous implicit conversion sequences. Since user conversion
operators sequences can be followed by integral promotion, specializing
for integral types is necessary.

Specialize ResultError<StatusT> so calling code() returns a status_t
instead of a StatusT and message() is implemented even when not carrying
a string.
Eventually, these classes should be combined.

Add equality operators for ResultError<StatusT>.

Bug: 219580167
Test: atest Errors_test.cpp
Merged-In: I14acecfd2aef33c40e79ddb091e2f4af9291d837
Change-Id: Ifb5ed3c2d3452b10901e4aeb19368d873225d9ce
2022-02-25 14:27:41 -05:00
Tri Vo
96686aaf60 Merge "Bumping the HAL client version." 2022-02-25 18:03:20 +00:00
Devin Moore
07ec259a54 Update init/README.md to mention bootconfig for androidboot argument
In Android S and later, androidboot.* kernel cmdline parameters are
moved to bootconfig instead the kernel cmdline. This includes the
androidboot.force_normal_boot.

Bug: 219951268
Test: N/A
Change-Id: Id0328ad09a34d654de9936e37a576a8a9f44de6c
2022-02-25 17:04:45 +00:00
Akilesh Kailash
806c29721a Merge "snapuserd: Fallback to synchronous I/O if any errors observed during async merge." 2022-02-25 00:58:19 +00:00
Akilesh Kailash
325e2acbb9 snapuserd: Fallback to synchronous I/O if any errors observed during
async merge.

If there are any I/O errors during async merge, we will
retry the I/O in synchronous I/O path. For this to happen,
we have to reset the iterator so that we replay the blocks
which were partially completed during async merge. Furthermore,
we will disable the async merge and continue to do the I/O
in synchronous path.

Additionally, cut down the queue depth to 8 so that
it will decerease the number of the async offload. We don't
want to have a big queue depth with async offload.

Bug: 220991038
Test: Instrument the code to fail the Async I/O's
randomly and make sure merge is completed. Instrumentation
was done both on readahead and merge code path.

Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: I0db6d0f46054ca5b8423201a598c726b2c3d21ac
2022-02-24 06:08:26 +00:00
Treehugger Robot
7a7c8e4607 Merge "Make task profiles easier to debug" 2022-02-24 02:27:55 +00:00
Treehugger Robot
df62d41eeb Merge "Provide alternate SE RoT provisioning path." 2022-02-23 18:13:01 +00:00
Tri Vo
7da30bd9f8 Merge "trusty: Convert Trusty driver tests to python_test" 2022-02-23 17:58:06 +00:00
Shawn Willden
0f89bc1270 Provide alternate SE RoT provisioning path.
On some devices it is infeasible to provision the KeyMint RoT bits in
the Android Bootloader.  This provides an alternate path to provision
them from the TEE during early boot.

Bug: 219076736
Test: VtsAidlKeyMintTargetTest
Change-Id: Ibae9050b9a102dad3710f9495d3dfa43fa1d1b3f
Merged-In: Ibae9050b9a102dad3710f9495d3dfa43fa1d1b3f
2022-02-22 23:51:15 -07:00
David Drysdale
74f763961a Include correct authorization_set.h header
Bug: 206470603
Test: TreeHugger
Change-Id: I748660d45a539c9e2c2e13605d1d4f61b1b2fb5e
2022-02-23 06:27:16 +00:00
Tri Vo
ccc11f4969 trusty: Convert Trusty driver tests to python_test
Original tests are implemented as shell scripts here:
https://android.googlesource.com/trusty/vendor/google/aosp/+/refs/heads/master/scripts/test-map#100

Bug: 219992178
Test: trusty_driver_test
Change-Id: I8a55cb660bb0cb27bb4ef32aaa0658d0c17c36e3
2022-02-22 17:40:29 -08:00
Yi-yo Chiang
ae0f4d5e45 Merge "TransformFstabForDsu: Insert synthesised entry at end of mount group" 2022-02-20 05:33:41 +00:00
David Anderson
692c6d0f74 Merge "Add a VTS test for Virtual A/B." 2022-02-19 01:28:59 +00:00
David Anderson
7a5379d0e1 Merge "fs_mgr: Fix __ANDROID_RECOVERY__ usage in libfiemap." 2022-02-18 23:29:27 +00:00
David Anderson
36a4784681 Add a VTS test for Virtual A/B.
Bug: N/A
Test: vts_ota_config_test
Change-Id: Ibcee72dcbd9b8d157c3cc989d46fba6277115207
2022-02-18 14:16:44 -08:00
Treehugger Robot
1889a41c88 Merge "Add systrace tag for thermal" 2022-02-18 16:54:53 +00:00
Yi-Yo Chiang
6bcabc03d3 TransformFstabForDsu: Insert synthesised entry at end of mount group
The intention of inserting this synthesised mount entry is for the
FirstStageMount() procedure to eventually fallback to this entry if all
previous mount lines failed.
In order for FirstStageMount() to retry mount, the mount lines have to
be grouped together.
This change ensures that would happen and add test.

Bug: 220074274
Test: atest CtsFsMgrTestCases
Change-Id: Id042a6a6738d27c06a397ef7f4e0977907371c05
2022-02-18 23:00:25 +08:00
Colin Cross
86b6db0b0f Merge "Use sanitizer paths exported by make" 2022-02-18 03:39:26 +00:00
Bart Van Assche
f096bd2d24 Make task profiles easier to debug
Add support for querying the task profile and action names at runtime.
Log more information with verbose logging enabled. The additional
logging statements make it easier to verify whether changes in
task_profiles.json work as expected.

Bug: 213617178
Test: Booted Android in Cuttlefish.
Change-Id: I175e46d142bb015732b135952fdbeb9986f20ee3
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-02-18 03:06:30 +00:00
David Anderson
c2b2bf3539 Merge "remount: Create a bigger scratch partition on /data." 2022-02-18 01:56:27 +00:00
David Anderson
460886c175 Merge "fs_mgr: Don't allow dt fstabs in new devices." 2022-02-18 01:56:09 +00:00
David Anderson
fb921468ab fs_mgr: Fix __ANDROID_RECOVERY__ usage in libfiemap.
Certain code in libfiemap should be unreachable in recovery/ramdisk
builds, but whether intentionally or not, __ANDROID_RECOVERY__ is not
working in vendor_boot.

To make sure this is doing exactly what we want, use __ANDROID_RAMDISK__
instead.

Bug: 205987817
Test: build boot, vendor_boot, recovery
Change-Id: Id419f7d9068e791427a896c22569ae4543548df7
2022-02-17 13:06:13 -08:00
Colin Cross
21527e9794 Use sanitizer paths exported by make
The clang prebuilts now provide a single module with per-architecture
variants instead of a module per architecture, which means the module
name doesn't match the installed file name.  Use the file names
exported from Soong instead of the module names.

Bug: 220019988
Test: m out/target/produuct/coral/system/etc/sanitizer.libraries.txt
Change-Id: I12e7e988ce60d928987db8611883e67f2ecdee87
2022-02-17 11:19:48 -08:00
David Anderson
c1c05daac1 remount: Create a bigger scratch partition on /data.
When creating a scratch partition on /data, use either the size of
super, or half the free space on /data - whichever is smaller.

Bug: 213617068
Test: adb remount
Change-Id: If42fe9e1dc53d5a0137ace917a440232f70947fa
2022-02-17 11:11:07 -08:00
Peter Collingbourne
15a20e3906 Merge "Reland "Add a core configuration that disables the zygote."" 2022-02-17 18:37:21 +00:00
David Anderson
18c6157902 fs_mgr: Don't allow dt fstabs in new devices.
Bug: 214857162
Test: vts_fs_test
Change-Id: I69870fa632b01fdb411371cbb8c5b17271631395
2022-02-17 10:30:59 -08:00
David Anderson
035921dd17 Merge "fastbootd: Remove all scratch partitions on update-super." 2022-02-17 18:24:19 +00:00
Christopher Ferris
f3a800b1cc Merge "Dump threads in tombstone fallback path." 2022-02-17 17:04:55 +00:00
David Anderson
982c3410c7 fastbootd: Remove all scratch partitions on update-super.
This ensures that the dynamic "scratch" partition is removed when doing
a flashall operation.

If "scratch" is on /data, disable the partition. Add IsImageDisabled to
ImageManager so EnsureScratchMapped can skip mapping it. Also, fix
"scratch" not getting unmapped if on /data.

Bug: 205987817
Test: adb remount
      adb sync
      adb reboot fastboot
      fastboot flashall --skip-reboot # no errors
Test: adb-remount-test.sh
Change-Id: I4b9702e1dac15fb663635506fb50a8274e1e10d1
2022-02-17 04:16:53 +00:00
Christopher Ferris
b999b82eb7 Dump threads in tombstone fallback path.
When dumping a tombstone using the fallback path, only the main
thread was showing up. Modify the code to dump the threads using
a slightly different path for the tombstone generation code.

In addition, while looking at this code, two MTE variables were
not set in the tombstone fallback code. Added those variables
so MTE devices will work properly in this fallback path.

Modified the tombstone unit tests for seccomp to have
multiple threads and verify those threads show up in the tombstone.

Bug: 208933016

Test: Ran unit tests.
Test: Ran debuggerd <PID> on a privileged process and verified
Test: all threads dumped. Also verified that the tagged_addr_ctrl
Test: variable is present on the raven device.
Change-Id: I16eadb0cc2c37a7dbc5cac16af9b5051008b5127
2022-02-16 15:02:38 -08:00
Patrick Rohr
78b86ae297 Merge "Remove setCounterSet and deleteTagData support from libcutils" 2022-02-16 19:59:14 +00:00
Treehugger Robot
79aedde9b5 Merge "Disable Async merge. I/O failures seen on one specific device intermittently." 2022-02-16 08:50:36 +00:00
Akilesh Kailash
0cc213be87 Disable Async merge.
I/O failures seen on one specific device intermittently.

Bug: 219642530
Test: OTA
Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: I5b6fbfb13e40b15b25324b70efef11aede916596
2022-02-16 04:20:54 +00:00
Akilesh Kailash
7c63034fc0 Merge "Disable async merge writes until we figure out the intermittent I/O errors." 2022-02-16 01:47:39 +00:00
Treehugger Robot
5d1a87171f Merge changes I6fbbb329,I80a7c0a3
* changes:
  Introduce interface class IProfileAttribute
  Fix a race condition in Service::Start()
2022-02-16 00:11:56 +00:00
Peter Collingbourne
d22ff8a93a Reland "Add a core configuration that disables the zygote."
In targets that do not include a zygote binary, attempting to start the
zygote service will result in repeated service restarts. Avoid this by
providing a way for targets to opt out of declaring a zygote service.

The fvp_mini target does not have a zygote, so apply this opt-out to
that target.

Relanding after fixing breakage on an internal branch.

Bug: 217455793
Change-Id: Ic26f76142afb5f700bd7b12359d62feb2652b617
2022-02-15 16:03:35 -08:00