Commit graph

80204 commits

Author SHA1 Message Date
Elliott Hughes
beeef8c01a Merge "mkbootfs: consistency." 2023-01-12 17:02:53 +00:00
David Drysdale
82ef14bf76 Merge "Helper for setting attestation IDs" 2023-01-12 06:20:45 +00:00
Treehugger Robot
52d91b3fc0 Merge "usb: migration to USB gadget AIDL" 2023-01-12 05:37:41 +00:00
Elliott Hughes
ad1a0a9b0b mkbootfs: consistency.
Move all the error reporting over to err()/errx() rather than the
current mix of errx(), fprintf()+exit(), and the homebrew die().

Also make the two "read all the lines in the file" loops match, by
copying the newer getline() style into the older fgets() loop.

Test: treehugger
Change-Id: Ia732df90588d7fd12dfe965e11c6ed72a96b098d
2023-01-12 04:34:15 +00:00
Treehugger Robot
99b26cf41b Merge "remount: Add checkpoint instructions with warning" 2023-01-12 01:44:03 +00:00
Treehugger Robot
a4dae3c6f5 Merge "Do not create worker thread if threading isn't enabled" 2023-01-12 01:12:06 +00:00
Chih-hung Hsieh
4c3b71ee83 Merge "Suppress clang-analyzer-security.FloatLoopCounter warnings" 2023-01-12 00:18:27 +00:00
Daniel Rosenberg
61b2304ffb remount: Add checkpoint instructions with warning
When debugging an issue before boot complete, it may be necessary to
remount before checkpointing can finish. This gives instructions on
ending checkpointing early, allowing a remount, along with a warning to
not do that unless you know what you are doing.

Bug: 252989722
Test: Displays text in log
Change-Id: Ibdd39464b980ec531a900e162469a884f9096904
2023-01-12 00:04:54 +00:00
Treehugger Robot
e8d42e65c8 Merge changes I169b52cf,Ieb0e4e24
* changes:
  init: Add test for gentle_kill
  init: Add gentle_kill service property
2023-01-11 23:16:55 +00:00
Chih-Hung Hsieh
dfd1d517b1 Suppress clang-analyzer-security.FloatLoopCounter warnings
* Suppress also the alias check name cert-flp30-c.
* Leave comment in code for code owners to rewrite
  the loop with integer counters.

Bug: 265171053
Test: presubmit; tidy-system-core-storaged_subset
Change-Id: I8297161366a7a2e1c7cdbec8efb7a8e9e435166a
2023-01-11 14:21:46 -08:00
Treehugger Robot
46134b9cae Merge "Zero-length packet send bug resolution for fastboot." 2023-01-11 20:55:28 +00:00
Akilesh Kailash
717ee9120a Merge "init: Avoid killing all processes during reboot if update is in progress" 2023-01-11 20:52:13 +00:00
Shaju Mathew
dce1371666 Zero-length packet send bug resolution for fastboot.
Bug: 208675141

Test: Treehugger, cursory test of fastbootd against macOS Monterey running fastboot.

Change-Id: Id2ac1be428470385c866d505f860e50bd9132e2e
Signed-off-by: Shaju Mathew <shaju@google.com>
2023-01-11 19:32:01 +00:00
Treehugger Robot
7fcaa14e27 Merge "Add comment about out-of-bounds being on purpose" 2023-01-11 18:55:18 +00:00
Treehugger Robot
d2401873f2 Merge "Parser::ParseConfigFile returns Result<void>" 2023-01-11 12:11:18 +00:00
Treehugger Robot
bf3c1c56d8 Merge "BatteryMonitor: fix depending on multiple versions of the same aidl_interface" 2023-01-11 11:25:17 +00:00
Jooyung Han
6b88d1684c Parser::ParseConfigFile returns Result<void>
ParseApexConfigs() uses Parser::ParseConfigFile() to parse .rc files in
the target apex. ParseConfigFile() returning bool (with logging on
error) doesn't propagate the error message back to the callers
(including apexd or PackageManager).

