Commit graph

89757 commits

Author SHA1 Message Date
Jooyung Han
efbc08e0ce Merge changes from topic "refactor-init-servicelist" into main
* changes:
  init: remove interface checks from init
  host_init_verifier: check interface names directly
  init_parser_fuzzer: remove interface checks
2024-08-26 07:55:35 +00:00
Treehugger Robot
390f58eb8a Merge "init.rc: Fix entropy pool initialization" into main 2024-08-23 20:22:35 +00:00
Nick Kralevich
1220d17108 init.rc: Fix entropy pool initialization
Init is responsible for initializing the /dev/[u]random entropy
pool, to ensure that high quality random numbers are available
to all Android processes. Previously Android mixed in data
from /system/etc/prop.default, which included properties which
differed on a device-by-device basis. That file no longer exists,
and init generates the following error at boot:

  init: Command 'copy /system/etc/prop.default /dev/urandom'
  action=init (/system/etc/init/hw/init.rc:106) took 0ms and
  failed: Could not read input file '/system/etc/prop.default':
  open() failed: No such file or directory

Instead of reading a property file, this change modifies init.rc
to read from /proc/bootconfig. The bootconfig file contains
per-device data which was previously on the command line, such
as androidboot.serialno. Additionally, it contains device-class
information such as androidboot.hardware,
androidboot.hardware.platform, and data which frequently churns
such as androidboot.vbmeta.digest. These help ensure that the
random number initialization is at least unique on a per
device-class basis.

Relying on /proc/bootconfig accomplishes the same goal that
relying on /system/etc/prop.default was intended to accomplish.
And /proc/bootconfig is in a more stable location than
/system/etc/prop.default, hopefully preventing future regressions.

Bug: 361624398
Test: Device boots and error above goes away
Change-Id: Id5c891e871217d62ff6517c5804b4acc2d723622
2024-08-23 11:17:41 -07:00
Julien Desprez
a989252bdd Merge "Move snapuserd_test to general-tests" into main 2024-08-23 16:03:50 +00:00
Julien Desprez
3f11b6ac64 Move snapuserd_test to general-tests
The test should be able to build and run from generic-build.

Change-Id: I380565bbcae53c454fa1cbff655c8c6fe1000097
Test: presubmit
Bug: 358400696
2024-08-23 04:02:09 +00:00
Florian Mayer
2d75f82aaf Merge "[MTE] write stack history into tombstone" into main 2024-08-21 21:00:41 +00:00
Jooyung Han
d51fb54d56 init: remove interface checks from init
HIDL interface checks are done by host_init_verifier at build-time.

Bug: 326827772
Test: mmma system/core/init
Change-Id: I18e9590aba614bebfdbc6aa8bca7036821a6c4f3
2024-08-21 17:44:09 +09:00
Jooyung Han
95c4242cf6 host_init_verifier: check interface names directly
Previously, ServiceParser did the check, but only when it's invoked by
host_init_verifier. Host_init_verifier can do it directly, which removes
unnecessary runtime dependencies from init.

Bug: 326827772
Test: host_init_verifier detects wrong HIDL interface names.
Change-Id: I4c8bb0e89a5def7341c48c52af730795a6ee13c0
2024-08-21 17:42:05 +09:00
Jooyung Han
d6790c4bc6 init_parser_fuzzer: remove interface checks
CheckInterfaceInheritanceHierarchy() is for host_init_verifier to check
the interface names at buildtime. We don't need to fuzz the host-side
verification code.

Bug: 326827772
Test: run init_parser_fuzzer
Change-Id: Ie01dc2953fd6e69ef3c2cb9caadf7b9964a3d244
2024-08-21 17:42:05 +09:00
Florian Mayer
e3e7bc7d90 [MTE] write stack history into tombstone
We will change the symbolizer to use this information to output
something like:

Potentially referenced stack object:
  0 bytes inside a stack variable "variableName" in stack frame of function functionName
  at source.cc:1234

