Commit graph

80988 commits

Author SHA1 Message Date
Pawan Wagh
f044f7f3dd Adding fuzzers for StoragedService and StoragedPrivateService
- StoragedService and StoragedPrivateService are defined in global
namespace. Moving them to android namespace
- Adding AIDL service fuzzers for both services

Bug: 232439428
Test: adb shell /data/nativetest64/storaged-unit-tests/storaged-unit-tests
Test: m storaged_service_fuzzer && adb sync data && adb shell /data/fuzz/x86_64/storaged_service_fuzzer/storaged_service_fuzzer
Test: m storaged_private_service_fuzzer && adb sync data && adb shell /data/fuzz/x86_64/storaged_private_service_fuzzer/storaged_private_service_fuzzer
Change-Id: Ieb6ff8117f548dd1ef376aab8e6d3dfec9fb06d3
2023-04-24 23:16:32 +00:00
Steven Moreland
5ca6c9888e Merge "init: log when 'user' is unspecified" 2023-04-24 17:28:09 +00:00
Daniel Zheng
cf1ca03836 Merge "Added test for parsing bad input" 2023-04-20 23:08:20 +00:00
Daniel Zheng
935ee1f971 Added test for parsing bad input
Test: fastboot_test
Change-Id: I04fc24741987bc88a490b2084189dfd8f3714582
2023-04-20 14:11:06 -07:00
Daniel Zheng
13af2f46a8 Merge "Added test for version check" 2023-04-20 17:47:46 +00:00
Treehugger Robot
229d3d27d8 Merge "task_profiles_test: Skip this test if cgroups is read-only" 2023-04-19 23:57:15 +00:00
Daniel Zheng
0e25838886 Merge "Adding Test for Parsing Flash Task" 2023-04-19 21:13:42 +00:00
Daniel Zheng
233a5a162d Merge "Added forward declaration for compilation" 2023-04-19 21:13:35 +00:00
Daniel Zheng
7d67d569f3 Merge "Pointed FlashingPlan to Interface" 2023-04-19 21:13:25 +00:00
Daniel Zheng
3ac1e55e1e Merge "Adding fastboot_driver interface + mock" 2023-04-19 21:12:59 +00:00
Daniel Zheng
39b1de953f Merge "Moving FlashallTool Definition" 2023-04-19 21:12:37 +00:00
Daniel Zheng
b7d14facd2 Merge "Changing flashall to parse fastboot-info.txt" 2023-04-19 21:12:29 +00:00
Bart Van Assche
8a20643f7f task_profiles_test: Skip this test if cgroups is read-only
GKE provides an unusual environment: the cgroupv2 filesystem is mounted
read-only. Skip the task_profiles_test on the host if the cgroup2
filesystem is mounted read-only to prevent that a test fails as
follows:

Failed to write '-1' to /sys/fs/cgroup/cgroup.procs: Read-only file system.

Bug: 278899193
Change-Id: I8c5a0c0848a47a395ae87f2fc31ba0ccda7d7f31
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-04-19 13:53:47 -07:00
Daniel Zheng
68b84df994 Added test for version check
Test: fastboot_test
Bug: 194686221
Change-Id: I886c0a91be3b4f4bf7f2b8c76704aa30a352ee5b
2023-04-19 12:30:38 -07:00
Daniel Zheng
76aa257850 Adding Test for Parsing Flash Task
Test: fastboot_test
Bug: 194686221
Change-Id: Ie15b2d0423366fb9d1debb9be52de3b6d3a891af
2023-04-19 12:30:38 -07:00
Daniel Zheng
efca333730 Added forward declaration for compilation
Test: tested compilation
Change-Id: I7165e323574ef8f3f90d1540c4a2b6a991803b40
2023-04-19 12:30:38 -07:00
Daniel Zheng
bf09c61d95 Pointed FlashingPlan to Interface
Using interface for testing purposes

Bug: 194686221
Test: tested compilation
Change-Id: Ia9465c1f5673c249cdbc08a1a2432e8a603bd9cc
2023-04-19 12:30:38 -07:00
Daniel Zheng
c9e869bd9e Adding fastboot_driver interface + mock
Adding mock fastboot_driver to be used for testing

Test: tested fastboot_test
Bug: 194686221
Change-Id: I6948310d44b75c0f389cbfd194747649aaccb0b8
2023-04-19 12:30:38 -07:00
Daniel Zheng
65eb246aa2 Moving FlashallTool Definition
moved flashalltool definition to header file

Test: flashall on raven
Bug: 194686221
Change-Id: I5f726492ee5b3ae42755214e3de0269257b62ba8
2023-04-19 12:30:38 -07:00
Daniel Zheng
29a211c194 Changing flashall to parse fastboot-info.txt
Test: tested on Raven
Change-Id: I9f26bf6025a0a6318f84be929091f4e82bd87556
2023-04-19 12:30:37 -07:00
Daniel Zheng
37673f0bf5 Merge "Fixing circular dependency" 2023-04-19 00:16:13 +00:00
Maciej Żenczykowski
02a6d74b65 Merge "fix clatd permissions try 3 - this time for GSI" 2023-04-18 23:21:28 +00:00
Maciej Żenczykowski
93c9dfcd33 fix clatd permissions try 3 - this time for GSI
where stuff is apparently under /system_ext/apex/...
instead of /system/apex/...

