Commit graph

3153 commits

Author SHA1 Message Date
Jooyung Han
3249f9ff35 Merge "Use /bootstrap-apex for bootstrap APEXes" into main am: 58ba0b44c2 am: 6b0c2c3cc6
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2666915

Change-Id: I6f1fcda6db9affd51e5067a685e2b488665f5b30
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-31 23:09:38 +00:00
Jooyung Han
201801ce8e Use /bootstrap-apex for bootstrap APEXes
This new directory is bind-mounted to /apex in the bootstrap mount
namespace so that apexd-bootstrap mounts bootstrap APEXes there via
/apex.

The directory is detached from /apex in the default mount namespace but
still visible in case bootstrap APEXes are needed.

However, there are (mostly, virtual) devices which don't need two mount
namespaces. Those devices don't need to make /bootstrap-apex directory
at all.

Bug: 290148078
Test: atest VendorApexHostTestCases
Test: atest MicrodroidTests
Change-Id: I541cec71d9970b14971d46e01e4808b23590dbed
2023-07-31 18:16:46 +09:00
Lee George Thomas
0839350cb3 Merge "Create /data/misc/bootanim folder in init.rc." into main am: 9d398af95c am: 9837a1e03f
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2676056

Change-Id: I70e9dc2c3fb0b1c0528f1be421bf8d0c806915b9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-27 20:00:55 +00:00
Eric Biggers
f68b038ec5 Merge "Revert "init.rc: stop calling 'fsverity_init --load-verified-keys'"" into main am: 428622bb7f am: 82161b0c05
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2676760

Change-Id: Ib9f977750fa6a478f241600857888d661d844c49
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-26 19:54:15 +00:00
Eric Biggers
428622bb7f Merge "Revert "init.rc: stop calling 'fsverity_init --load-verified-keys'"" into main 2023-07-26 18:06:51 +00:00
Yunkai Lim
9292f74fc1 Revert "init.rc: stop calling 'fsverity_init --load-verified-keys'"
Revert submission 2662658-fsverity-init-cleanup

Reason for revert: Culprit for test breakage b/293232766

Reverted changes: /q/submissionid:2662658-fsverity-init-cleanup

Change-Id: I77086f955a53eec274166b7395a88b7dc0e1ad53
2023-07-26 06:21:43 +00:00
Eric Biggers
534840eeab Merge "init.rc: stop calling 'fsverity_init --load-verified-keys'" into main am: 5aade9ca04 am: e17aeed6b8
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2662658

Change-Id: Ibb90ec4b0d816514def6522eb761fb7ac0a9ecfb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-26 00:35:03 +00:00
Eric Biggers
5aade9ca04 Merge "init.rc: stop calling 'fsverity_init --load-verified-keys'" into main 2023-07-25 22:49:09 +00:00
Lee George Thomas
2493d50328 Create /data/misc/bootanim folder in init.rc.
This folder is used to host bootanim data files.

Bug: 210757252
Test: /data/misc/bootanim is correctly created.
Change-Id: I9c9949316d073ad7ebac503f097c5fee6c0b2a22
2023-07-25 15:07:17 -07:00
Jakob Vukalović
1fae39537b Merge "ueventd: Fix creation of VFIO dev nodes" into main am: 998c3b4fbe am: fcd6f0fb11
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2664635

Change-Id: I748da01fd401365e539b0b2697dddcf894beb0fe
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-20 10:19:30 +00:00
Jakob Vukalovic
e377432924 ueventd: Fix creation of VFIO dev nodes
VFIO nodes, both the container (`vfio`) node and group (numbered)
nodes, should be located in `/dev/vfio`. This change prevents
ueventd from flattening that structure.

Test: Bind a device to VFIO driver to create a VFIO group
Change-Id: I635e9febe6bb52718df263e735479f361eacad4c
2023-07-19 10:03:10 +01:00
Eric Biggers
7acaea6770 init.rc: stop calling 'fsverity_init --load-verified-keys'
Since Android 14, Android does not use fsverity builtin signatures.
(fsverity remains supported, but signatures are verified in userspace,
or fsverity is used for integrity-only use cases.)  Therefore, the only
reason to still run 'fsverity_init --load-verified-keys' at boot time is
to ensure that old files can still be opened, if:

