Commit graph

75203 commits

Author SHA1 Message Date
Treehugger Robot
9f856bf6aa Merge "Add etc to hwasan-postsubmit" 2022-03-22 00:26:02 +00:00
Ray Essick
926f753e20 Symbolic constants for older minijails
Inline definitions of a few constants that don't appear on Q/R devices,
so that this works for us in mainline modules that are loaded on those
older devices.

Bug: 225406881
Test: boot on Q, watch logcat
Test: boot on R, watch logcat
Change-Id: Ic5781976d4c1e2d16e230c015fc49d9fde74e289
2022-03-21 16:31:00 -07:00
Daniel Norman
f1200fb117 Adds an init host lib for use in host_apex_verifier.
Includes extracting the APEX-specific SDK version naming scheme filter
logic so it can be reused when host_apex_verifier looks at rc files
inside the APEX.

Bug: 222121216
Test: Use in host_apex_verifier
Change-Id: I0396a455f30d2de71525ccd3fa69c75576054048
2022-03-21 15:45:44 -07:00
Eric Biggers
881ca51a84 init.rc: remove commented-out code that set vold.post_fs_data_done
The "vold.post_fs_data_done" system property was only used by FDE, which
is no longer supported, and this code was commented out anyway.

Bug: 208476087
Change-Id: Ib9346d14368c77058a598e5c4f5f2ed72f5a5316
2022-03-21 22:15:53 +00:00
Treehugger Robot
8461ca5945 Merge "Added trackName as additional argument to WRITE_MSG to handle trace messages with a track name" 2022-03-21 19:45:30 +00:00
Konstantin Vyshetsky
b3e1829421 fastbootd: pass handle in place of fd
There are cases such as non 4KB aligned buffers which break writes on
file descriptors opened with O_DIRECT. Flashing functions need more
control over the file descriptor, which is not achievable easily by
having only a file descriptor passed. This CL modifies the logic to pass
the PartitionHandle in place of the file descriptor during flashing.

Bug: 225108941
Signed-off-by: Konstantin Vyshetsky <vkon@google.com>
Change-Id: I049d0ffb183c9de1267b7e442488c8ba5002186a
2022-03-21 11:35:42 -07:00
Treehugger Robot
4767dccadf Merge "Copy snapuserd to first_stage_ramdisk" 2022-03-21 15:47:25 +00:00
Kelvin Zhang
22929da287 Copy snapuserd to first_stage_ramdisk
Certain binaries, such as snapuserd, are only available under
/system/bin. To make them accessible by first stage init, we copy
/system/bin/snapuserd to /first_stage_ramdisk/system/bin/snapuserd .

