Commit graph

2946 commits

Author SHA1 Message Date
Treehugger Robot
6e784c5503 Merge "Prevent debugfs unmount on debug builds with a persist property" 2021-04-22 21:43:18 +00:00
Artur Satayev
1acd663e96 Don't generate /etc/classpath in make.
Soong generates classpaths.proto config and puts it into
/system/etc/classpaths/ for derive_classpath to read at runtime. There
is no need to plumb these values via make anymore.

Bug: 180105615
Test: m && launch_cvd; presubmit / DeviceBootTest
Change-Id: I514c5036871233ae865b972effea8321dbe4aea9
2021-04-22 12:17:49 +00:00
Treehugger Robot
79cd46d1e9 Merge "Rename ro.product.enforce_debugfs_restriction appropriately" 2021-04-20 06:07:53 +00:00
Treehugger Robot
d7fd9b715c Merge "Add libneuralnetworks_shim.so to requireLibs." 2021-04-19 15:40:11 +00:00
Hridya Valsaraju
129d8743b9 Prevent debugfs unmount on debug builds with a persist property
In order to simplify developer/test flow, the persistent property
persist.dbg.keep_debugfs_mounted can be set to prevent debugfs from
being unmounted on boot.

Bug: 184381659
Test: build and boot
Change-Id: I714616b361e6c8fb59633ec0763f9bd55af7df0e
2021-04-16 13:59:15 -07:00
Hridya Valsaraju
d723f21fec Rename ro.product.enforce_debugfs_restriction appropriately
Rename ro.product.enforce_debugfs_restrictions to
ro.product.debugfs_restrictions.enabled as per the sysprop naming
scheme.

Bug: 184381659
Test: build, boot
Change-Id: Ie350eefa342e7e16d31363139257ed285780e874
2021-04-16 09:52:03 -07:00
Paul Crowley
61abbef4e4 Merge changes from topic "revert-1665499-revert-1660531-max-boot-level-crypto-KFMCEDKSIV-WPIHELCRFI"
* changes:
  Revert^2 "Set earlyBootEnded before apex starts"
  Revert^2 "Expose AID_KEYSTORE"
2021-04-16 15:51:27 +00:00
Treehugger Robot
3f4ea91c7c Merge "Move debugfs mount/unmount to init-debug.rc" 2021-04-16 01:54:54 +00:00
Artur Satayev
a2631ebc13 Install platform-bootclasspath generated config in /system/etc.
platform-bootclasspath module generates classpaths.proto config with
the information for derive_classpath to read and parse at runtime.

See go/updatable-bootclasspath.

Bug: 180105615
Test: m && launch_cvd; presubmit / DeviceBootTest
Change-Id: I0f4b1cfce9468fd6e3377a1d7233245e30f1ea51
2021-04-15 22:32:31 +00:00
Paul Crowley
7583da1bcd Revert^2 "Set earlyBootEnded before apex starts"
Revert submission revert-1660531-max-boot-level-crypto-KFMCEDKSIV

Reason for revert: topic:vold-use-keystore2 has landed fixing the bug

Reverted changes:
Ibf63734a: Revert "Set earlyBootEnded before apex starts"
Id02f63a7: Revert "Expose AID_KEYSTORE"
Ibcedeff4: Revert "Cryptographic security for MAX_BOOT_LEVEL"

Restored changes:
Ia3b968afc:Set earlyBootEnded before apex starts
Ia69891291:Expose AID_KEYSTORE
I12530cd13:Cryptographic security for MAX_BOOT_LEVEL

Reverted-SHA1: 82cfe66794

Original commit message:
earlyBootEnded signals to keystore2 to read the database for the first
time, and start the MAX_BOOT_LEVEL system. It must therefore run
after /data is mounted and /data/misc/keystore is created, but before
apexd or odsign starts.