- They were created by Android 13 or earlier, with an fsverity builtin
  signature by a key in /{system,product}/etc/security/fsverity/.

- *And*, the kernel still has CONFIG_FS_VERITY_BUILTIN_SIGNATURES=y.

However, it appears that this isn't actually needed anymore.  Only two
features could potentially be affected: APK verity and updatable fonts.
APK verity wasn't widely rolled out before being disabled, and updatable
fonts have recovery logic in place for when the files cannot be opened.
And in any case, disabling CONFIG_FS_VERITY_BUILTIN_SIGNATURES in the
kernel is recommended and would avoid any problem.

Bug: 290064770
Test: presubmit
Change-Id: I3376c3f0b4b9bd4ba2fd614259522be0c1daafb6
2023-07-19 01:13:15 +00:00
Eric Biggers
2bbf32dae5 Merge changes from topic "fsverity-init-cleanup" into main am: 42164ff920 am: 0a4764fa46
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2650779

Change-Id: Ie281f2296131a79d023a121905c715049db06a13
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-17 21:25:03 +00:00
Eric Biggers
42164ff920 Merge changes from topic "fsverity-init-cleanup" into main
* changes:
  init.rc: stop using fsverity_init --lock
  init: remove unfinished fsverity signature support for APEX sepolicy
2023-07-17 20:10:28 +00:00
David Anderson
bac6593a1e Allow processes in the "system" group to read /metadata/ota. am: a71faae86f am: f0c99ee9c7
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2656857

Change-Id: I64ed8cee332e04476953c5747d967b253a58f6bc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-17 18:22:34 +00:00
David Anderson
f0c99ee9c7 Allow processes in the "system" group to read /metadata/ota. am: a71faae86f
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2656857

Change-Id: I18f9de66c7d23e4752bb86c0726a9259bf24ee41
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-17 17:37:20 +00:00
David Anderson
f489314dec Merge changes from topic "lpdump-snapshots" into main
* changes:
  Remove local_include_dirs from fs_mgr_defaults.
  Allow processes in the "system" group to read /metadata/ota.
2023-07-17 16:55:14 +00:00
Eric Biggers
5a737c89e8 Merge "init.rc: start update_verifier instead of update_verifier_nonencrypted" into main am: 6044e8e444 am: 0e1f4b17ca
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2653216

Change-Id: Id1d9384494671825c1ee55ea4aa1f94a0a226cbd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-14 21:27:48 +00:00
David Anderson
a71faae86f Allow processes in the "system" group to read /metadata/ota.
lpdumpd runs as "system", not "root". Adjust the DAC permissions of
/metadata/ota so it can call SnapshotManager::Dump.

Bug: 291083311
Test: lpdump
Change-Id: I97fd7eb2055cf6d31fd42f1021e2f99edbdb838a
2023-07-14 09:01:05 -07:00
Eric Biggers
e23813e53d Merge "init.rc: merge the zygote-start actions" into main am: 620ea56515 am: 6d086b5ab1 am: 1dfec1d8ef
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2653210

Change-Id: I9860d5b261e3c1039ecfea85124ab1f8bc2234a2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-11 18:36:30 +00:00
Eric Biggers
6e8e8ac71f init.rc: start update_verifier instead of update_verifier_nonencrypted
The "update_verifier_nonencrypted" service is being replaced with simply
"update_verifier", so update init.rc accordingly.

Bug: 208476087
Test: presubmit
Change-Id: I58f3fb25167ff7d3679c72e5e9c012f02fa5b516
2023-07-11 00:05:35 +00:00
Eric Biggers
fac2b18fff init.rc: merge the zygote-start actions
The three actions for "zygote-start" are identical except for their
property triggers.  This seems to have been left over from when Android
supported both File Based Encryption (FBE) and Full Disk Encryption
(FDE), causing there to be four possible encryption states:

- ro.crypto.state=unsupported (No encryption configured)
- ro.crypto.state=encrypted && ro.crypto.type=file (FBE enabled)
- ro.crypto.state=unencrypted (FDE supported but disabled)
- ro.crypto.state=encrypted && ro.crypto.type=block (FDE enabled)

It seems that the reason the zygote-start action was duplicated three
times was to exclude the "FDE enabled" case, which could only be done by
explicitly listing the other three cases.

However, now that FDE is no longer supported, only the first two cases
are possible.  Therefore, zygote-start can just be the whole trigger.

Bug: 208476087
Test: presubmit
Change-Id: Icd6e4b0d2fb3f9f20595c0af4e2e35350564da8d
2023-07-10 23:33:13 +00:00
Eric Biggers
79a67391bd init.rc: stop using fsverity_init --lock
Remove the code that "locked" the .fs-verity keyring at a certain point
in the boot.  It probably was thought that this achieved some useful
security property, which is a bit questionable.  Regardless, Android no
longer uses fsverity builtin signatures.  The only code that is still
being kept around is enough to access existing files on old kernels, and
for this "locking" the keyring is definitely not essential.

Bug: 290064770
Test: presubmit and booting Cuttlefish
Change-Id: Ide5729aeac5772658b2a3f0abe835988b8842b02
2023-07-06 18:39:22 +00:00
Daeho Jeong
ca59aad0f8 Merge "init.rc: set f2fs seq_file_ra_mul to 128" am: 47c0bfa8c7 am: 405434f4ed am: b883de8a5c
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2640544

Change-Id: Ic0f54644708cd7db8d3d8d9de1be4d818df2939a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-29 17:58:03 +00:00
Daeho Jeong
d6d8c1f81c init.rc: set f2fs seq_file_ra_mul to 128
Based on experiments, we fount out 128 (128 x global readahead window
size = 16mb) is the optimal multiple to boost up read speeds for the
sequentially accessed files with POSIX_FADV_SEQUENTIAL.

Bug: 195311558
Test: check the /sys/fs/f2fs/<userdata partition>/seq_file_ra_mul value
Change-Id: I7563ad6e47b9ab76ae7fe36978d0e5970a7490e8
Signed-off-by: Daeho Jeong <daehojeong@google.com>
2023-06-28 14:35:30 -07:00
Eric Biggers
01774360d3 Merge "Remove write permission from file mode of top-level user dirs" am: 46477f1d82 am: c7f7743f4f am: 8f2e5f1ea1
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2620458