Test: th
Bug: 219841787
Change-Id: I913425a82905c745a05ac32d488f08506dc264ff
2022-03-19 00:56:25 -07:00
Treehugger Robot
04288337c3 Merge "Rename FstabEntry::metadata_encryption to metadata_encryption_options" 2022-03-19 04:12:05 +00:00
Treehugger Robot
ee0584b2db Merge "Add property_service to hwasan-postsubmit" 2022-03-19 01:14:37 +00:00
Florian Mayer
e866ce421d Merge "Add libcutils to hwasan-postsubmit" 2022-03-19 00:25:31 +00:00
Florian Mayer
bf6f7fafb6 Merge "Add libpackagelistparser to hwasan-postsubmit" 2022-03-19 00:21:49 +00:00
Florian Mayer
3a99e7d2c4 Merge "Add socket_lazy to hwasan-postsubmit" 2022-03-19 00:15:53 +00:00
Treehugger Robot
5d2c849c73 Merge "libsnapshot: Fix vts_libsnapshot_test" 2022-03-19 00:14:27 +00:00
Florian Mayer
4a40c57e74 Merge "Add pull_lazy to hwasan-postsubmit" 2022-03-18 23:31:53 +00:00
Florian Mayer
1aa501ba3b Merge "Add liblp to hwasan-postsubmit" 2022-03-18 23:10:24 +00:00
Florian Mayer
303e218dbe Merge "Add healthd to hwasan-postsubmit" 2022-03-18 23:09:56 +00:00
Florian Mayer
14deb086bf Add keymint to hwasan-postsubmit
Test: Run tests under HWASan.
Bug: 193568145
Change-Id: Ica324e3eb495bc3c95ae9f892c744a3204d2d072
2022-03-18 23:01:32 +00:00
Florian Mayer
c6a8821fa7 Add libmodprobe to hwasan-postsubmit
Test: Run tests under HWASan.
Bug: 193568145
Change-Id: I6a259705923d619292b0ae16e4b18a9647032f4e
2022-03-18 21:48:29 +00:00
Florian Mayer
d25baf462d Add property_service to hwasan-postsubmit
Test: Run tests under HWASan.
Bug: 193568145
Change-Id: I0d7ac4acc8d5171d40bdd4dc4e03fc32f4348edb
2022-03-18 21:47:10 +00:00
Florian Mayer
582c282731 Add libpackagelistparser to hwasan-postsubmit
Test: Run tests under HWASan.
Bug: 193568145
Change-Id: I20deb6453704726b03937f2242e45b5dedcf9cf1
2022-03-18 21:41:03 +00:00
Florian Mayer
daedc740c9 Add etc to hwasan-postsubmit
Test: Run tests under HWASan.
Bug: 193568145
Change-Id: I0edc35a73fe6760ffe52127d246fde4fe3980bbc
2022-03-18 21:38:47 +00:00
Florian Mayer
bb015aacd0 Add libcutils to hwasan-postsubmit
Test: Run tests under HWASan.
Bug: 193568145
Change-Id: I16013b864b3cc7850f46db0163efc59a69485b8d
2022-03-18 21:38:21 +00:00
Florian Mayer
f7be3cc3ac Add socket_lazy to hwasan-postsubmit
Test: Run tests under HWASan.
Bug: 193568145
Change-Id: I395ebdecd5c98d1b669fc34270d5081a12076fef
2022-03-18 21:31:30 +00:00
Florian Mayer
84f39e5728 Add pull_lazy to hwasan-postsubmit
Test: Run tests under HWASan.
Bug: 193568145
Change-Id: I3f9ebeebcfd1b69651731130ab22638dd1f218cf
2022-03-18 21:31:09 +00:00
Florian Mayer
92c1ef9e97 Add liblp to hwasan-postsubmit
Test: Run tests under HWASan.
Bug: 193568145
Change-Id: I6514e9f170d03ee2d2673d115a9c8337ac6941b0
2022-03-18 21:23:51 +00:00
Florian Mayer
6e2276b28a Add healthd to hwasan-postsubmit
Test: Run tests under HWASan.
Bug: 193568145
Change-Id: I710628acb0fffcbf670e4e30059f3cfa284f9540
2022-03-18 21:19:00 +00:00
Akilesh Kailash
44343d4416 libsnapshot: Fix vts_libsnapshot_test
Fix SnapshotUpdateTest.QueryStatusError which
was failing on targets where userspace-snapshots are not
yet enabled.

Bug: 224586316
Test: vts_libsnapshot_test -force_config dmsnap --gtest_filter=SnapshotUpdateTest.QueryStatusError
Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: Ibaacff9b03eafe0bfa537d0f9cab98b7caceb37e
2022-03-18 20:11:17 +00:00
Treehugger Robot
81cc9d986f Merge "Add core to hwasan-postsubmit" 2022-03-18 19:24:07 +00:00
Tri Vo
5ba7cba78f Merge "trusty: set_attestation_key: Provision device IDs" 2022-03-18 18:14:18 +00:00
Chungkai
c60300a2cc Load kernel modules in parallel
First, we load independent module in parallel, then we singly load
modules which have soft-dependencies. then remove them from dependency
list of other modules. Repeat these steps until all modules are loaded.