Bug: 309446520
Change-Id: I1163ac81ac6b5e184387eb9e058d97a7227e3671
2024-08-20 18:04:01 -07:00
Jooyung Han
a7eb62c896 Merge "init: clean up unused Service[List]::post_data" into main 2024-08-20 02:15:40 +00:00
Julien Desprez
14807185ac Merge "Reland aosp/3144167: Migrate vts_libsnapshot_test and friends to general-tests zip" into main 2024-08-19 19:21:47 +00:00
Julien Desprez
4c6edd3c8f Reland aosp/3144167: Migrate vts_libsnapshot_test and friends to general-tests zip
for things that works in VTS, they should be buildable in general-tests
zip rather than device-tests. Which is cheaper in term of build resources.

The underlying issue should have been fixed in b/349278999

Change-Id: I611db1d60bd5b29f42f3404ed8b313024aca39ce
Test: presubmit
Bug: 358400696
2024-08-19 16:12:44 +00:00
Jooyung Han
148f602f23 init: clean up unused Service[List]::post_data
post_data was used by Userspace Reboot, which was removed.

Bug: 293377020
Test: atest CtsInitTestCases
Change-Id: I1a5bf328f62b8afbe58eef62c64689471e6b018c
2024-08-19 14:30:37 +09:00
Treehugger Robot
50a5cc57fe Merge "Convert ramdisk_node_list to Android.bp" into main 2024-08-16 14:51:15 +00:00
Florian Mayer
3371db1715 Merge "Allow to re-enable MTE a specified time after a permissive fault" into main 2024-08-15 18:33:14 +00:00
Rick Yiu
766b0fbedb Merge changes from topic "multi_window_foreground_group" into main
* changes:
  Add a new policy for for foreground of multi-window
  Create a new group for foreground of multi-window
2024-08-15 13:15:29 +00:00
Treehugger Robot
04636c8ff8 Merge "Remove InitProperties" into main 2024-08-15 07:56:10 +00:00
Nelson Li
560cb93d9e Convert ramdisk_node_list to Android.bp
`ramdisk_node_list` is a hardcoded dependency in
`build/make/core/Makefile`, but it only serves as an input for
generating `ramdisk.img` and isn't installed on the device.

Therefore, we can directly use a `filegroup` and set
`export_to_make_var` for use in build/make/core/Makefile.

In addition, since there are no `Android.mk` files in the
subdirectories of `system/core/rootdir/`,
`include (callall−makefiles−under,(LOCAL_PATH))` can also be
deleted.

Bug: 359423289
Test: m -j $(PRODUCT_OUT)/ramdisk.img
Change-Id: Ia2bf636bfd7917bf7044d9726b4b52932bb161c8
2024-08-15 11:36:12 +08:00
Rick Yiu
a726c8c28c Add a new policy for for foreground of multi-window
Add SP_FOREGROUND_MW.

Bug: 200769420
Test: build pass
Change-Id: I203ebb2cbe0409b7bee8542ad276cd4e96c8eacb
2024-08-15 01:33:11 +00:00
Rick Yiu
673e6bb089 Create a new group for foreground of multi-window
In multi-window mode, currently the focused window will be top-app,
and others will be foreground. However, the cpu resource we assign to
typical foreground group may not meet the performance need of those
windows. Therefore, create a new group for them so that we could
distinguish their performance need.

Bug: 200769420
Test: group created
Change-Id: I84c61f9ed4d167e156dafb7a816b6482e80a8523
2024-08-15 01:29:48 +00:00
Florian Mayer
095f292095 Allow to re-enable MTE a specified time after a permissive fault
The timeout has to be determined experimentally. Generally, it must be
high enough to at least be the next instruction, and can be otherwise as
low as performance reasons allow.

This feature is for debugging only.