Change-Id: I756e5f08b99e3b50099cadfdd4ffa67b096f7bcd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-20 20:01:03 +00:00
Eric Biggers
7a0611b006 Remove write permission from file mode of top-level user dirs
Due to the work done for b/156305599 ("Ensure no process except vold can
create directories like /data/system_ce/0"), the SELinux policy now
enforces that vold is the only process that can write to directories
that contain per-user encrypted subdirectories.  This is essential to
prevent bugs where directories that are supposed to be encrypted get
created too early so are not actually encrypted as intended.

However, this only works when SELinux is in enforcing mode.  When
SELinux is in permissive mode, only DAC is enforced, and the file modes
allow other processes to write to many of these directories.  That
allows system_server to break things once again.

Therefore, remove the write bit from the file modes so that write access
is always denied to processes that don't have CAP_DAC_OVERRIDE.  This is
not as strong a restriction as the SELinux policy, which still applies
independently, but it does keep out system_server by itself.

Also remove the sticky bit from /data/misc_ce and /data/misc_de, since
there is no reason for it.  (It probably was originally copied from
/data/misc, which might need it.  But misc_{ce,de} don't need it.)

Bug: 285239971
Test: Booted Cuttlefish
Change-Id: I1213a4d18c5f851acf213d786400d79d73777ed0
2023-06-08 21:29:19 +00:00
Vova Sharaienko
9557f5e0ab Merge "Increasing length of the datagram for Unix Domain Socket" into udc-dev am: 9248d4de2b
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/23478317

Change-Id: I3c39649a264dc32aadf0ea6e9450b33bff2c0b9a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-02 02:34:25 +00:00
Vova Sharaienko
99b308c9f6 Increasing length of the datagram for Unix Domain Socket
- address p99 StatsD socket loss issue

Bug: 284508851
Test: atest statsd_test
Test: atest statsd_benchmark
Ignore-AOSP-First: mitigate data loss in Android U
Change-Id: I4124ba8d4d78733eb666073f6d29dfe0c0552c0f
Merged-In: I4124ba8d4d78733eb666073f6d29dfe0c0552c0f
2023-06-02 00:27:05 +00:00
Vova Sharaienko
ab5e525050 Increasing length of the datagram for Unix Domain Socket
- address p99 StatsD socket loss issue

Bug: 284508851
Test: atest statsd_test
Test: atest statsd_benchmark
Ignore-AOSP-First: mitigate data loss in Android U
Change-Id: I4124ba8d4d78733eb666073f6d29dfe0c0552c0f
Merged-In: I4124ba8d4d78733eb666073f6d29dfe0c0552c0f
2023-06-01 22:04:22 +00:00
Martin Stjernholm
655a03f7c2 Run art_boot before odsign.
It's necessary to have the right dalvik.vm.* flags in place when they
are validated by odrefresh.

Test: See the other CL in the topic.
Bug: 281850017
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:7c9c8f52e75daf30ae0cc6130c321769a23e320d)
Merged-In: Ib64790dde97faaa6b62ead2c1c8dd53c97f97f9c
Change-Id: Ib64790dde97faaa6b62ead2c1c8dd53c97f97f9c
2023-05-15 20:09:34 +00:00
Martin Stjernholm
e2855628a7 Run art_boot before odsign. am: 7c9c8f52e7
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/23164806

Change-Id: Iddf0f8d11d00e7cd220084d633ddf7738da45690
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-12 11:18:46 +00:00
Martin Stjernholm
7c9c8f52e7 Run art_boot before odsign.
It's necessary to have the right dalvik.vm.* flags in place when they
are validated by odrefresh.

Test: See the other CL in the topic.
Bug: 281850017
Ignore-AOSP-First: Will cherry-pick to AOSP later
Change-Id: Ib64790dde97faaa6b62ead2c1c8dd53c97f97f9c
2023-05-11 16:02:30 +01:00
Steven Moreland
0ee4edce8b Merge changes I138f3ace,I19f7fc51 am: b8304d1502 am: ef7cc54e9c am: de05fe1d49
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2560250

Change-Id: I5e3f25006a2f68f2ec87d8e787995523eec14dc1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-03 19:41:09 +00:00
Steven Moreland
7d53332195 init.usb.rc: specify user manually
Merging as a separate CL due to a log showing up
related to this on hwasan (is a prebuilt pulling
this in?)

Bug: 276813155
Test: boot cf
Change-Id: I19f7fc51c937d0eb1ee17781fc5d201a0972c4b0
2023-05-03 01:06:38 +00:00
Vincent Donnefort
e80a6b6dd4 ramdisk_node_list: Add urandom node
Bionic requires random numbers to init the shadow call stack. Those
numbers are obtained via the syscall getrandom (non-blocking) and will
fallback to /dev/urandom if the former fails.

When loading pKVM modules, we are so early in the boot process that the
only source of entropy for the linux RNG are the architecture random
number generators... which might be available on some platforms. Without
any source of entropy, the only way of generating a random number is to
try to generate some, which is what the bionic fallback expects via
urandom.

As a consequence, add the urandom node to the initramfs.

Bug: 274876849
Merged-In: I111e2db53fabd63d070b8e9ab9c52faebf484ab3
Change-Id: I34a0e3f7c72de7344512366d4a96183b445edc2e
2023-05-02 09:48:21 +00:00
Vincent Donnefort
097363b5a7 Merge "ramdisk_node_list: Add urandom node" am: 954cc2ad2c am: 43d2f31e23 am: 1d2d916bc6
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2570470

Change-Id: If626e456c2186cb660d33e48a1c33459272b5a46
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-28 19:12:05 +00:00
Vincent Donnefort
b6e3d145aa ramdisk_node_list: Add urandom node
Bionic requires random numbers to init the shadow call stack. Those
numbers are obtained via the syscall getrandom (non-blocking) and will
fallback to /dev/urandom if the former fails.

When loading pKVM modules, we are so early in the boot process that the
only source of entropy for the linux RNG are the architecture random
number generators... which might be available on some platforms. Without
any source of entropy, the only way of generating a random number is to
try to generate some, which is what the bionic fallback expects via
urandom.

As a consequence, add the urandom node to the initramfs.

Bug: 274876849
Change-Id: I164b08f026a238dad9f27a345bdef96717f2aa74
2023-04-28 09:51:05 +01:00
Florian Mayer
464e33d5dc Merge "Expose hwasan runtime to Java apps" am: bbcad5b6dd am: 71059adf08 am: 8664d23981
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2526521

Change-Id: I8dac2f13f550ef2da6d3e175e4c7a6d5fb8ec2bc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-15 00:42:08 +00:00
Florian Mayer
bbcad5b6dd Merge "Expose hwasan runtime to Java apps" 2023-04-14 23:27:56 +00:00
Steven Moreland
ec2445d08e Merge "Explicit init .rc user." am: f0578771ea am: f90cb6315d am: 0ca68a5b05
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2530202

Change-Id: I86b206cc28c154239244301341c20bfafa17a77e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-14 23:20:41 +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
Florian Mayer
e8e722fa33 Expose hwasan runtime to Java apps
This is needed so hwasan-enabled apps can be run for debugging.

Bug: 276930343
Change-Id: I24d0955b71924d191770a6571b56e45bf28a742e
2023-04-06 15:56:33 -07:00
Bart Van Assche
eef0f563fd [DO NOT MERGE] 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.

The blkio controller has been marked as optional since not all Android
kernels enable this controller (CONFIG_BLK_CGROUP).

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: I3c07c1be84c3feb277b7d7003652d5d3b57c6541
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-03-22 11:39:53 -07:00
Woody Lin
0bcf0bf8f3 Fix labels on /data/system/shutdown-checkpoints/
Bug: 260366497
Bug: 264600011
Test: The correct label is assigned to dir after taking reboot
Test: Both system_server and dumpstate can access it
Change-Id: Icecbb59ddf936088aa3873bf1b143a08f035fefe
2023-02-22 15:57:17 +08:00
Jeffrey Huang
5c1d43f732 Merge "Create new directory for statsd restricted configs" 2023-02-15 00:26:17 +00:00
Jeffrey Huang
01a73d74d8 Create new directory for statsd restricted configs
Bug: 264407489
Test: m -j
Change-Id: I10e7d6a4a6d011eb9a7453191ab90771b82aa9b3
2023-02-14 11:25:45 -08:00
Bob Badour
ce88220fa1 [LSC] Add LOCAL_LICENSE_KINDS to system/core
Added SPDX-license-identifier-Apache-2.0 to:
  rootdir/Android.mk

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all
Change-Id: I19aaea76a932cc928bbc178c01a33fdc98b0cf16
2023-02-09 11:29:51 -08:00
Hongwei Wang
a1db003a29 Merge "Grant wmtrace access to platform_app:systemui" 2023-01-31 19:38:15 +00:00
Hongwei Wang
231e80db35 Grant wmtrace access to platform_app:systemui
Grant read/write access to anyone for /data/misc/wmtrace folder on
debuggable builds, it's further protected by the selinux policy.

This is to allow systemui process to write proto logs to the same folder
on device as WindowManager, both can contribute to the transitions like
PiP, Split-Screen and etc.

Bug: 251513116
Test: adb shell dumpsys activity service SystemUIService \
      WMShell protolog [start | stop]
Change-Id: Ice57efa17c61d132b02c0a11a762c24d772bd90a
2023-01-30 12:03:54 -08:00