We'd better to migrate other Parse*() methods of Parser class to return
Result<T>. But this change focuses on plumbing error progagation for
APEX configs.

Bug: 238820991
Test: atest CtsInitTestCases
Change-Id: Ifad97635dbb53a70053ec73a7a5b7e742466daf6
2023-01-11 17:20:16 +09:00
Akilesh Kailash
2c52d09078 init: Avoid killing all processes during reboot if update is in progress
Bug: 262321167
Test: Reboot device post OTA reboot
Change-Id: I5d13844e4e157d24a414dce668163bb1915bf65e
Signed-off-by: Akilesh Kailash <akailash@google.com>
2023-01-11 06:00:34 +00:00
Daniel Rosenberg
ed8178c8cc init: Add test for gentle_kill
Tests that a service marked as gentle_kill terminiated with SIGTERM

Bug: 249043036
Test: atest CtsInitTestCases:init#GentleKill
Change-Id: I169b52cfd74f07b4d2439761ea315117323b3fcb
2023-01-10 18:29:46 -08:00
Daniel Rosenberg
de76688e40 init: Add gentle_kill service property
If a service specifies gentle_kill, attempt to stop it will send SIGTERM
instead of SIGKILL. After 200ms, it will issue a SIGKILL.

Bug: 249043036
Test: atest CtsInitTestCases:init#GentleKill
      Added in next patch
Change-Id: Ieb0e4e24d31780aca1cf291f9d21d49cee181cf2
2023-01-10 18:29:46 -08:00
Jack Wu
f83e5a6ebd BatteryMonitor: fix depending on multiple versions of the same aidl_interface
When health aidl_interface version updraged, some libraries are
depending on V1 and libbatterymonitor or libhealthd_charger_ui at
the same time. It will cause multiple versions depending if
libbatterymonitor or libhealthd_charger_ui are depending on new
version.

Fork libbatterymonitor and libhealthd_charger_ui to generate two
versions, so that other libraries can depend on the same aidl_interface
version, to avoid multiple versions depending.

Bug: 251425963
Test: build
Change-Id: I37ba23169428677550176916e5d0b52c154d7b85
Signed-off-by: Jack Wu <wjack@google.com>
2023-01-11 08:58:46 +08:00
Florian Mayer
fe9d83251b Merge "Use scudo_ring_buffer_size from process_info" 2023-01-10 21:23:33 +00:00
Kelvin Zhang
124492d875 Do not create worker thread if threading isn't enabled
Currently, we would create worker threads even if number of compression
thread is set to 1. This works, but having context switches and data
exchange between two threads is complete overhead if main thread is just
blocking on the worker thread.

Test: th
Change-Id: I02f98ee1e0c4889dc1ae602eb06667b05796d3f0
2023-01-10 12:09:46 -08:00
David Drysdale
2ac6aed466 Helper for setting attestation IDs
Useful for testing on unprovisioned devices, so that IDs match those
expected by the VTS tests.

Note that any attestation involving the values set as attestation IDs
will only be signed by a fake key, and so will not be a valid
attestation of anything.

Bug: 258602662
Test: VtsAidlKeyMintTargetTest --gtest_filter="*NewKeyGenerationTest.EcdsaAttestationIdTags*default"
Change-Id: Ic31e4f28ec3a2830ae12a794b2fa063944df2614
2023-01-10 06:30:06 +00:00
Ricky Niu
ba43d547b6 usb: migration to USB gadget AIDL
Using the USB gadget AIDL

Bug: 261027750
Test: USB function switch success and AIDL service is running.
Change-Id: I4781ac9eb641a5340ecfb6bda0881761b7a01eb2
2023-01-10 11:24:36 +08:00
Treehugger Robot
22e18082d1 Merge "Fix the cgroup v2 thread path" 2023-01-10 01:30:07 +00:00
Colin Cross
6f2dab0ba7 Merge "Use err() instead of error() in mkbootfs" 2023-01-10 00:09:12 +00:00
Mariah Papy
f079b5ca01 Merge "Android typo fix exercise, uknown -> unknown Test: refactoring CL. Existing unit tests still pass." 2023-01-09 23:12:47 +00:00
Bart Van Assche
0e8e4f87fd Fix the cgroup v2 thread path
The name for the file with thread IDs is "tasks" in the v1 hierarchy and
"cgroup.threads" in the v2 hierarchy.

