Commit graph

73564 commits

Author SHA1 Message Date
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
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
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
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
Akilesh Kailash
1a74a82d23 Disable async merge writes until we figure out the intermittent
I/O errors.

Bug: 219642530
Test: OTA

Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: Ica8e95394b92e6893c944676d28e05af2bde9a83
2022-02-15 23:22:04 +00:00
Bart Van Assche
4c99e96e2b Introduce interface class IProfileAttribute
This patch does not change any functionality but makes it easier to add
unit tests in a later patch.

Bug: 213617178
Test: Compile-tested only.
Change-Id: I6fbbb3297795c9d7ece8fb3263b3a9b0e5115b18
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-02-15 22:31:11 +00:00
Bart Van Assche
ee36ba39f9 Fix a race condition in Service::Start()
The SetTaskProfiles() call modifies cgroup attributes. Modifying cgroup
attributes can only succeed after the cgroups and cgroup attributes have
been created. Hence this patch that makes the child process wait until
the parent has finished creating cgroups and activating cgroup
controllers.

Bug: 213617178
Test: Without this patch the migration to the v2 hierarchy does not work reliably. With this patch applied, the migration to the v2 hierarchy works reliably.
Change-Id: I80a7c0a35453d8fd89ed798d077086aa8ba9ea17
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-02-15 22:31:09 +00:00
Treehugger Robot
efc9366188 Merge "Make crash_dump.policy a dependency of crash_dump." 2022-02-15 20:57:56 +00:00
Treehugger Robot
6236db23ca Merge "Declare license metadata for copied files." 2022-02-15 06:57:45 +00:00
Treehugger Robot
e261623906 Merge changes I22e6d914,Iabe7ecd9,I79bdb89e,I6a3cedc7
* changes:
  Make two error messages more detailed
  Use the 'override' keyword where appropriate
  Micro-optimize CgroupMap::ActivateControllers()
  Make class SetTimerSlackAction easier to maintain
2022-02-15 02:55:48 +00:00
Bart Van Assche
6e814b0eb2 Make two error messages more detailed
Provide context information to make it easier to map error messages to
the source code that reported these error messages.

Bug: 213617178
Test: Booted Android in Cuttlefish and verified the error messages in logcat.
Change-Id: I22e6d91476d91dcf32bafe5ead922e5652136584
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-02-15 00:09:34 +00:00
Bart Van Assche
6856cfcb21 Use the 'override' keyword where appropriate
This patch implements the following advice from the Google C++ Style
Guide: "Explicitly annotate overrides of virtual functions or virtual
destructors with exactly one of an override or (less frequently) final
specifier. Do not use virtual when declaring an override. Rationale: A
function or destructor marked override or final that is not an override
of a base class virtual function will not compile, and this helps catch
common errors. The specifiers serve as documentation; if no specifier is
present, the reader has to check all ancestors of the class in question
to determine if the function or destructor is virtual or not."

Bug: 213617178
Test: Booted Android in Cuttlefish.
Change-Id: Iabe7ecd91a2c09a77922c60ff4a00314da509d4a
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-02-15 00:09:34 +00:00
Bart Van Assche
8923d72252 Micro-optimize CgroupMap::ActivateControllers()
The C++ string concatenation operator is inefficient because it always
allocates a new string, even in cases where std::string::apppend() does
not allocate a new string. Hence this patch that replaces string
concatenation with a call to std::string::append().

Bug: 213617178
Test: Booted Android in Cuttlefish.
Change-Id: I79bdb89e957d3cfb40e48ef00c3e5576b4f533a5
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-02-15 00:09:34 +00:00
Bart Van Assche
20d59bd21b Make class SetTimerSlackAction easier to maintain
Unify the Darwin and Linux class declarations. Move all #ifdefs for this
class into the .cpp file. This patch does not change any functionality.

Bug: 213617178
Test: Booted Android in Cuttlefish.
Change-Id: I6a3cedc75c2dbf8aa062edda76cae9959767a763
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-02-15 00:09:34 +00:00
TeYuan Wang
5ad0a9f864 Add systrace tag for thermal
Bug: 218939123
Test: build
Change-Id: Id899df349e83fa7bf4d962e88d683488632df702
2022-02-14 15:13:45 +08:00
Bob Badour
3332e2127a Declare license metadata for copied files.
Bug: 151177513

Test: m nothing reportmissinglicenses
Change-Id: I2d06c042e41eda55930ea3b49efd9f27e35bc520
2022-02-12 21:20:41 -08:00
Treehugger Robot
075b6d725e Merge "Update ro.vendor.api_level for non-GRF devices" 2022-02-11 05:50:15 +00:00
Justin Yun
d1e4f7d157 Update ro.vendor.api_level for non-GRF devices
Non-GRF devices must read only the `ro.product.first_api_level` but
not the vendor build version because `ro.product.first_api_level` is
always less than or equal to `ro.vendor.build.version.sdk` for
non-GRF devices.

Bug: 218610653
Test: getprop ro.vendor.api_level
Change-Id: Ib98c33ae052daa949208c43bd441f98cf442da49
2022-02-11 09:44:31 +09:00
Bob Badour
25bffff0cd Merge "Add LOCAL_LICENSE_KINDS to system/core" 2022-02-10 22:45:41 +00:00
Bob Badour
c9605e6ae1 Add LOCAL_LICENSE_KINDS to system/core
Added SPDX-license-identifier-Apache-2.0 to:
  fastboot/fuzzer/Android.bp
  fs_mgr/fuzz/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Change-Id: I3bb21e1af846d175a345c2a3a632dc47ecdd62de
2022-02-10 11:12:20 -08:00
Akilesh Kailash
1aad41c3e7 Merge changes I5458127b,Ib36bf44c,I481548e8,I449de193
* changes:
  libsnapshot: Propagate io_uring enablement to daemon
  snapuserd: Cut down worker threads
  snapuserd: Terminate daemon spin up during first stage init
  snapuserd: Avoid checking system properties when daemon launched from fist stage init and during selinux transition
2022-02-10 07:34:48 +00:00
Treehugger Robot
2d0281307e Merge "Make apex_available explicit" 2022-02-10 06:13:13 +00:00
Akilesh Kailash
a0049a122d libsnapshot: Propagate io_uring enablement to daemon
During selinux init transition, system properties
are not yet enabled. Hence, store the io_uring feature
in snapshot.proto and propagate the same snapuserd
daemon

Bug: 214340811
Test: OTA
Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: I5458127b00946b5254d5c68d407ab525a0075cb9
2022-02-09 22:46:49 +00:00
Akilesh Kailash
1ab17cc2a1 snapuserd: Cut down worker threads
We don't need 4 threads per partition all the time.
Cut down to 1 thread for all purposes except during boot time.

During boot, we need multiple worker threads to serve
I/O's to speed up the booting process. For all other
purposes, single thread is sufficient. It will cut
down memory usage ~25MB.

Bug: 214340811
Test: OTA
Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: Ib36bf44c63676d3f3169fbda04b7fc3d1760cfbf
2022-02-09 21:26:27 +00:00
Akilesh Kailash
b7f0a04201 snapuserd: Terminate daemon spin up during first stage init
Bug: 214340811
Test: OTA
Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: I481548e878ff7ee5fdf7343fab961a1ded391634
2022-02-09 21:26:11 +00:00