Bug: 176450483
Test: atest com.android.tests.odsign.OnDeviceSigningHostTest#verifyArtUpgradeSignsFiles
Change-Id: Ib9c2b4bbdddecdf73924125f9bdc75c82e1dd257
2021-04-15 12:55:28 -07:00
Przemysław Szczepaniak
14f6751df1 Add libneuralnetworks_shim.so to requireLibs.
Adding in case of link required from the system image to nn apex.

Test: Run sample vendor service on cf device
Bug: 172925288
Change-Id: Ic4609cc0b73dfd5c9d39b75b22e241c30d61b753
2021-04-15 11:12:15 +01:00
Orion Hodson
abe3b42eb4 Merge "Create directory for caching odrefresh metrics" 2021-04-15 08:51:01 +00:00
Jooyung Han
489cea14d8 Make prebuilt_etc for public.libraries.android.txt
so that this can be packaged in a filesystem(e.g microdroid)

Bug: 181093750
Test: MicrodroidTestCase
Change-Id: Ib86789de4632a32eee31fee0607d5ade8ae6b33f
2021-04-15 09:45:48 +09:00
Hridya Valsaraju
3f384a25fa Move debugfs mount/unmount to init-debug.rc
Debugfs cannot be mounted in userbuilds since Android R. Since init only
mounts/unmounts debugfs during boot for debug builds, move it to
init-debug.rc.

Bug: 184381659
Test: build/boot
Change-Id: Ib51e82b99ec1eb95a2647c91855f6d4d1585040a
2021-04-13 14:45:50 -07:00
Andrew Walbran
d8d9736573 Merge "Give virtmanager user access to /dev/kvm and /dev/vhost-vsock for crosvm" 2021-04-13 09:18:44 +00:00
Hridya Valsaraju
2a8b028c04 Merge "Use property ro.product.enforce_debugfs_restrictions to enable debugfs restrictions" 2021-04-12 17:11:23 +00:00
Andrew Walbran
e76a7ef09c Give virtmanager user access to /dev/kvm and /dev/vhost-vsock for crosvm
Bug: 183583115
Test: Ran a VM manually with vm tool
Change-Id: Idf691c3ec3551c4cdadaecff96eddc2027dc8c79
2021-04-12 15:25:35 +00:00
Martin Stjernholm
33a4e5539b libdexfile_external is replaced by libdexfile (reland 2).
This relands https://r.android.com/1644045 after requisite fix in
https://r.android.com/1671709.

Test: atest CtsSimpleperfTestCases
Bug: 143978909
Change-Id: I89650a8059b56d2b35a5592ef555c91faa49a2cf
2021-04-09 19:11:13 +01:00
Orion Hodson
44bedf6a58 Create directory for caching odrefresh metrics
Metrics are written to /data/misc/odrefresh by odrefresh during early
boot, then the zygote passes them to statsd and delete the metrics
files.

Bug: 169925964
Test: manual
Change-Id: Ia39098109d59600ae8d7b197f46e9a6de18ca57c
2021-04-09 15:42:31 +01:00
Ulyana Trafimovich
9cfeb70f97 Revert "libdexfile_external is replaced by libdexfile (reland)."
Revert "Merge libdexfile_external into libdexfile (reland)."

Revert "Rename libdexfile_external_static to libdexfile_static (..."

Revert "Rename libdexfile_external_static to libdexfile_static (..."

Revert submission 1666119-libdexfile-noext-2

