Commit graph

78471 commits

Author SHA1 Message Date
Sandro Montanari
59387c977b Merge "Add SeamendcHostTest to selinux.cpp TEST_MAPPING" 2022-08-25 14:47:28 +00:00
Sandro
956ce287f3 Add SeamendcHostTest to selinux.cpp TEST_MAPPING
SeamendcHostTest should run when making changes to selinux.cpp, to
ensure the test logic is updated to match the logic selinux.cpp follows
when it decides to compile the SELinux policy in the OpenSplitPolicy
method.

Bug: 238394904
Test: atest --test-mapping system/core/init/TEST_MAPPING:presubmit
Change-Id: Iaf0ec2356a894b071e6875dd41bcf9e842126e42
2022-08-25 09:26:24 +00:00
Treehugger Robot
7bc4533ae5 Merge "libprocessgroup: Provide SetProcessProfiles() and SetTaskProfiles() alternatives" 2022-08-24 19:29:04 +00:00
Deyao Ren
07595e198c Stop services when unload an apex
Bug: 238854102
Test: atest CtsInitTestCases ApexTestCases
Change-Id: I3b9df9424f7841c42bd1bde27cd0e0750615bd6c
2022-08-24 06:22:57 +00:00
Xin Li
f465d3fcee Merge "Merge android13-tests-dev" 2022-08-23 23:07:05 +00:00
Treehugger Robot
56183d87e4 Merge "libprocessgroup: Make GetProfile() and GetAttribute() more efficient" 2022-08-23 20:44:32 +00:00
Treehugger Robot
b963ff97fb Merge "trusty: Increase size of ACVP shared memory" 2022-08-23 17:19:46 +00:00
Stephen Crane
54020821f6 trusty: Increase size of ACVP shared memory
The boringssl ACVP config has grown, so we need to increase the size of
our memory allocation that we share with the Trusty test TA.

Test: acvptool -wrapper trusty_acvp_modulewrapper -regcap
Bug: None
Change-Id: Ia90f4972d0d2ac420b09110f5647355a44175267
2022-08-22 19:43:54 -07:00
Yi-yo Chiang
05ae1f5f10 Merge "adb-remount-test: Simplify disable-verity setup" 2022-08-22 06:06:49 +00:00
Marco Nelissen
7df90c1a38 Merge changes Ib2a3c881,Ia9b17f4e
* changes:
  trusty/apploader: Handle APPLOADER_ERR_NOT_ENCRYPTED
  trusty/apploader: Add missing doc for enum value
2022-08-21 23:22:38 +00:00
Yi-Yo Chiang
075463764e adb-remount-test: Simplify disable-verity setup
Don't try to parse stdout of disable-verity, just pass -R to ask for
auto reboot.
This eliminates the complex logic of "disable-verity && check &&
reboot && disable-verity again ...", and increase robustness.

`${overlayfs_supported} && ${overlayfs_needed}` can be simplified to
just `${overlayfs_needed}` because `${overlayfs_needed}` implies
`${overlayfs_supported}`.

Move the curious recurring "overlay takeover unexpected" check to the
"Checking current overlayfs status" section so we don't need to repeat
it so many times.

Bug: 243116800
Bug: 241688845
Test: adb-remount-test
Change-Id: I96ec44e2b9d172c06c3b4850e061e7b6bb46833c
2022-08-22 02:46:28 +08:00
Per Larsen
db9a554a2f trusty/apploader: Handle APPLOADER_ERR_NOT_ENCRYPTED
Add a specific error message to the Android CLI tool for the case
where the apploader rejected an attempt to load an application
which requested encryption of its ELF image via its manifest while
containing an unencrypted ELF image.

Bug: 241824652
Change-Id: Ib2a3c881015700492b8166be38c41753bf51b3b2
2022-08-20 23:20:46 -07:00
Per Larsen
c5253819f8 trusty/apploader: Add missing doc for enum value
Document the APPLOADER_ERR_POLICY_VIOLATION value in enum
apploader_error.

