Commit graph

64988 commits

Author SHA1 Message Date
Baligh Uddin
5be28efc34 Add visibility for statsd in prep for migration.
BUG: 167962588
TEST: TH
Change-Id: If8579f0942eb051e41105a56891953eda00920d2
2020-12-02 01:57:08 +00:00
Kiyoung Kim
e11663f483 Merge "Remove provide libs from file" 2020-12-02 00:28:25 +00:00
Treehugger Robot
41c2e6286e Merge changes Ie9da525c,I9911f02c,Iad18af1f,I5f432a3d
* changes:
  trusty: provide coverage to gatekeeper fuzzer
  trusty: fuzz: Example TA fuzzer
  trusty: fuzz: Helper lib for libFuzzer extra counters
  trusty: coverage: Coverage client library
2020-12-01 20:20:08 +00:00
Hamzeh Zawawy
9a79c84499 Merge "Resolved UAF issue in RefBase fuzzer" 2020-12-01 18:24:27 +00:00
Tom Cherry
456397830d Merge "Revert "Ramdisk: add metadata dir in ramdisk"" 2020-12-01 17:36:42 +00:00
Tom Cherry
a1411e4311 Merge "fs_mgr: move mkdir(mount_point) to prepare_fs_for_mount()" 2020-12-01 17:36:31 +00:00
jiazi li
18778cd5f9 Revert "Ramdisk: add metadata dir in ramdisk"
This reverts commit 9fa773746c.

Reason for revert: using aosp/1505939 instead

Change-Id: I4c654e5b77b0e5ffac036fe0674f201f2ae19fb6
2020-12-01 06:19:54 +00:00
Tri Vo
a1008a1edf trusty: provide coverage to gatekeeper fuzzer
Bug: 171750250
Test: /data/fuzz/arm64/trusty_gatekeeper_fuzzer/trusty_gatekeeper_fuzzer
Change-Id: Ie9da525c0dcb6c9c5ed2f50396c0065e3a567d22
2020-11-30 20:09:08 -08:00
Tri Vo
680fc001b8 trusty: fuzz: Example TA fuzzer
Bug: 169776499
Test: /data/fuzz/arm64/trusty_test_fuzzer/trusty_test_fuzzer
Change-Id: I9911f02cb49c39f1c3cd89b4e5582e8dfaa645d1
2020-11-30 20:09:07 -08:00
Tri Vo
a67840f998 trusty: fuzz: Helper lib for libFuzzer extra counters
Bug: 169776499
Test: /data/nativetest64/libtrusty_coverage_test/libtrusty_coverage_test
Change-Id: Iad18af1f0404fc47bef481955c7a4292ef3a24ec
2020-11-30 20:09:02 -08:00
Tri Vo
5b40e89894 trusty: coverage: Coverage client library
Bug: 169776499
Test: /data/nativetest64/libtrusty_coverage_test/libtrusty_coverage_test
Change-Id: I5f432a3df04fe7b0e2940a12f8d28b3d0655791f
2020-11-30 19:39:00 -08:00
Kiyoung Kim
344b46a5b3 Remove provide libs from file
Remove provide libs of system image from file, and generate it at build
time instead

Bug: 172889962
Test: Build cuttlefish and confirmed list is generated in
/system/etc/linker.config.pb

Change-Id: I365252dcb2e8735fd8f6345c9ec2c985b0489d64
2020-12-01 10:41:09 +09:00
Dylan Katz
55107c195d Resolved UAF issue in RefBase fuzzer
Restrucures this fuzzer to be far more robust and less brittle.
Fix: 163727995
Fix: 163449137
Test: libutils_fuzz_refbase clusterfuzz-testcase-minimized-libutils_fuzz_refbase-5674315436261376
Test: libutils_fuzz_refbase clusterfuzz-testcase-minimized-libutils_fuzz_refbase-5731662044069888
Test: libutils_fuzz_refbase clusterfuzz-testcase-minimized-libutils_fuzz_refbase-5081777218256896