Bug: 180676019
Test: boot successfully, and save more than 400 ms on Pixel 6 Pro.
Signed-off-by: chungkai <chungkai@google.com>
Change-Id: Ib844cfee72d4049bd951528692c818b4fa6c8e8f
2022-03-18 08:06:07 +00:00
David Anderson
15433b93ff vts_libsnapshot_test: Fix free space calculation.
This should be using unreserved free space, not total free space.

Bug: 223701928
Test: vts_libsnapshot_test
Change-Id: Ic0a657fe094b57734c93958d7e5da56fbfbada7f
2022-03-17 20:39:47 -07:00
Tri Vo
7aeb43ecfc trusty: set_attestation_key: Provision device IDs
Bug: 221128605
Test: /vendor/bin/trusty_keymaster_set_attestation_key /vendor/etc/keymaster_soft_attestation_keys.xml
Change-Id: Iabe2162a7d50f16c966f16ca2eda5a7651779848
2022-03-17 17:49:35 -07:00
Eric Biggers
20a5f92a33 Rename FstabEntry::metadata_encryption to metadata_encryption_options
There have been two bugs where people use !metadata_encryption.empty()
to check whether metadata encryption is enabled.  It should actually be
!metadata_key_dir.empty(), since 'metadata_encryption' is the encryption
options, which can be empty if the defaults are sufficient.

Rename the field in FstabEntry appropriately.

To avoid breaking fstab files, don't rename the flag in the fstab file
itself.  So, now the fstab flags map to FstabEntry fields as follows:

    keydirectory => metadata_key_dir
    metadata_encryption => metadata_encryption_options

Change-Id: I5bf673047c99e077bd6e1ac006d80e7e16bc814b
2022-03-17 23:22:50 +00:00
Ray Ye
9a54240aba Added trackName as additional argument to WRITE_MSG to handle trace
messages with a track name