Bug: 208968719
Change-Id: Ia9b17f4ea705d13567b2ba74f2dcd6df5a0c7d73
2022-08-20 23:20:46 -07:00
Jiyong Park
f8053c661e Merge "Use liblog_for_runtime_apex instead of liblog" 2022-08-19 16:03:05 +00:00
Bart Van Assche
f32c4ecebb libprocessgroup: Provide SetProcessProfiles() and SetTaskProfiles() alternatives
Provide alternative versions that do not force callers to create
std::string objects. This patch has the intended side-effect that all
callers that pass a {string} initializer list to the 'profiles' argument
now call an std::initializer_list<> overload instead of the const
std::vector<std::string>& overload.

Additionally, add std::function<> arguments instead of calling
ExecuteForProcess() or ExecuteForTask() directly to make it easier to
write unit tests for SetTaskProfiles() and SetProcessProfiles().

Bug: 213617178
Change-Id: Ica61e944a66a17178ee43a113b8ca082f7eb834b
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-08-19 07:06:30 -07:00
Bart Van Assche
d0b8ce2115 libprocessgroup: Make GetProfile() and GetAttribute() more efficient
Do not force callers to create an std::string object. This patch
implements the following advice from go/totw/1: "Google’s preferred
option for accepting such string parameters is through a string_view."
Use std::less<> as comparison type to prevent that std::string_view
objects have to be converted into std::string objects for lookups in
std::map<>.

Bug: 213617178
Change-Id: I08125a02220a8c003d9202a7e177be776c3b9829
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-08-19 07:06:30 -07:00
Treehugger Robot
77cff05577 Merge "Prepare /data/property before load_persist_props" 2022-08-19 08:50:59 +00:00
kunal rai
803b5f4230 Added init_ueventHandler_fuzzer
Test: ./init_ueventHandler_fuzzer
Bug: 218631398

Change-Id: I264d0891f14cc5836e45d08578347737c94a168f
2022-08-19 11:48:30 +05:30
Akshata Kadam
2ae767105d Added init_property_fuzzer
Test: ./init_property_fuzzer
Bug: 218631398

Change-Id: I1af733e7f82bef2979fc308b0109094b0ebe1e28
2022-08-19 11:48:19 +05:30
Devendra Singhi
d29be4aaa0 Added init_parser_fuzzer
Test: ./init_parser_fuzzer
Bug: 218631398

Change-Id: Iae344c1e174fb5e07a0fb6813744fa1ae78eff6a
2022-08-19 11:48:07 +05:30
Chung-Kai (Michael) Mei
64e6511540 Merge "libmodprobe: check blockedlist if load failed" 2022-08-19 04:57:31 +00:00
Jiyong Park
eb769d687a Use liblog_for_runtime_apex instead of liblog
liblog_for_runtime_apex is a static variant of liblog which is
explicitly marked as available to the runtime APEX. Any static
dependency to liblog from inside the runtime APEX is changed from liblog
to liblog_for_runtime_apex.

Previously, to support the need for using liblog inside the runtime
APEX, the entire (i.e. both static and shared variants) liblog module
was marked as available to the runtime APEX, although in reality only
the static variant of the library was needed there. This was not only
looking dirty, but also has caused a problem like b/241259844.

To fix this, liblog is separated into two parts. (1) liblog and (2)
liblog_for_runtime_apex. (1) no longer is available to the runtime APEX
and is intended to be depended on in most cases: either from the
non-updatable platform, or from other APEXes. (2) is a static library
which is explicitly marked as available to the runtime APEX and also
visible to certain modules that are included in the runtime APEX.

Bug: 241259844
Test: m and check that liblog depends on stub library of libc
Change-Id: I10edd4487a6f090ef026acffe1ffbd067387a0d3
2022-08-19 13:21:02 +09:00
Bart Van Assche
0d78c9a0af Merge "libprocessgroup: Switch from gnu++-17 to gnu++-20" 2022-08-18 21:23:01 +00:00
David Anderson
5b9c9ba1e0 libsnapshot: Remove flaky image creation test.
This test has always been flaky, and is not testing something super
valuable: we know that image creation succeeds throughout the rest of
the suite, so it's not very interesting to know that it can succeed in a
low-space scenario.

