Commit graph

75208 commits

Author SHA1 Message Date
Treehugger Robot
0f2cc4e4d4 Merge "Adding trong@google.com as fuzzer owner for trusty fuzzers" 2022-04-18 23:09:18 +00:00
Anis Assi
5f43e61fef Adding trong@google.com as fuzzer owner for trusty fuzzers
Bug: 221891733
Change-Id: I41895ffbd6d65f9f3de90088c5f0b9ba2f3210d4
2022-04-18 20:42:10 +00:00
Florian Mayer
378969f949 Add hwasan presubmit for debuggerd.
Change-Id: Ic6b27b89470f4e8fb21dd29f8a8f486b528bdedc
2022-04-18 20:27:52 +00:00
Jiyong Park
5590e1152e Merge changes from topic "task_profile_crosvm"
* changes:
  Virtualizationservice is owned by the system UID
  /dev/[kvm|vhost-vsock] are owned by system
2022-04-18 16:38:29 +00:00
Bowgo Tsai
243df2d917 Merge "fs_mgr: Don't assume partitions replaced by DSU are logical already" 2022-04-18 09:39:25 +00:00
Tim Zimmermann
496132bc99 fs_mgr: Don't assume partitions replaced by DSU are logical already
Test: Boot DSU on a device without dynamic partitions but first_stage_mount for /system

Change-Id: I07f0f40037109aaaf1bce0151d1eac26c971ba9e
2022-04-17 08:22:34 +02:00
Akilesh Kailash
e3cca4a0d1 Merge "libsnapshot: Remove invalid snapshot metadata" 2022-04-16 22:55:56 +00:00
Akilesh Kailash
f86fca236f libsnapshot: Remove invalid snapshot metadata
If there are snapshot metadata persisting in /metadata/ota/snapshots,
remove them before applying a new update. Make sure that
the snapshots are indeed invalid before removing them.

On a sidenote, add a comment in init.cpp related to
b/223076262.

Bug: 228250473
Test: 1: Apply OTA in recovery through adb sideload
2: Reboot
3: Apply OTA OTA again through update_device.py
4: Re-run Full OTA updates just from update_device.py

Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: I116bbafae09042b9c391ccd58c102704571c214e
2022-04-16 16:43:35 +00:00
Florian Mayer
4691a163c1 Merge "Skip debuggerd tests that do not apply to HWASan." 2022-04-16 06:03:38 +00:00
David Anderson
6776e645f1 Merge changes I16bd2d5e,I04e9bf73
* changes:
  DO NOT MERGE: Revert "init: Add more diagnostics for signalfd hangs."
  DO NOT MERGE: Revert "init: Add diagnostics for signalfd epoll failures."
2022-04-16 05:32:58 +00:00
Florian Mayer
b4979293b3 Skip debuggerd tests that do not apply to HWASan.
Change-Id: Ieab61dc61e11c3e55f116a45c37ceb805a6212e0
2022-04-15 15:41:59 -07:00
David Anderson
e966e6e75f DO NOT MERGE: Revert "init: Add more diagnostics for signalfd hangs."
This reverts commit 14f9c15e05.

Reason for revert: Diagnostics no longer needed

Change-Id: I16bd2d5e54f5e1b867712453a5563acc436d88e9
2022-04-15 01:00:51 +00:00
David Anderson
fc90774ef2 DO NOT MERGE: Revert "init: Add diagnostics for signalfd epoll failures."
This reverts commit 0fa7c40c4c.

Reason for revert: Diagnostics no longer needed

Change-Id: I04e9bf73b89411f7092348f57bfe6eb7dfaa9fcb
2022-04-15 01:00:27 +00:00
Mitch Phillips
1e0969997a [GWP-ASan] Enable debuggerd to pull more allocation metadata.
With the addition of runtime-configurable GWP-ASan, there might be many,
many more than 1,000 allocations. Have support for them, but keep a
hopefully-won't-crash-the-device limit.

Bug: 219651032
Test: atest bionic-unit-tests