References:
* https://www.kernel.org/doc/html/latest/admin-guide/cgroup-v1/cgroups.html
* https://www.kernel.org/doc/html/latest/admin-guide/cgroup-v2.html

Bug: 213617178
Fixes: 82b72a5667 ("libprocessgroup: Add support for task profiles")
Change-Id: I87d67edeb12803cb83486be8f1b1b56a3f275a9d
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-01-09 14:40:51 -08:00
Colin Cross
6f2ae489d7 Use err() instead of error() in mkbootfs
error() is a glibc extension that is not available in musl libc.
err() is a BSD extension, but is present in glibc, musl libc and
bionic.

Test: m USE_HOST_MUSL=true host-native -k
Change-Id: I2ba7bddc2a725826be8be7f80208587b81de9238
2023-01-09 14:15:27 -08:00
Florian Mayer
04fb2c838d Add comment about out-of-bounds being on purpose
Change-Id: I97e334f0555cce80eeab6567905054d807af3c91
2023-01-09 21:46:10 +00:00
Mariah Papy
23f6b6727d Android typo fix exercise, uknown -> unknown
Test: refactoring CL. Existing unit tests still pass.

Change-Id: I8b8d1f3f54f3c1c6b05b9a41a49ed5c418140310
2023-01-09 19:13:01 +00:00
Carlos Galo
177f5b1822 Merge "Set memlock rlimit to 64KB" 2023-01-09 19:05:59 +00:00
Vincent Donnefort
60305abf38 Merge changes Ieb75b1d1,Id1c83c8b,I8cb3de94
* changes:
  mkbootfs: Add support for a dev node list file
  mkbootfs: Add support for dev nodes
  mkbootfs: Use getopt_long
2023-01-09 18:21:42 +00:00
Kalesh Singh
93e02c6da6 Merge "init: Take wakelock on zygote restart" 2023-01-09 17:55:09 +00:00
Vincent Donnefort
99ab52101c mkbootfs: Add support for a dev node list file
Let mkbootfs create a list of dev nodes and directories, based on a
file:

  $ mkbootfs -n node_file initramfs/ > initramfs.cpio

This file is following the same format as the kernel usr/ cpio list:

  $ cat node_file
  # My device nodes
  dir dev 0755 0 0
  nod dev/null 0600 0 0 c 1 5

Bug: 254835242
Change-Id: Ieb75b1d1026a9426581b6f2b3aa692a05722ba0d
2023-01-09 09:31:14 +00:00
Bill Yi
3e3e5a609b Merge "Merge TQ1A.230105.002 to aosp-master - DO NOT MERGE" 2023-01-06 19:33:50 +00:00
Vincent Donnefort
c297135302 mkbootfs: Add support for dev nodes
Add the ability of packaging dev nodes in the CPIO.

Change-Id: Id1c83c8bcd3724de03214788c9af592f9817285f
2023-01-06 17:19:09 +00:00
Vincent Donnefort
7f01774abd mkbootfs: Use getopt_long
Make the arguments more flexible with the help of getopt_long. While at
it, add a mkbootfs help.