The inverse test is much more valuable, since we want the correct status
code when creation fails due to low space.

Bug: 240391002
Test: vts_libsnapshot_test
Change-Id: I6235d11033d2f30efe530077b877863ba2574810
(cherry picked from commit 97e8a2f0e9)
2022-08-18 20:09:11 +00:00
Bart Van Assche
a823bee9d3 libprocessgroup: Switch from gnu++-17 to gnu++-20
This change enables headers like <span>. Inside the <span> header file
file the following guard makes its functionality unavailable when
building with std=gnu++-17:

 #if _LIBCPP_STD_VER > 17
 [ ... ]
 #endif

Bug: 213617178
Change-Id: I5c40708ea196ab112990b5ca6fae9370b75f8752
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-08-18 12:34:21 -07:00
Jooyung Han
9561496303 Prepare /data/property before load_persist_props
Without the directory (this happens on the very first boot),
load_persist_props can't create an initial version of
/data/property/persistent_properties (probably empty). This leads to
persisting all in-memory "persist.*" properties later when a persistent
property is set. This is regression from Android S because persistent
props from, for example, build.prop will be persisted even when there's
no process to explicitly setprop.

Bug: 242264580
Test: launch cuttlefish and verify that there's no props from build.prop
Change-Id: I5819a97750e4d5d1ee5a7c308bf944c7aeab2f90
2022-08-18 10:03:02 +09:00
Xin Li
d1d054910b Merge android13-tests-dev
Change-Id: I98a97dcfeb3bfbf711333b132b99108d8321536a
2022-08-17 16:33:25 -07:00
Yi-yo Chiang
b3ff0cf8c8 Merge "set-verity-state: Add -h -v -R (automatic reboot) options" 2022-08-17 06:14:55 +00:00
Yi-Yo Chiang
8667495164 set-verity-state: Add -h -v -R (automatic reboot) options
-h: print help
-v: noisy output
-R: automatic reboot if needed

Also remove the "argc != 0" check, as this shouldn't happen most of the
time anyway. The only possible way (I can think of) for this to happen
is to explicitly call execve() with an empty argv, which is against the
calling convention, thus a footgun, to begin with.

Bug: 241688845
Test: adb shell [disable-verity|enable-verity] [-R] [-v] [-h]
Test: adb shell set-verity-state [-R] [-v] [-h] [0|1]
Change-Id: I27fc18b0958650c5926322a3f4bd1df758fd96c8
2022-08-17 06:13:20 +00:00
Yi-yo Chiang
4284589b1c Merge "remount: Remove unused option -C/--clean_scratch_files" 2022-08-17 06:13:06 +00:00
Yi-Yo Chiang
0465273180 remount: Remove unused option -C/--clean_scratch_files
The option was added for debugging purposes in case the "test argv[0] ==
clean_scratch_files" method breaks.
Now it has no user at all and no reason to maintain it, so just remove it.

Also don't use MyLogger() when running as clean_scratch_files, as
clean_scratch_files don't have stdout/stderr.

Bug: 241179247
Test: Presubmit
Change-Id: I2d8069f59fe6b85fc84ab07bb2df6efb39d6ecaa
2022-08-17 06:12:52 +00:00
David Anderson
4f351c3cf5 Merge "libsnapshot: Remove flaky image creation test." 2022-08-16 22:33:21 +00:00
Akilesh Kailash
1fe0e72321 Merge "libsnapshot: reorder COW ops vector" 2022-08-16 19:17:44 +00:00
Xin Li
4f74d4542d Merge "DO NOT MERGE - Merge Android 13" 2022-08-16 19:08:18 +00:00
Treehugger Robot
5efd05c963 Merge "Add io_uring support to fastboot" 2022-08-16 17:52:01 +00:00
Akilesh Kailash
6c462c31f6 libsnapshot: reorder COW ops vector
Reorder COW ops vector based on merge sequence. We don't
need additional vector to be stored in memory.

Memory usage for a full OTA on Pixel:

Without Patch:
RssAnon:       61020 kB

With Patch:
RssAnon:	   51112 kB