Bug: 277646103
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I947e44af334628d82ca633546f3328319c2bac60
2023-04-18 21:09:14 +00:00
Daniel Zheng
729c159744 Merge "Moving logging include" 2023-04-18 16:26:01 +00:00
Steven Moreland
f5d22ef7cd init: log when 'user' is unspecified
NOTE: in master, but should be submitted in AOSP.
Waiting to hear from security folks. Also might
need cleanup.

Not currently done. Seems errorprone.

Bug: 276813155
Test: boot, check logs
Change-Id: I7cbc39b282889dd582f06a8eedc38ae637c8edec
2023-04-17 20:18:00 +00:00
Daniel Zheng
0897526557 Fixing circular dependency
Test: tested compilation
Change-Id: Iae25cade1efb2372e5fc219fa69cbb2381b4e05c
2023-04-17 11:34:00 -07:00
Daniel Zheng
7627b54910 Moving logging include
Header file shouldn't have include of logging

Test: tested compilation
Change-Id: I02cccb66b6ee5811e5d4f2b9b72508fee640e828
2023-04-17 09:42:39 -07:00
Florian Mayer
bbcad5b6dd Merge "Expose hwasan runtime to Java apps" 2023-04-14 23:27:56 +00:00
David Anderson
657960396c Merge "snapuserd: Remove legacy xor code." 2023-04-14 23:03:39 +00:00
David Anderson
2812fd841e Merge "libsnapshot: Remove various unused components." 2023-04-14 22:42:42 +00:00
Steven Moreland
f0578771ea Merge "Explicit init .rc user." 2023-04-14 21:43:38 +00:00
Steven Moreland
2fccf5ead3 Explicit init .rc user.
Set the user explicitly.

For boringssl self-test, changed to 'nobody' since
this test doesn't require permissions.

Bug: 276813155
Test: boot, check can 'nobody' can still write to kmesg.
Change-Id: I32f7134e83183bd054bffbb22d412d7a2dc0ad09
2023-04-14 21:43:25 +00:00
David Anderson
3933cbeba0 libsnapshot: Remove various unused components.
PowerTest is no longer relevant with snapuserd, and was not particularly
good at rooting out dm issues anyway.

make_cow_from_ab_ota and estimate_cow_from_nonab_ota are no longer
relevant as they were mainly for estimation during VABC prototyping.

The update_metadata proto was part of the fuzzer which has since been
removed.

Bug: N/A
Test: th builds
Change-Id: Ie341e360f1824ea16794c4625817cfc8f8b8644b
2023-04-14 13:39:14 -07:00
Colin Cross
d5fc9eae52 Merge "Use android::base::Basename instead of basename" 2023-04-14 17:26:30 +00:00
David Anderson
c2f3d686e9 Merge "libsnapshot: Don't run legacy tests in VTS." 2023-04-14 15:31:31 +00:00
Colin Cross
d459ccd14e Use android::base::Basename instead of basename
basename can have different behavior based on whether the glibc
or posix version is used, and musl doens't provide the glibc version
at all.  Avoid the problem by using the one in libbase instead.

Test: m USE_HOST_MUSL=true host-native -k
Change-Id: If17c7622ed9b9cffc218567a46afb059b608d3c9
2023-04-13 21:59:58 -07:00
David Anderson
ff92fdb6d3 libsnapshot: Don't run legacy tests in VTS.
Bug: 276035159
Test: builds
Change-Id: I19bca32f636da867445c8b668d3a38ccba5c50f4
2023-04-13 16:39:02 -07:00
Treehugger Robot
04a44c1c5d Merge "libprocessgroup: Add sendSignalToProcessGroup" 2023-04-13 23:11:01 +00:00
Treehugger Robot
b083eb3611 Merge "Revert "Revert "libprocessgroup: Add support for SetUserProfiles""" 2023-04-13 23:00:21 +00:00
T.J. Mercier
5ed5e1bb9f Revert "Revert "libprocessgroup: Add support for SetUserProfiles""
This reverts commit aee11b0a3d.

This change was originally reverted because its only user was reverted
under b/243096961 at ag/19679188. We bring it back now with a fixed user.

Bug: 236708592
Bug: 148425913
Ignore-AOSP-First: Topic with AMS changes which is developed on git_master

Change-Id: I2a8ae0d9faabe7950b758a09870d128889be4d0a
Merged-In: I2a8ae0d9faabe7950b758a09870d128889be4d0a
2023-04-13 22:05:31 +00:00
T.J. Mercier
22006bf004 libprocessgroup: Add sendSignalToProcessGroup
Add a function which sends signals to all members of a process group,
but does not wait for the processes to exit, or for the associated
cgroup to be removed.