Reason for revert: broken build 7270939 on aosp-master on full-eng
Reverted Changes:
I582e49ae7:Merge libdexfile_external into libdexfile (reland)...
Iaa6a90f41:Rename libdexfile_external_static to libdexfile_st...
I4315189b2:libdexfile_external is replaced by libdexfile (rel...
Ia065119c2:Rename libdexfile_external_static to libdexfile_st...

Bug: 184929782
Change-Id: Id4830ded68e6fb3e9da0bcd8e428c46a79df3ff8
Test: forrest build for aosp-master on full-eng
2021-04-09 11:35:11 +00:00
Ulyana Trafimovich
82cfe66794 Revert "Set earlyBootEnded before apex starts"
Revert "Cryptographic security for MAX_BOOT_LEVEL"

Revert submission 1660531-max-boot-level-crypto

Reason for revert: broken test com.android.tests.odsign.OnDeviceSigningHostTest#verifyArtUpgradeSignsFiles on aosp-master on aosp_cf_x86_64_phone-userdebug at 7261517

Reverted Changes:
Ia3b968afc:Set earlyBootEnded before apex starts
Ia69891291:Expose AID_KEYSTORE
I12530cd13:Cryptographic security for MAX_BOOT_LEVEL

Bug: 184635938
Change-Id: Ibf63734a02a2c132142671c0fae5d0177bf46079
Test: forrest run for the broken test
2021-04-06 16:07:07 +00:00
Martin Stjernholm
0648856a1f libdexfile_external is replaced by libdexfile (reland).
This relands https://r.android.com/1644045 after fixing the build issue
in b/184239856.

Test: atest CtsSimpleperfTestCases
Bug: 143978909
Change-Id: I4315189b243503f5633f64d46a0ffedad3bebf0c
2021-04-06 14:01:44 +01:00
Paul Crowley
02e0ddcaf9 Set earlyBootEnded before apex starts
earlyBootEnded signals to keystore2 to read the database for the first
time, and start the MAX_BOOT_LEVEL system. It must therefore run
after /data is mounted and /data/misc/keystore is created, but before
apexd or odsign starts.

Bug: 176450483
Test: cuttlefish: check keystore2 logs to ensure all looks well.
Change-Id: Ia3b968afc38edf95712480e99e545ba88ea309c3
2021-04-05 21:40:36 -07:00
Hridya Valsaraju
6b7311fc99 Use property ro.product.enforce_debugfs_restrictions to enable debugfs
restrictions

Use the property ro.product.enforce_debugfs_restrictions to enable
debugfs restrictions instead of checking the launch API level. Vendors
can enable build-time as well as run-time debugfs restrictions by
setting the build flag PRODUCT_SET_DEBUGFS_RESTRICTIONS true which in
turn sets ro.product.enforce_debugfs_restrictions true as well enables
sepolicy neverallow restrictions that prevent debugfs access. The
intention of the build flag is to prevent debugfs dependencies from
creeping in during development on userdebug/eng builds.

Test: build and boot
Bug: 184381659
Change-Id: If555037f973e6e4f35eb7312637f58e8360c3013
2021-04-02 17:00:50 -07:00
Nikita Ioffe
89e50ee521 Merge "Revert "libdexfile_external is being replaced by libdexfile."" 2021-04-01 14:22:53 +00:00
Nikita Ioffe
698370e933 Revert "libdexfile_external is being replaced by libdexfile."
Revert "Merge libdexfile_external into libdexfile."

Revert "libdexfile_external is replaced by libdexfile."

Revert "Rename libdexfile_external_static to libdexfile_static."

Revert "Rename libdexfile_external_static to libdexfile_static."

Revert "Allow dependencies from platform variants to APEX modules."

Revert submission 1658000

Reason for revert: Breaks full-eng build: b/184239856
Reverted Changes:
I4f8ead785:Avoid internal APEX stubs for libsigchain and clea...
I68affdf69:Allow dependencies from platform variants to APEX ...
I54b33784e:Rename libdexfile_external_static to libdexfile_st...
Id68ae9438:libdexfile_external is being replaced by libdexfil...
I12ac84eb4:libdexfile_external is replaced by libdexfile.
If05dbffc8:Rename libdexfile_external_static to libdexfile_st...
Ia011fa3a8:Merge libdexfile_external into libdexfile.

Change-Id: I2448810c9a863cde32b6ed98d9ed0a99cf260d34
2021-04-01 10:58:24 +00:00
Martin Stjernholm
3080a06431 Merge "libdexfile_external is being replaced by libdexfile." 2021-04-01 06:53:13 +00:00
Treehugger Robot
911850ecc3 Merge "Copy vendor.sys.usb.adb.enabled to sys.usb.adb.enabled." 2021-03-31 00:06:44 +00:00
Martin Stjernholm
3ecc22fd20 libdexfile_external is being replaced by libdexfile.
Test: atest CtsSimpleperfTestCases
Bug: 143978909
Change-Id: Id68ae9438e8e7a902ee00e00f53018aa90e92c7b
2021-03-30 12:19:49 +01:00
Artur Satayev
7df79970ad Delay running derive_classpath.
It must run before odsign; and now runs after restorecon on /data as well.

Bug: 183861600
Bug: 180105615
Test: presubmit && cuttlefish boots
Change-Id: Iefe59d94a7a40ed1e526c189cbc2baf69156f334
2021-03-30 11:57:38 +01:00
Artur Satayev
441e6b91e1 Attempt to fix labels on /data/system/environ/.
Bug: 183861600
Bug: 180105615
Test: presubmit && cuttlefish boots
Change-Id: Ic5206eb28e8028ec3c9c4b5a756c46ddb6e68b58
2021-03-30 11:49:05 +01:00
satayev
baf2168da7 Merge "Revert^2 "Exec_start derive_classpath on post-fs-data."" 2021-03-23 10:10:00 +00:00
Josh Gao
552f3b4b9c Copy vendor.sys.usb.adb.enabled to sys.usb.adb.enabled.
Bug: http://b/182088146
Test: manual
Change-Id: Ic20dd05813d834ad077f241929030f69906bf0bf
2021-03-22 16:36:17 -07:00
Michael Rosenfeld
e853d37efd Add a system property to init that drops caches.
*   Users can't call /proc/sys/vm/drop_caches otherwise.
*   Requires change with associated SELinux permissions.

Bug: 178647679
Test: flashed user build and dropped caches; no avc denials.
Test: flashed userdebug build and dropped caches w/o root.
Change-Id: Ibc91991509f0902d1c04c958fefc0966233f0b2e
2021-03-19 10:30:01 -07:00
satayev
52cc896997 Revert^2 "Exec_start derive_classpath on post-fs-data."
9ebc6085da

Bug: 180105615
Test: manual boot of cuttlefish and gphone emulator
Change-Id: I299df6b29194fdf41fdcb2c1f59f65241b519c8d
2021-03-19 11:21:07 +00:00
Martijn Coenen
648dec66d5 Support asynchronous odsign.
To improve boottime, we want to run odsign in an asynchronous fashion;
but there are 2 places where we do need it be sync:
1) We need to know when it's done using its key, so that we lock
keyrings and advance the boot stage
2) We need to know verification is complete before we start the zygote