Bug: 237490659
Test: OTA on Pixel
Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: I543dd73acfa7cf4e57379e82bc184e943072e7c8
2022-08-16 17:37:10 +00:00
Trevor Radcliffe
d0a522c9f6 Merge "Point directly to generated c sysprop_library" 2022-08-16 15:09:41 +00:00
Xin Li
5386f6a48e DO NOT MERGE - Merge Android 13
Bug: 242648940
Merged-In: Ibcaa8406e8b1e8758b99a8e9b58c58d68ed57685
Change-Id: I2a0c0961fafa9a6f3beb21bfb10ea1ad5082b874
2022-08-15 22:06:32 -07:00
Treehugger Robot
904e71d2dd Merge "libsnapshot: Use SnapshotManager to delete devices." am: 3de2320e5e
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2185322

Change-Id: Ia1e64f5e50652efedc9649d5bd7df3d5ba033531
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-13 10:58:13 +00:00
Treehugger Robot
3de2320e5e Merge "libsnapshot: Use SnapshotManager to delete devices." 2022-08-13 10:39:22 +00:00
David Anderson
97e8a2f0e9 libsnapshot: Remove flaky image creation test.
This test has always been flaky, and is not testing something super
valuable: we know that image creation succeeds throughout the rest of
the suite, so it's not very interesting to know that it can succeed in a
low-space scenario.

The inverse test is much more valuable, since we want the correct status
code when creation fails due to low space.

Bug: 240391002
Test: vts_libsnapshot_test
Change-Id: I6235d11033d2f30efe530077b877863ba2574810
2022-08-12 23:46:31 -07:00
David Anderson
e02ef9e9ce libsnapshot: Use SnapshotManager to delete devices.
Diagnosing DM_DEV_REMOVE failures in the test harness is quite
difficult, and it's not clear if failures are spurious or not. Instead
use SnapshotManager's helper function, which can retry on failure, and
will self-diagnose issues on legitimate failures.

Bug: N/A
Test: vts_libsnapshot_test
Change-Id: Ibcaa8406e8b1e8758b99a8e9b58c58d68ed57685
2022-08-12 23:46:31 -07:00
Trevor Radcliffe
fcfd725a5c Point directly to generated c sysprop_library
Bug: 226199990
Test: m
Change-Id: I0ea65714f9a27093b37034abde7d59f1951a5cb6
2022-08-12 18:23:40 +00:00
Yi-yo Chiang
ecb064f763 Merge "remount: Remove dev_t checks from tests." am: c38725ce9c
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2184639

Change-Id: I2b76ef63a3f72029cbea9f4541c2019c1e1bb022
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-12 06:30:53 +00:00
Yi-yo Chiang
c38725ce9c Merge "remount: Remove dev_t checks from tests." 2022-08-12 06:11:30 +00:00
David Anderson
e4e51662d9 remount: Remove dev_t checks from tests.
These checks have historically been unreliable, and we make no
guarantees around dev_t with overlayfs.

Bug: 242240650
Test: adb-remount-test.sh
Change-Id: I19e7aabec424a22beb0b56d35b198906841178b0
2022-08-11 21:36:43 -07:00
Kelvin Zhang
682e5b530a Add io_uring support to fastboot
Test: th
Bug: 31712568

Change-Id: If18bd4eb53ffe851c31d7dc61906921da111114f
2022-08-11 18:58:43 -07:00
Thiébaud Weksteen
4f0ad3a9d1 Merge "Remove e2fsdroid and sload_f2fs dep from fastboot" am: 8a6fa3127b
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2182995

Change-Id: I16237d9001c5aacd68112d3d4d4b2ddd49afbaf0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-11 23:41:44 +00:00
Thiébaud Weksteen
8a6fa3127b Merge "Remove e2fsdroid and sload_f2fs dep from fastboot" 2022-08-11 23:22:43 +00:00
Treehugger Robot
792984a5b5 Merge "remount: On initial overlay setup, return 0 instead of MUST_REBOOT" am: 60dd4690b3
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2183077

Change-Id: I6b85b22d141d156a668a230068a25c4460d1d47d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-11 18:11:29 +00:00