Change-Id: I7b8e2bf5ab7c723ab6c61365f0dc610e400dbbce
2022-04-14 11:30:05 -07:00
Treehugger Robot
b18826fc3b Merge "c wrapper for SetProcessProfiles" 2022-04-14 16:52:42 +00:00
Jiyong Park
93c66bbd89 Virtualizationservice is owned by the system UID
Previously, virtualizationservice had its own UID
`virtualizationservice`. As a result, crosvm, which is spawed by
virtualizationservice`, also run as the UID. However, that prevented us
from applying task profiles to the crosvm process because joining a
process to a cgroup requires system UID.

To fix that, virtualizationservice now runs as system UID. As a result,
this directory that virtualizationservice accesses has to change its
owner and group to system.

Bug: 223790172
Bug: 216788146
Test: watch TH

Change-Id: I2bdf49e99f1841bf77ff046b0c2455064b174e0a
2022-04-15 00:05:38 +09:00
Jiyong Park
5b178328a3 /dev/[kvm|vhost-vsock] are owned by system
/dev/kvm and /dev/vhost-vsock are used by crosvm. Previously, it ran as
a custom UID `virtualizationservice`. However, this prevented us from
applying task profiles to the crosvm process because joining a process
to a cgroup requires system UID.

Now, crosvm (and its parent virtualizationservice as well) runs in
system UID. Therefore, the ownership of two device files are also
updated accorgly.

BUG=b:216788146
BUG=b:223790172
Test: watch TH

Change-Id: I1f63a12532d3a2cb5724291dbbb40210bd7c9203
2022-04-15 00:05:38 +09:00
Jiyong Park
8bf5940012 c wrapper for SetProcessProfiles
The wrapper is to call SetProcessFiles (C++ API) from crosvm via FFI.

Bug: 223790172
Bug: 216788146
Test: m

Change-Id: If342ca0d19deb1cb7ee581bba2cc543385199cbe
2022-04-15 00:05:34 +09:00
Inseob Kim
9c822b55e0 Merge "Reland "libprocessgroup: return false on failure"" 2022-04-14 03:44:37 +00:00
Christopher Ferris
707deba65b Merge "Add two new crash commands." 2022-04-14 01:11:11 +00:00
Christopher Ferris
4f600fe073 Add two new crash commands.
One is intentionally seeting the abort message. The other is to set
the abort message to null.

Also, make the libseccomp_policy static so that the crasher
executable can be copied to the system afterwards without
requiring libseccomp_policy.so.

Test: Ran both new crash commands on device.
Test: Ran the seccomp crash command to verify seccomp still works.
Change-Id: I255b5f37e6eb188719e5b72302ca3f5911c8d821
2022-04-13 16:38:16 -07:00
Inseob Kim
538fc1fab1 Reland "libprocessgroup: return false on failure"
This reverts commit c109b13b5a.

Reason for revert: uploading with a CL fixing the broken test

Change-Id: I97a0a49ded8bc17c2d70c82f8e48fce09e49b2bd
2022-04-13 18:50:12 +00:00
Jiyong Park
a2b180ab64 Merge "Revert "libprocessgroup: return false on failure"" 2022-04-12 19:50:54 +00:00
Jiyong Park
c109b13b5a Revert "libprocessgroup: return false on failure"
This reverts commit 9818f95c9e.

Reason for revert: broke some tests. b/228910109

Change-Id: I2d5f837969e433b765de89d899fc172ceeef27a6
2022-04-12 19:48:04 +00:00
Thurston Dang
b37b47df01 Merge "[trusty][apploader] Handle APPLOADER_ERR_POLICY_VIOLATION" 2022-04-12 19:21:05 +00:00
Steven Moreland
f5ca027819 Merge "Mark libutilscallstack min sdk version." 2022-04-12 17:41:41 +00:00
Kalesh Singh
cb965e093c Merge "Set Multi-Gen LRU enabled based on experiment prop" 2022-04-12 13:48:48 +00:00
Steven Moreland
6c509ca3c3 Mark libutilscallstack min sdk version.
Mark this as 29 for easy inclusion in APEXes when debugging. Make
sure we don't introduce calls to things here which would prevent
this from being used on old platforms.

Fixes: 228561718
Test: build
Change-Id: I2574455dbfe681117e4afcf6eef3546be51393fa
2022-04-11 22:30:07 +00:00
Jiyong Park
64f953e287 Merge "libprocessgroup: return false on failure" 2022-04-11 21:16:32 +00:00
Jiyong Park
9818f95c9e libprocessgroup: return false on failure
SetProcessProfiles and SetTaskProfiles now correctly return false on
failure.

Bug: N/A
Test: settaskprofile <some_pid> <non_existing_name>

Change-Id: I7936303e71cd073c0ba713109328b960c66bdacc
2022-04-11 01:51:23 +09:00
Treehugger Robot
086ed5584b Merge "[libtrusty-rs] Add recv variant that uses Vec<u8>" 2022-04-08 22:42:22 +00:00
Kalesh Singh
bd42559beb Set Multi-Gen LRU enabled based on experiment prop
Experiments can enable/disable MG-LRU using the
persist.device_config.mglru_native.lru_gen_enabled property
which will update the coresponding sysfs control to enable or
disable this feature in the kernel.

Test: adb shell device_config put mglru_native lru_gen_config [none, core, ...]
Test: verify MG RLU is enabled/disabled: cat /sys/kernel/mm/lru_gen/enabled
Bug: 227651406
Bug: 228525049
Change-Id: I0708df8c78a85359d5cb6d5b167836768029380e
2022-04-08 13:54:10 -07:00
Treehugger Robot
3e22bc616b Merge "Configure rustfmt for preupload hook" 2022-04-08 16:25:46 +00:00
Treehugger Robot
b5a5095bf0 Merge "Add jiyong@ to OWNERS." 2022-04-08 04:23:02 +00:00
David Anderson
9f1c919115 Add jiyong@ to OWNERS.
Change-Id: Iada34671296ebb7c1dc372638c91320bad6e7166
2022-04-07 19:15:01 -07:00
Treehugger Robot
50e130ed73 Merge "[Init] Create dir for odsign metrics" 2022-04-07 20:30:41 +00:00
Treehugger Robot
3153efa864 Merge "Setup tests for libtrusty-rs" 2022-04-07 19:45:20 +00:00
Treehugger Robot
c5b7488c63 Merge "Make some debuggerd libraries available in apex com.android.virt" 2022-04-07 13:25:45 +00:00
Treehugger Robot
02360a55b7 Merge "Clean up comments/logs" 2022-04-07 03:17:38 +00:00
David LeGare
dc2d792adc [libtrusty-rs] Add recv variant that uses Vec<u8>
* Add new `recv` method that takes a `Vec<u8>` and automatically
  allocates extra buffer space and retries the read call if the buffer
  does not have enough capacity.
* Rename the existing `recv` method to `recv_no_alloc`, and update docs
  to clarify the behaviors of both methods.
* Add tests for the new `recv` method and update existing tests to use
  `recv_no_alloc` instead.

Test: tipc-test-rs -m 1024 -t echo
Bug: 226659377
Change-Id: Ic437b617751e865da119fe0c4ef8aa456a63bf3c
2022-04-06 22:40:05 +00:00
David LeGare
acd1ef731a Configure rustfmt for preupload hook
Test: N/A
Change-Id: I8f7cecfa00777983540b8fd74da9bab1753bfc01
2022-04-06 21:11:09 +00:00
David LeGare
23dedb660e Setup tests for libtrusty-rs
Test logic is based on the tests in the original tipc-test C binary,
but adapted to use the Rust unit test infrastructure to make running
tests easier.

Test: Ran the tests
Bug: 226659377
Change-Id: I998013b2f8b304299acb09d58beb49330747802a
2022-04-06 21:11:04 +00:00
Kelvin Zhang
f887e74588 Clean up comments/logs
Test: th
Change-Id: Ie63cfab7bf8d5d8e3e91695259cf62ab3ac17ee9
2022-04-06 14:02:13 -07:00
Shikha Panwar
4b91af7d24 [Init] Create dir for odsign metrics
This is required so that system_server can read/delete the file(s) in
/data/misc/odsign/metrics & report to statsd

Note the group change in odsign directory was required so that
system_server can get the execute permission to read file in the sub dir

Test: adb shell ls -l /data/misc/odsign/metrics
Bug: 202926606
Change-Id: I6dd80e05bbfb9daf4aa3e996fc22bba1de8bd2ce
2022-04-06 17:51:08 +00:00
Akilesh Kailash
a3ab0a41f2 Merge "libsnapshot: OTA upgrade when vendor partition is S" 2022-04-05 22:27:03 +00:00
Treehugger Robot
c942dc549a Merge "Add libtrusty-rs" 2022-04-05 20:54:18 +00:00
Thurston Dang
45dbdd1ef0 [trusty][apploader] Handle APPLOADER_ERR_POLICY_VIOLATION
Add a specific error message to the Android CLI tool for the
case where the policy engine (http://go/aog/2051516) disallows
loading.

Test: Load a signed app that violates the policy
Bug: 208968719
Change-Id: I2aaa218ab3a7297ea62448de49baa0bfd6b1ee52
2022-04-05 20:25:57 +00:00
Akilesh Kailash
9fc6ee050f libsnapshot: OTA upgrade when vendor partition is S
In Android S, snapuserd binary was on vendor partition.
When there is an OTA update from S -> T, it is possible
that vendor partitions are not updated. In that case,
successive OTA updates T1 -> T2 will continue to have
snapuserd from Android S as vendor partition wasn't updated
to T. All this means, we should disable user-space snapshots.

When installing OTA during runtime, check for property
ro.vendor.build.version.release_or_codename; if the property
is set to "12", then skip userspace-snapshots.

Bug: 227614163

Test: Simulate OTA test on Pixel 6 from T1 -> T2 by forcefully
setting the property to 12 and verify OTA is applied
successfully by falling back to dm-snapshot.

Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: I95f29145e5cd9ffb8d03d28ae414f0037b88be90
2022-04-05 20:23:14 +00:00
Suren Baghdasaryan
8330095807 Merge "init: try converting writepid used with cgroups into task_profiles command" 2022-04-05 16:37:55 +00:00
Shikha Panwar
757f299842 Make some debuggerd libraries available in apex com.android.virt
Test: Build passed & tested the whole topic
Bug:227443903

Change-Id: I113cd1e559307e191fec405206f23e1b4ce1a5fc
2022-04-05 15:55:16 +00:00