Bug: 274646058
Ignore-AOSP-First: Dependency of ActivityManager change which developed on interal git_master
Test: Force-stop of chrome with 15 tabs completes ~500ms faster
Test: Full Play store update causes no ANR
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:d87b6018d25cbbd33b345dc58c634718bf5d0def)
Merged-In: I37dbdecb3394101abbee8495e71f6912b3c031f5
Change-Id: I37dbdecb3394101abbee8495e71f6912b3c031f5

NOTE FOR REVIEWERS - original patch and result patch are not identical.
PLEASE REVIEW CAREFULLY.
Diffs between the patches:
37,6 +537,15 @@
     return KillProcessGroup(uid, initialPid, signal, 0 /*retries*/, max_processes);
 }
 
+int sendSignalToProcessGroup(uid_t uid, int initialPid, int signal) {
+    std::string hierarchy_root_path;
+    if (CgroupsAvailable()) {
+        CgroupGetControllerPath(CGROUPV2_CONTROLLER_NAME, &hierarchy_root_path);
+    }
+    const char* cgroup = hierarchy_root_path.c_str();
+    return DoKillProcessGroupOnce(cgroup, uid, initialPid, signal);
+}
+
 static int createProcessGroupInternal(uid_t uid, int initialPid, std::string cgroup,
                                       bool activate_controllers) {
     auto uid_path = ConvertUidToPath(cgroup.c_str(), uid);

Original patch:
From d87b6018d2 Mon Sep 17 00:00:00 2001
From: T.J. Mercier <tjmercier@google.com>
Date: Tue, 04 Apr 2023 18:41:13 +0000
Subject: [PATCH] libprocessgroup: Add sendSignalToProcessGroup

Add a function which sends signals to all members of a process group,
but does not wait for the processes to exit, or for the associated
cgroup to be removed.

Bug: 274646058
Ignore-AOSP-First: Dependency of ActivityManager change which developed on interal git_master
Test: Force-stop of chrome with 15 tabs completes ~500ms faster
Test: Full Play store update causes no ANR
Change-Id: I37dbdecb3394101abbee8495e71f6912b3c031f5
---

diff --git a/libprocessgroup/include/processgroup/processgroup.h b/libprocessgroup/include/processgroup/processgroup.h
index 8fa9fd5..48bc0b7 100644
--- a/libprocessgroup/include/processgroup/processgroup.h
+++ b/libprocessgroup/include/processgroup/processgroup.h
@@ -76,6 +76,11 @@
 // that it only returns 0 in the case that the cgroup exists and it contains no processes.
 int killProcessGroupOnce(uid_t uid, int initialPid, int signal, int* max_processes = nullptr);
 
+// Sends the provided signal to all members of a process group, but does not wait for processes to
+// exit, or for the cgroup to be removed. Callers should also ensure that killProcessGroup is called
+// later to ensure the cgroup is fully removed, otherwise system resources may leak.
+int sendSignalToProcessGroup(uid_t uid, int initialPid, int signal);
+
 int createProcessGroup(uid_t uid, int initialPid, bool memControl = false);
 
 // Set various properties of a process group. For these functions to work, the process group must

Change-Id: Ie479348dee8e8092b1959927a1143009632d3914
2023-04-13 21:48:55 +00:00
Daniel Zheng
0a785083bb Merge "Cleaning up main code" 2023-04-13 20:44:31 +00:00
Yifan Hong
203d8316c6 Merge "remove healthd.rc" 2023-04-13 19:37:54 +00:00
David Anderson
07f6f239ee Merge "RESTRICT AUTOMERGE: snapuserd: Run snapuserd threads in-process." 2023-04-13 17:55:40 +00:00
David Anderson
daae43c95a Merge "snapuserd_daemon: Modify incorrect print information" 2023-04-13 16:49:41 +00:00
mingzhu.wang
44d88ca703 snapuserd_daemon: Modify incorrect print information
StartServerForUserspaceSnapshots function, if the child resulting from
the separation parameter number is not equal to 4, will be print
Malformed message: expected four sub-arguments, but at present there is
print three

Change-Id: Idc240714a65bc3eeb1e2b9958354de98ca4b329e
2023-04-13 17:55:47 +08:00
David Anderson
82c43e8b92 Merge "dmctl: add repalce command to usage list" 2023-04-13 03:15:23 +00:00
Steven Moreland
165e086a1a remove healthd.rc
no longer used

Bug: 276813155
Test: N/A
Change-Id: Iae206540b07b61fa799ce6fcce4032879f02d8b3
2023-04-12 23:00:09 +00:00
Treehugger Robot
253f33aac5 Merge "libprocessgroup: fix task_profile_test to correctly detect cgroup v2" 2023-04-12 22:20:20 +00:00
Suren Baghdasaryan
d09713fe40 libprocessgroup: fix task_profile_test to correctly detect cgroup v2
Use correct attribute of the mntent to check for cgroup v2 entry.

Bug: 277233783
Change-Id: Ie34b89b610117b8ce043f2f18947273d75618fef
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2023-04-12 21:07:50 +00:00