Signed-off-by: Dylan Katz <dylan.katz@leviathansecurity.com>
Change-Id: I239298dc2895a06af5a126e9ca2ae452579e5cc0
2020-11-30 16:18:27 -08:00
Christopher Ferris
8255631fa9 Merge "Adjust to MapInfo to new api." 2020-11-30 20:42:58 +00:00
Wenhao Wang
b0db51d36e Merge "trusty: Fuzzer for Confirmationui TA" 2020-11-30 00:17:46 +00:00
Wenhao Wang
0124a59fe4 trusty: Fuzzer for Confirmationui TA
Note: We need to add Confirmationui TA into
TRUSTY_BUILTIN_USER_TASKS to run the fuzzer.

Bug: 174402999
Bug: 171750250
Test: /data/fuzz/arm64/trusty_confirmationui_fuzzer/trusty_confirmationui_fuzzer
Change-Id: I22769782ded05eeedeb111f7537b5ba76e98ce73
2020-11-29 13:03:55 -08:00
Tom Cherry
f28a60413c Merge "init: add some documentation in service_utils.h" 2020-11-25 14:18:11 +00:00
Tri Vo
9763f21565 Merge changes Id77b87bb,I56a15c80
* changes:
  trusty: fuzz: make utils lib use libtrusty_test
  trusty: Add libtrusty_test
2020-11-24 20:39:26 +00:00
Tom Cherry
c9bc6bb436 init: add some documentation in service_utils.h
Test: n/a
Change-Id: I2a2691a6d1f643e255550498d9871e38f1b51efa
2020-11-24 11:34:40 -08:00
David Srbecky
8efcd6325c Adjust to MapInfo to new api.
Change-Id: Ic3818a8b001657e6b54ba6fcbf68f8c1d7ef2683
2020-11-24 17:27:05 +00:00
Suren Baghdasaryan
180b2671cc Merge "libprocessgroup: Support per-API level task profiles" 2020-11-24 05:12:01 +00:00
Suren Baghdasaryan
35221b5338 libprocessgroup: Support per-API level task profiles
When task profiles changes happen, devices released under older API
levels might have to use the same profiles as before. This might be
due to for missing kernel features or some other reasons. Add support
for per-API task profiles to accommodate this scenario. With this
mechanism when ro.product.first_api_level is non-empty, the system
looks for /system/etc/profiles/task_profiles_<api level>.json file
and uses it if it exists. If ro.product.first_api_level is not defined
or per-API task profiles file does not exist the system falls back to
the default /system/etc/profiles/task_profiles.json file.
As before, these task profiles can be competely overwritten using
/vendor/etc/task_profiles.json if needed.

Bug: 172066799
Test: boot with per-API task profiles
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: I1671b341b3a0fb5e99d0b0788315c61088326b09
2020-11-23 22:08:41 +00:00
David Anderson
03f4504ffd Merge "libsnapshot: Build snapuserd and its dependencies into vendor_ramdisk." 2020-11-23 21:18:07 +00:00
Tri Vo
90c0e833c9 trusty: fuzz: make utils lib use libtrusty_test
Test: m libtrusty_fuzz_utils
Change-Id: Id77b87bb14f09b29f53c78a4ea89073fbe1c83a1
2020-11-23 12:57:44 -08:00
David Anderson
d9a6144435 Merge changes Ibeffa4a3,Ibce3bac9
* changes:
  libsnapshot: Add a way to detach snapuserd.
  libsnapshot: Remove special-case code for first-stage init.
2020-11-23 20:15:56 +00:00
David Anderson
d7f31801c0 Merge changes Ice594cce,I9a87f988
* changes:
  init: Fix ordering of second-stage snapuserd transition.
  init: Pass a uevent regen callback to libsnapshot.