These are indicated by odsign using separate properties.

Bug: 165630556
Test: init waits for the properties, and proceeds when done
Change-Id: I623c24a683340961b339ed19be2f577d9293b097
2021-03-19 09:05:09 +01:00
Orion Hodson
8de8eb741b Merge "Revert "Exec_start derive_classpath on post-fs-data."" 2021-03-18 19:18:02 +00:00
Orion Hodson
9ebc6085da Revert "Exec_start derive_classpath on post-fs-data."
Revert "Introduce derive_classpath service."

Revert "Introduce derive_classpath."

Revert submission 1602413-derive_classpath

Bug: 180105615
Fix: 183079517
Reason for revert: SELinux failure leading to *CLASSPATH variables not being set in all builds

Reverted Changes:
I6e3c64e7a:Introduce derive_classpath service.
I60c539a8f:Exec_start derive_classpath on post-fs-data.
I4150de69f:Introduce derive_classpath.

Change-Id: Iefbe057ba45091a1675326e3d5db3f39cc3e2820
2021-03-18 17:00:23 +00:00
Paul Hu
b684856949 Merge "Migrate net.tcp.default_init_rwnd to net.tcp_def_init_rwnd" 2021-03-17 11:24:53 +00:00
satayev
294167d436 Merge "Exec_start derive_classpath on post-fs-data." 2021-03-17 10:58:30 +00:00
paulhu
f8cdebfc35 Migrate net.tcp.default_init_rwnd to net.tcp_def_init_rwnd
Currently, tcp receive window size is read from
net.tcp.default_init_rwnd then set to net.tcp_def_init_rwnd. It
should not use seperate property to read/write the value, it only
needs one of property basically. So migrate
net.tcp.default_init_rwnd to net.tcp_def_init_rwnd which has
formal API.