Bug: 220499650
Test: atest TraceDevTest
Change-Id: I3f6be6b693fb6f906b90655d5d553e853c4d4411
2022-03-17 21:40:15 +00:00
Bart Van Assche
bc077ff110 Add support for memcg v2 attributes
Some but not all memcg v1 attributes exist in the v2 hierarchy. The
following information comes from Shakeel Butt and Kamil Yurtsever,
"cgroup v2 migration at Google", Linux Plumbers Conference 2018
( https://lpc.events/event/2/contributions/204/attachments/143/378/LPC2018-cgroup-v2.pdf ):

         v1                    v2
-------------------------- ----------
memory.limit_in_bytes      memory.max
memory.soft_limit_in_bytes memory.low

Add support for cgroup attributes that have different names in the v1
and v2 hierarchies. Also add those memcg attributes that are used in
lmkd.

Bug: 213617178
Test: Tested lmkd with v1 and v2 memcg.
Change-Id: Ia5c5f02974f3b783d5cdaad85b33169ced8db55f
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-03-17 14:18:14 -07:00
Bart Van Assche
c9b78e9528 Merge "Add support for optional cgroup attributes" 2022-03-17 21:17:44 +00:00
Florian Mayer
6c27e866f7 Add core to hwasan-postsubmit
Test: Run tests under HWASan.
Bug: 193568145
Change-Id: I4328299776e7e658d0f02f7b71b150c1f4815d3e
2022-03-17 14:02:43 -07:00
Treehugger Robot
addba34668 Merge "Fix TEMP_FAILURE_RETRY on non-GNU C++ dialects" 2022-03-17 04:05:17 +00:00
David Anderson
fe62ca7165 Merge "init: Add more diagnostics for signalfd hangs." 2022-03-16 23:11:12 +00:00
Treehugger Robot
4c7dc7bd1d Merge changes from topic "sys_rootdisk"
* changes:
  Init: add dev.mnt.blk.bootdevice to access device sysfs
  init: mount_handler: detect main block device more reliably
  init.rc: use /sys/class/block instead of /sys/devices/virtual/block
2022-03-16 22:44:01 +00:00
Treehugger Robot
f8cd69af8b Merge changes Iee0932b5,I0d77c490
* changes:
  Fix Errors.h on systems that define NO_ERROR
  Disable call stacks on every OS except Linux/Android
2022-03-16 22:25:16 +00:00
Andrei Homescu
fcbc96191c Fix TEMP_FAILURE_RETRY on non-GNU C++ dialects
TEMP_FAILURE_RETRY uses typeof which is only allowed by gcc and clang
for GNU dialects. This switches to __typeof__ which is always supported.

Bug: 224644083
Test: m
Change-Id: I96d48d2f0dc5cd9ab903755d93c71c4eb80f7529
2022-03-16 20:54:31 +00:00
Bart Van Assche
59af680023 Add support for optional cgroup attributes
Cgroup attributes like io.weight or io.bfq.weight only exist if the
corresponding I/O scheduler has been loaded. Hence add support for
ignoring failures to write to a cgroup attribute that does not exist.

Bug: 213617178
Test: This patch has been tested in combination with patch "Migrate the blkio controller to the cgroup v2 hierarchy".
Change-Id: I5debafabc4dd430a1b98ea343bf3740c764edcc3
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-03-16 19:55:46 +00:00
Treehugger Robot
4e0a7f22fa Merge changes Ib5012456,Idbfb49c2,Ieb953c18
* changes:
  Use uid_t for user IDs and gid_t for group IDs
  Fix cgroup directory permissions
  Simplify cgroups.json
2022-03-16 19:53:41 +00:00
David Anderson
14f9c15e05 init: Add more diagnostics for signalfd hangs.
This adds two new diagnostics. First, signalfd reads are now non-blocking. If the read takes more than 10 seconds, we log an error.

Second, init now wakes up from epoll() every 10 seconds. If it waits on an "exec" command for more than 10 seconds, it logs an error.

This change will be reverted as soon as we get feedback.

Bug: 223076262
Test: device boots
Change-Id: I7ee98d159599217a641b3de2564a92c2435f57ef
2022-03-16 05:06:17 +00:00
Andrei Homescu
aa4ebf2ce1 Fix Errors.h on systems that define NO_ERROR
Some systems (originally only Windows) define their own
NO_ERROR macro that overlaps with the enumerator from Errors.h.
The enumerator is only defined if the macro was not.

Bug: 224644083
Test: m
Change-Id: Iee0932b5259b3bfcf6494656b27e6e7488319f5c
2022-03-16 02:15:04 +00:00
Andrei Homescu
5c15de21da Disable call stacks on every OS except Linux/Android
To keep libutils (and consequently libbinder) as compact
and portable as possible, this disables call stacks on all
operating systems except Linux and Android.

Bug: 224644083
Test: m
Change-Id: I0d77c49022e852c2b8607f555174c4f9d54ed3df
2022-03-16 01:35:19 +00:00
Bart Van Assche
32a9b1c320 Use uid_t for user IDs and gid_t for group IDs
This patch makes the intent of the code more clear without changing any
functionality since uid_t and gid_t are both aliases for uint32_t on
Android systems. See also
https://cs.android.com/android/platform/superproject/+/master:bionic/libc/include/sys/types.h

Bug: 213617178
Test: Compile-tested only.
Change-Id: Ib5012456a7357e79368f00e71e9a280fd6f96063
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-03-15 23:02:20 +00:00
Bart Van Assche
990194fe2f Fix cgroup directory permissions
Cgroup attributes are set from three different contexts:
(1) From the process that creates the cgroup directories. These
    processes are /system/bin/init, zygote and zygote64.
(2) From the created process. Some but not all created processes have
    user ID and/or group ID 'system'.
(3) The system_server process modifies certain cgroup attributes from
    other processes.

Allow all processes from the system group, including system_server, to
modify cgroup attributes from other processes. As one can see in
init.rc, that file includes commands for granting the system group
write permission for blkcg attributes. See also
https://cs.android.com/android/platform/superproject/+/master:system/core/rootdir/init.rc

Bug: 213617178
Test: Verified in the Cuttlefish emulator that this patch makes the
Test: io.bfq.weight write errors disappear from logcat.
Change-Id: Idbfb49c25afec12b21daea7a17db5322bc981ff0
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-03-15 23:02:20 +00:00