2020-11-23 18:24:38 +00:00
Rick Yiu
e3d0307e34 Merge "rootdir/init.rc: Remove duplicated settings" 2020-11-23 13:48:31 +00:00
Rick Yiu
1848e5e69c rootdir/init.rc: Remove duplicated settings
Bug: 170507876
Test: build pass
Change-Id: I2cfa886eb84982f03df9bf0db95dc1aae2117418
2020-11-23 07:29:55 +00:00
Akilesh Kailash
e4ebcaac08 Merge "libsnapshot:snapuserd: Fix off by one error in merge path" 2020-11-23 06:23:54 +00:00
Akilesh Kailash
d83044d0c4 libsnapshot:snapuserd: Fix off by one error in merge path
We only need to iterate exceptions_per_area times during
merge. Additional iteration overhsoots the buffer and hence triggers
the assert.

BUG: 168311203
Test: Full OTA with VABC - Verified merge complete

Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: If6e8dee08802ea70a8fd40e93ad63a47f39ce96e
2020-11-23 04:28:26 +00:00
David Anderson
ff118cec5c libsnapshot: Add a way to detach snapuserd.
Currently, when init unlinks /dev/socket/snapuserd, the daemon currently
polling the socket will fail in accept4(). This works because the
process won't exit until all threads have terminated, but it's
confusing, and it creates log spam.

Instead, add an explicit "detach" message so that snapuserd will stop
listening for new connections and will immediately join on remaining
threads. This way snapuserd will gracefully exit when all threads are
complete, and we're guaranteed no new threads will be created.

This will only be used for first-stage instances of snapuserd.

Bug: 173476209
Test: full OTA with VABC, no accept4() errors
Change-Id: Ibeffa4a35043ed43a70166eeee86204e2b3d03aa
2020-11-23 04:14:08 +00:00
David Anderson
5aa05fce28 libsnapshot: Remove special-case code for first-stage init.
Because init needs tighter integration with how to launch snapuserd,
this code will be moved directly into init instead.

Bug: 173476209
Test: manual test
Change-Id: Ibce3bac9699620882eae44188d937d4900f022d3
2020-11-23 04:14:08 +00:00
David Anderson
3fc6555565 Merge "libsnapshot: Add a compression bit to SnapshotUpdateStatus." 2020-11-22 23:54:02 +00:00
David Anderson
1d57fb839d init: Fix ordering of second-stage snapuserd transition.
Running snapuserd before early-init means ueventd is missing, which
means we can't use WaitForFile() when dm-user misc devices are created.
Fix this by starting the transition after early-init.

Bug: 173476209
Test: full OTA with VABC applies and boots
Change-Id: Ice594cceb44981ae38deb82289d313c14726c36b
2020-11-22 13:51:15 -08:00
David Anderson
32f281d77a init: Pass a uevent regen callback to libsnapshot.
In first-stage init, libsnapshot needs to know how to wait for device
paths, since ueventd isn't running yet. We do this by passing a callback
wrapping BlockDevInitializer.

Bug: 173476209
Test: device boots into first-stage init after full VABC ota
Change-Id: I9a87f98824e65a9379cb0b99c001e28cccd9d205
2020-11-22 13:51:03 -08:00
David Anderson
f71ad94e37 libsnapshot: Add a compression bit to SnapshotUpdateStatus.
This adds a compression bit to SnapshotUpdateStatus. This is so init can
tell whether it needs to launch snapuserd, without reading the
individual state of each snapshot, since this state is global.

Bug: 173476209
Test: manual test
Change-Id: I8c3bbfb0d184f70e661e7b043afc37e335d1e187
2020-11-22 21:48:29 +00:00
David Anderson
231cfc4fe6 Merge "libsnapshot: Add a helper for waiting for device paths." 2020-11-22 21:45:26 +00:00
David Anderson
189e8e3a25 libsnapshot: Add a helper for waiting for device paths.
Normally, DeviceMapper::CreateDevice() handles this for us. However, it
does not work in first-stage init, because ueventd is not running.
Therefore this patch adds a way for first-stage init to set a callback
to manually regenerate and process uevents.

Additionally, even with ueventd, dm-user misc device creation needs a
WaitForFile() call, since ueventd is asynchronous.

The WaitForDevice() helper in this patch accounts for both of these
scenarios.