Test: atest PermissiveMteTest
Bug: 309604766
Change-Id: I54eff23374ebb239fd75b3b59ae72a7c33654454
2024-08-14 15:02:54 -07:00
Treehugger Robot
3081d1d024 Merge "libprocessgroup: Convert libprocessgroup_util to static library" into main 2024-08-13 16:11:47 +00:00
Armelle Laine
81b28aa00a Merge "trusty: libtrusty-rs: Add vsock support" into main 2024-08-13 13:44:09 +00:00
Chaitanya Cheemala (xWF)
8cd0f23d1c Merge "Revert^3 "Set block device as RO/RW before mount"" into main 2024-08-13 12:01:15 +00:00
Chaitanya Cheemala (xWF)
1df3536b95 Revert^3 "Set block device as RO/RW before mount"
This reverts commit 61c07a09e8.

Reason for revert: Likely culprit for b/359414718  - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.

Change-Id: Ie40dcc6d3549183ba146c4ff37edc0d1e57d0cca
2024-08-13 08:28:03 +00:00
Treehugger Robot
1aaf2384f2 Merge "Revert^2 "Set block device as RO/RW before mount"" into main 2024-08-13 03:17:06 +00:00
Steven Moreland
1409586daf Merge "init_kill_services_test: smoreland@ owners" into main 2024-08-12 23:12:55 +00:00
T.J. Mercier
ae0b290387 libprocessgroup: Convert libprocessgroup_util to static library
To avoid duplicate symbol linker error and prep for addition of json
descriptor reading and activation functions in upcoming changes.

Bug: 349105928
Test: m
Change-Id: I5cd663d6007ef330b872b8cf8ed046ee68b6d736
2024-08-12 21:15:09 +00:00
David Anderson
780ea239f2 Merge "libsnapshot: Simplify wipe handling in recovery." into main 2024-08-12 16:10:18 +00:00
Armelle Laine
5b7dfb0daa Merge "trusty: libtrusty: Add vsock support" into main 2024-08-12 13:16:37 +00:00
Treehugger Robot
45f03ea6a7 Merge "Remove unnecessary std::move" into main 2024-08-12 12:19:17 +00:00
Yi Kong
eecb107828 Remove unnecessary std::move
Moving a temporary object prevents copy elision, and could reduce
performance.

This fixes -Wpessimizing-move compiler warning.

Test: presubmit
Bug: 154270751
Change-Id: I4900bcfd14d461f7ded0500eca0a6b386ed59c8f
2024-08-12 18:15:19 +08:00
Jooyung Han
412d097d4a Remove InitProperties
As userspace reboot is deprecated, there's no clients.