Bug: 182538166
Test: Manually check that net.tcp_def_init_rwnd has default
      value and proc/sys/net/ipv4/tcp_default_inti_rwnd node
      is created with same value.
Change-Id: I6748485f99198b1200c67d6595b659aac7d7e1e0
2021-03-17 13:59:22 +08:00
Nicolas Geoffray
f85f3d628e Merge "Add libsigchain as dependency of platform." 2021-03-15 16:04:38 +00:00
Nicolas Geoffray
8a3f8853d3 Add libsigchain as dependency of platform.
Test: m and boot
Test: atest CtsJniTestCases
Bug: 142944043
Change-Id: Iefded35c478d6278c56fbfa02e5cb364a9326c5c
2021-03-13 16:07:13 +00:00
Martijn Coenen
43defd972f Merge "Add some keystore boot levels." 2021-03-11 09:25:40 +00:00
Artur Satayev
1320668c52 Exec_start derive_classpath on post-fs-data.
The service parses and merges configs from multiple partitions, defines
*CLASSPATH environ variables' values and writes them to file, for
init to export.

See go/updatable-classpath for more details.

Bug: 180105615
Test: manual
Change-Id: I60c539a8fef4d690f47704e896f67949ec49db60
2021-03-11 07:20:23 +00:00
Martijn Coenen
e94b36637d Add some keystore boot levels.
The first user of keystore boot levels is on-device signing; transition
the boot level to 30 before running the post-fs data hook, and
transition it to 40 right after on-device signing is done. This leaves
some space for future boot levels to be inserted, if we wanted.

Bug: 165630556
Test: inspect logs
Change-Id: If0a74cbe9ea8fce806020d8a42a978cfb9117ded
2021-03-09 09:59:57 +00:00
Alexander Potapenko
439608bfb0 init.rc: set up a tracing instance for BootReceiver.java
This instance will be used to monitor the error_report_end tracing
events sent by kernel tools in the case of a memory corruption.

Bug: 172316664
Bug: 181778620
Test: manual runs with KFENCE enabled
Signed-off-by: Alexander Potapenko <glider@google.com>
Change-Id: Ibc5cd3b60fb99030cc55db6b490d6d4bbbca3963
2021-03-04 10:36:51 +01:00
Wonsik Kim
5e53f90cdd Revert "init.rc: set up a tracing instance for BootReceiver.java"
Revert "Selinux policy for bootreceiver tracing instance"

Revert submission 1572240-kernel_bootreceiver

Reason for revert: DroidMonitor: Potential culprit for Bug 181778620 - verifying through Forrest before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.
Reverted Changes:
Ic1c49a695:init.rc: set up a tracing instance for BootReceive...
I828666ec3:Selinux policy for bootreceiver tracing instance

Change-Id: I5c2ccfe3eeb8863086b7cb9b3de43c6e076d995a
2021-03-03 22:47:02 +00:00
Alexander Potapenko
2ec6c68ce9 init.rc: set up a tracing instance for BootReceiver.java
This instance will be used to monitor the error_report_end tracing
events sent by kernel tools in the case of a memory corruption.

Bug: 172316664
Test: manual runs with KFENCE enabled
Signed-off-by: Alexander Potapenko <glider@google.com>
Change-Id: Ic1c49a695ff7df4147a7351051db7b6707c86e0a
2021-03-02 16:50:16 +01:00
Paul Crowley
75a2bba158 Merge "Set an initial keystore.boot_level" 2021-02-27 05:05:50 +00:00