Bug: 173476209
Test: device boots into first-stage init after full VABC ota
Change-Id: Ib7a9bfc2a5a5095aa00b358072f9cb1743c19ab2
2020-11-21 17:12:23 -08:00
David Anderson
84cfcc23c2 Merge "snapuserd: Include the misc device when logging in each snapuserd thread." 2020-11-22 00:49:59 +00:00
David Anderson
8d2bd038f4 snapuserd: Include the misc device when logging in each snapuserd thread.
Bug: N/A
Test: manual test
Change-Id: Ifd6ac5a802549ccc9271b62eedd1509552f27ead
2020-11-21 13:29:42 -08:00
Treehugger Robot
9c4caa22ff Merge changes I83babad2,Iaeb081bc
* changes:
  init.rc: migrate tasks from root cpu cgroup to a subgroup
  task_profiles.json: use system subgroup for NormalPerformance
2020-11-21 02:15:10 +00:00
Wei Wang
77cb6a0015 init.rc: migrate tasks from root cpu cgroup to a subgroup
Migrate tasks from root group to a subgroup would help us to put soft
cpu bandwidth control correctly. There are few tasks now failed to
migrate due to PF_NO_SETAFFINITY which is the default kernel behavior
which we are not overriding at this moment.

This CL also fixed an issue that most of RT thread lost RT attribute
when kernel with CONFIG_RT_GROUP_SCHED enabled, as the subgroup would be
initialized with 0 RT runtime by default. CONFIG_RT_GROUP_SCHED is not
enabled in GKI kernels but there could be devices with
CONFIG_RT_GROUP_SCHED enabled, so setting some budget for those devices
to make they can still function. OEM can either set proper budget by
themselves or remove CONFIG_RT_GROUP_SCHED completely.

Bug: 171740453
Test: boot and check cgroup
Change-Id: I83babad2751c61d844d03383cb0af09e7513b8e9
2020-11-20 12:59:20 -08:00
Wei Wang
4544d991f7 Merge "init: add a copy_per_line built-in command" 2020-11-20 20:05:40 +00:00
Yifan Hong
15cd1cd8fd Merge changes from topic "e2fsprogs_vendor_ramdisk"
* changes:
  fs_config Add first_stage_ramdisk/system/bin/linker[64]
  libsparse: make vendor_ramdisk_available.
  init: don't abort if directory already exists
2020-11-20 19:50:44 +00:00
Daniel Norman
cf539f162f Merge "Returns a service parse error on overrides across the treble boundary." 2020-11-20 18:57:17 +00:00
Wei Wang
b90e23efc7 task_profiles.json: use system subgroup for NormalPerformance
Put tasks into a subgroup so that we can set things up e.g. soft cpu
bandwidth and/or uclamp.

Bug: 170507876
Bug: 171740453
Test: boot and check cgroup
Change-Id: Iaeb081bc4f214aa23eb281e0c28a81ea581bb4d1
2020-11-20 10:54:55 -08:00
Wei Wang
49d2598166 init: add a copy_per_line built-in command
There are sysfs nodes that don't take multiple inputs, adding a new
copy_per_line built-in command to copy from source file to destination
line by line.

Bug: 171740453
Test: boot and check file and log
Change-Id: I41b7a565829299d56b81d4509525dfa6a0a52444
2020-11-20 10:54:14 -08:00
Treehugger Robot
7cf47025ee Merge "dmuserd: Fix error checking" 2020-11-20 01:58:13 +00:00
Yifan Hong
c7ed02f445 fs_config Add first_stage_ramdisk/system/bin/linker[64]
Now that tune2fs and resize2fs may be dynamic, add linker[64] to
first_stage_ramdisk/system/bin.

Test: boot and examine serial output, ensure tune2fs and resize2fs
      can be executed.
Bug: 173425293

Change-Id: I35699b38ddf5004c04ec0adc1b0c54d5d9c92ae6
2020-11-19 17:35:21 -08:00
Yifan Hong
e85233c560 libsparse: make vendor_ramdisk_available.
Test: pass
Bug: 173425293
Change-Id: Id360f205b9135b83edb59d13f978eb28cad041de
2020-11-19 17:35:21 -08:00