Change-Id: I8cb3de9425418651374b9d0a4db5629d1659c3f3
2023-01-06 17:19:09 +00:00
David Brazdil
468c62a037 Merge "Change permissions of /data/misc/virtualizationservice" 2023-01-06 16:13:32 +00:00
Bill Yi
5b90068f59 Merge TQ1A.230105.002 to aosp-master - DO NOT MERGE
Merged-In: Ib197e061431509a6792a6fb429ce5d7a936821dc
Merged-In: I1c40f6df3564164168f3e35265250743ab6cabf6
Change-Id: I79b65cfbf50287e6ee88cff1949d0da961847f37
2023-01-06 07:13:50 -08:00
Jooyung Han
ddfa08b98b Merge "Revert "Migrate the blkio controller to the v2 cgroup hierarchy"" 2023-01-06 07:16:30 +00:00
Jooyung Han
c7a6fe684c Revert "Migrate the blkio controller to the v2 cgroup hierarchy"
Revert submission 2218645-blkio-cgroup-v2

Reason for revert: 260143932, 264620181

Reverted changes: /q/submissionid:2218645-blkio-cgroup-v2

Change-Id: I8bf1592cd5f7234f28094fe80341c37d42fa609b
2023-01-06 06:20:54 +00:00
Bart Van Assche
515c924312 Merge "Migrate the blkio controller to the v2 cgroup hierarchy" 2023-01-06 00:21:08 +00:00
Elliott Hughes
c0748f0276 Merge "debuggerd: show syscall in SYS_SECCOMP one-liners." 2023-01-05 23:30:08 +00:00
Florian Mayer
bd49c387f0 Use scudo_ring_buffer_size from process_info
This is a no-op but will be used in upcoming scudo changes that allow to
change the buffer size at process startup time, and as such we will no
longer be able to call __scudo_get_ring_buffer_size in debuggerd.

Bug: 263287052
Change-Id: I350421d1fcdf22ce3b8b73780b88c1e10fa8a074
2023-01-05 15:14:56 -08:00
Bart Van Assche
5400ae2440 Migrate the blkio controller to the v2 cgroup hierarchy
There are multiple use cases in Android for which background writes need
to be controlled via the cgroup mechanism. The cgroup mechanism can only
control background writes if both the blkio and memcg controllers are
mounted in the v2 cgroup hierarchy. Hence this patch that migrates the
blkio controller from the v1 to the v2 cgroup hierarchy.

This patch increases the TOTAL_BOOT_TIME for devices with a 4.19 kernel
(redfin) from 18.9 s to 20 s. This patch does not affect the boot time
for devices with a 5.10 or 5.15 kernel.

This patch increases the time spent in CgroupMap::ActivateControllers()
by 25 microseconds in Cuttlefish on an x86-64 CPU.
CgroupMap::ActivateControllers() is called by Service::Start().

Bug: 213617178
Test: Cuttlefish and various phones
Change-Id: I490740e1c9ee4f7bb5bb7afba721a083f952c8f2
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-01-05 13:07:00 -08:00
Bart Van Assche
de7851c2d3 Merge "task_profiles.json: Convert tabs into spaces" 2023-01-05 21:06:33 +00:00
Bart Van Assche
6ad747ac2d task_profiles.json: Convert tabs into spaces
Commit 9c0fcbb0f7 ("libprocessgroup: Add I/O scheduler attributes to
task_profiles.json") accidentally introduced tabs in task_profiles.json.
Convert these tabs into spaces.

Bug: 213617178
Change-Id: I7ac59dbd40aa3da295646792e35b8275fbb97991
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-01-05 13:03:47 -08:00
David Brazdil
bc491e2544 Change permissions of /data/misc/virtualizationservice
The folder is used for temporary files of virtualizationservice, with
a subfolder for each running VM. This wil continue to be the case but
each subfolder will be populated by a different instance of virtmgr,
running under the UID of the client (as opposed to system UID of
virtualizationservice).

To this end, change the permission mask of the root folder from 0770 to
0775. This gives non-system UIDs the permission to search the root
folder. This is necessary for the clients to be able to search their
own subfolder. It does not give them permission to read other
subfolders as those will be owned by different client UIDs.

Bug: 245727626
Test: atest -p packages/modules/Virtualization:avf-presubmit
Change-Id: Ie6e3be601ccb3b385f70bcf5b31bf8fff3aff8bc
2023-01-05 18:10:20 +00:00