Bug: 292469129
Test: m
Change-Id: Iafdd719b67fe74dc42498f7ecde2aa5b677ecd0c
2024-08-12 06:59:24 +00:00
Jooyung Han
b29f0dcb5b Merge changes I00deb50c,I82650277 into main
* changes:
  Clean up userspace-reboot (#2)
  Clean up userspace-reboot
2024-08-12 00:40:07 +00:00
Elliott Hughes
20f66bed7a Merge "There's only one <sys/system_properties.h> now." into main 2024-08-10 17:15:08 +00:00
T.J. Mercier
f9f144363b Merge changes I9f850003,Idb270068,I39df9814 into main
* changes:
  libprocessgroup: Remove unused CgroupMap::SetupCgroups declaration
  libprocessgroup: Rename files a_cgroup_controller.cpp, a_cgroup_file.cpp
  libprocessgroup: Rename CgroupController -> CgroupControllerWrapper
2024-08-09 23:26:11 +00:00
Treehugger Robot
fc28da24d0 Merge "Enable secondary_user_on_secondary_display for CtsFsMgrTestCases" into main 2024-08-09 22:57:31 +00:00
Treehugger Robot
576b1be2eb Merge changes I2b0fcb8d,I72510d61 into main
* changes:
  init_kill_services_test: += system_suspend
  init_kill_services_test: formatting for merges
2024-08-09 22:23:31 +00:00
David Anderson
c85af55952 libsnapshot: Simplify wipe handling in recovery.
This refactors HandleImminentDataWipe to address some shortcomings
discovered through testing. Previously, it always called
CreateSnapshotsAndLogicalPartitions, which meant trying to use snapuserd
even if completely unnecessary.

Instead we now peek at the update state and eliminate the "easy" cases
ahead of time. These are "none", "initiated", and "unverified" when
either a rollback happens or there is no forward merge indicator. In
this case we simply return early and allow the wipe to continue
(disabling the current slot if necessary).

The hard case, when a merge is needed, is still handled within
ProcessUpdateStateOnDataWipe. However it's no longer recursive, and it
can assume a merge is about to initiated or already in progress.

In all cases except a merge failure, we change the update state to None
to clear any roadblocks update_engine or the bootloader might encounter.
A merge failure, however, still blocks a data wipe. The way to recover
from this is adb sideload.

Bug: 350613336
Test: vts_libsnapshot_test
      wipe in INITIATED state, no merge
      wipe in UNVERIFIED state, no merge
      wipe in UNVERIFIED + rollback state, no merge
      wipe in MERGING state, merge
Change-Id: I387aabcfa6304118be88ddbb85842111d5c2ef6a
2024-08-09 14:04:30 -07:00
Steven Moreland
aed90550d0 init_kill_services_test: smoreland@ owners
I've always maintained this test, would also take
overall init ownership, ;p

Bugs: me
Test: N/A
Change-Id: Id0ea93226b9afd22f8bc192a5a1b61e15d01f3e2
2024-08-09 20:52:43 +00:00
Steven Moreland
164f297007 init_kill_services_test: += system_suspend
Get coverage for this.

Bugs: me
Test: atest init_kill_services_test
Change-Id: I2b0fcb8d273f89de6d0ad115a8de0c0314dbfc3f
2024-08-09 20:50:51 +00:00
Steven Moreland
d945d20408 init_kill_services_test: formatting for merges
Adding formatting here, as we will start a push for people
using this, if they run into any linkToDeath issue, or if
they want to test this.

Bugs: me
Test: N/A
Change-Id: I72510d61926ce694671d897519463f37892a8d12
2024-08-09 20:50:34 +00:00
T.J. Mercier
7c94e5b25c libprocessgroup: Remove unused CgroupMap::SetupCgroups declaration
SetupCgroups was moved from CgroupMap in libprocessgroup to SetupCgroup
in libprocessgroup_setup, but the old declaration was not removed.

Fixes: 6f9ce2e548 ("libprocessgroup: Move CgroupSetupCgroups() to libprocessgroup_setup")
Test: m
Change-Id: I9f85000392b59a105bb202fae277a5582449822a
2024-08-09 18:35:29 +00:00
T.J. Mercier
9c53c803e1 libprocessgroup: Rename files a_cgroup_controller.cpp, a_cgroup_file.cpp
These are for ACgroupController and ACgroupFile, but share a filename
with libcgrouprc_format's CgroupController which can be confusing.

Bug: 349105928
Test: m
Change-Id: Idb270068169b71b0a33101407ddbb5a38cc8d469
2024-08-09 18:35:29 +00:00
T.J. Mercier
fcb8666eed libprocessgroup: Rename CgroupController -> CgroupControllerWrapper
So that the name is not overloaded with libcgrouprc_format's
CgroupController, which can be confusing.

Bug: 349105928
Test: m
Change-Id: I39df9814c500de68fd20139e661363ba51ea3543
2024-08-09 18:35:29 +00:00
Elliott Hughes
30203af8fd There's only one <sys/system_properties.h> now.
Change-Id: I4d535484b9e25fda304fb748b7796e513c832265
2024-08-09 15:55:38 +00:00
Treehugger Robot
fe4f5a1e6d Merge "Add /mnt/vm and mount tmpfs onto it for early VM" into main 2024-08-09 09:44:10 +00:00
Treehugger Robot
a7f7f4065b Merge "Fix SnapshotTest crash" into main 2024-08-09 07:40:07 +00:00
Jooyung Han
f91503bd18 Clean up userspace-reboot (#2)
Bug: 292469129
Test: CtsInitTestCases
Test: system/core/bootstat/boot_reason_test.sh
Change-Id: I00deb50c5634ade6b69d5b6bf4d08c5101e0beb8
2024-08-09 16:17:20 +09:00