Commit graph

68790 commits

Author SHA1 Message Date
Ricky Wai
420830f8a6 Isolate app profile ref data
Due to aosp/1708274, ref data directory is now world accessible.
We need to fix ref data directory so that it does not leak app
visibility information.

Bug: 189787375
Test: AppDataIsolationTests
Change-Id: I716852478ce0734c7038934c88c36a567c06393f
2021-06-08 12:15:14 +01:00
Treehugger Robot
7534f6ca53 Merge "Fixing flakiness in libfs_avb_internal_test" 2021-06-08 10:32:51 +00:00
Bowgo Tsai
6a0cf6b8e3 Fixing flakiness in libfs_avb_internal_test
Using multiple unique_fd() and also modifying the file might
cause some races. Closing the fd when it's not needed.

Bug: 187303962
Test: atest --host libfs_avb_internal_test -- --test-arg \
      com.android.tradefed.testtype.HostGTest:native-test-timeout:5m
Change-Id: I789f33b49e7cbdb22396e1df9a2694dce9f8a6f7
2021-06-08 15:27:41 +08:00
David Anderson
cc8572441e Merge "ueventd: the parallel restorecon dirs is configurable [1/1]" 2021-06-07 23:08:59 +00:00
Treehugger Robot
645a15db77 Merge "fastboot: support vbmeta_vendor.img" 2021-06-07 01:52:54 +00:00
Treehugger Robot
d5e5ba7e96 Merge "remount: Fix failure for system-as-root" 2021-06-04 20:42:22 +00:00
Leo Yan
e81be34c85 remount: Fix failure for system-as-root
Since commit 5ad7b3cbc5 ("Try to remount mounted points only"), the
system-as-root cannot be remounted successfully when execute command
"adb remount".  This is because the mount point "/system" cannot be
found and directly bails out with failure.

Add an extra checking for the mount point "/system" for the
system-as-root case, takes it as a found entry; thus the function can
continue to run and fix up to remount root.

Suggested-by: David Anderson <dvander@google.com>
Signed-off-by: Leo Yan <leo.yan@linaro.org>
Change-Id: Ia936c9d97bed951184813a087c70fe591cb33fe0
2021-06-04 22:30:28 +08:00
Bowgo Tsai
a48a78356f fastboot: support vbmeta_vendor.img
Bug: 181909612
Test: build
Change-Id: If61fff1c83513d71605c0cef2737a38f7575d69b
2021-06-04 00:59:43 +00:00
David Anderson
391056ea73 Merge "Warn loudly if using deprecated ueventd paths." 2021-06-03 22:12:25 +00:00
Mitch Phillips
ca4a4d2690 Merge "[MTE] Print cause and alloc/dealloc traces to logcat." 2021-06-03 18:21:58 +00:00
Yo Chiang
4063fc4a01 Merge "first_stage_mount: mount point must be canonical path" 2021-06-03 06:24:17 +00:00
David Anderson
0050bef9e1 Warn loudly if using deprecated ueventd paths.
Bug: 189268918
Test: treehugger
Change-Id: Ib4cfa4f3a1f4626afcd37278d93390ad34b0216b
2021-06-02 18:22:28 -07:00
Devin Moore
34cf9834e4 Merge "Fix androidboot.bootdevice test case for bootconfig" 2021-06-02 15:37:11 +00:00
yuehu mi
ddffa0ea74 ueventd: the parallel restorecon dirs is configurable [1/1]
PD#SWPL-45884
BUG:187441275

Problem:
ueventd: coldboot took too much time

Solution:
1.The parallel restorecon dirs can be configured in ueventd.rc
2.Add 'parallel_restorecon_dir' keywords
parallel_restorecon_dir <directory>

Verify:
redi

Change-Id: Id5b13f18d36afb894891697f21ac63e78b3fe130
Signed-off-by: yuehu mi <yuehu.mi@amlogic.com>
2021-06-02 20:02:59 +08:00
Yi-Yo Chiang
3431d52675 first_stage_mount: mount point must be canonical path
Ban weird paths such as /../system or //vendor in first stage mount.
Add utility function fs_mgr_create_canonical_mount_point() that:

* mkdir(mount_point) to ensure mount_point's existence
* Test that realpath(mount_point) =?= mount_point

Bug: 188898525
Test: Presubmit
Test: Boot CF
Change-Id: Iaf2ec52701277f26cc81f3e15a47b6083a788334
2021-06-02 16:38:17 +08:00
Treehugger Robot
0f62609aa7 Merge "fs_mgr_fstab: Parse overlayfs options from fs flags" 2021-06-02 07:20:46 +00:00
Yo Chiang
4b18faf982 Merge "Remove deprecated fs_mgr_overlayfs_required_devices()" 2021-06-02 07:17:00 +00:00
Mitch Phillips
78f0670dda [MTE] Print cause and alloc/dealloc traces to logcat.
This information clearly meets the bar for being dumped to logcat. If we
omit the info, we may confuse the user into thinking that it's not
available at all, especially if it's their first time seeing an MTE
report.

This also adds some functionality to the integration testing library to
pull logcat messages and scan them to make sure the contents are in both
places.

Bug: 187881237
Test: atest debuggerd_test # on QEMU w/ MTE.
Change-Id: Icc17ea45bda7628331cc4812eaad3bc5c949b7a7
2021-06-01 18:12:22 -07:00
David Anderson
b4cd291317 Merge "Update documentation for SnapshotMergeReport." 2021-06-01 22:14:55 +00:00
Treehugger Robot
de5ac631bd Merge "adb-remount-test: Make awk scripts mawk-v1.3.3-compatible" 2021-06-01 20:31:44 +00:00
Yi-Yo Chiang
ad3a57bdba adb-remount-test: Make awk scripts mawk-v1.3.3-compatible
Our CI is failing because the host machine is using mawk instead of gawk.
mawk v1.3.3 cannot parse regex such as '/[/]/', while mawk v1.3.4 and
gawk can.
Change regex of '[/]' to '\/' so that our test script is as backward
compatible as possible.

Bug: 188862155
Test: Run adb-remount-test.sh on CI
Change-Id: Ia4fbce58a61325a5e5280ede0d5b7760832d8ec1
2021-05-31 17:52:07 +08:00
Wang Han
fe5b9cfec0 Fix androidboot.bootdevice test case for bootconfig
* This seems to be a typo.

Change-Id: Ibf1317e35090f4fcacf53dc311124d456384fa27
2021-05-31 09:40:30 +00:00
Andrew Walbran
89ddf50566 Merge "Create data directory for VirtualizationService." 2021-05-28 12:06:58 +00:00
Yi-Yo Chiang
a07ed968b5 Remove deprecated fs_mgr_overlayfs_required_devices()
It is unused since Ifc8720378259654472d3822e97059b6c366f601d

Bug: 188862155
Test: Build pass
Change-Id: I6304e0dedb36d03a87c556083e937b4a2ce30b1b
2021-05-28 08:30:55 +00:00
Arve Hjønnevåg
7c8ec7b33b Merge "trusty: apploader: Handle invalid version error" 2021-05-27 18:45:16 +00:00
Michael Butler
2e3dabc629 Merge "Revert "Add libneuralnetworks_shim.so to requireLibs."" 2021-05-27 18:05:25 +00:00
Andrew Walbran
2934ee0bcd Create data directory for VirtualizationService.
Bug: 184131523
Test: Built, flashed, ran microdroid VM via virtmanager
Change-Id: I1e6a5f7a304a02de1efb29e253d8bbd54f3f704d
2021-05-27 13:07:50 +00:00
Yo Chiang
869ab86944 Merge "Make fs_mgr_overlayfs_mount_fstab_entry() available for user builds" 2021-05-27 08:54:20 +00:00
Yi-Yo Chiang
7b81023e2a fs_mgr_fstab: Parse overlayfs options from fs flags
Parse the "lowerdir=" option from fs mount flags instead of fs_mgr flags
for consistency.

Before:

  none /mnt/product/test1 overlay ro lowerdir=/1:/2,first_stage_mount

After:

  none /mnt/product/test1 overlay ro,lowerdir=/1:/2 first_stage_mount

Bug: 188862155
Test: Boot to normal with overlayfs mount entries in first stage fstab
Change-Id: I6d6abd44ab32afadec428005f4aece834f9c8905
2021-05-27 16:37:53 +08:00
Andrew Walbran
f9bafc53b9 Merge "Rename VirtManager to VirtualizationService." 2021-05-26 21:43:54 +00:00
Nikita Ioffe
45acb369ee Merge "libdm: Add DeleteDeviceDeferred API" 2021-05-26 20:20:22 +00:00
Nikita Ioffe
d13cef7435 libdm: Add DeleteDeviceDeferred API
This can be useful in case when a device mapper device can't be deleted
straight away, and instead delete needs to be enqueued until last
reference to the device is closed.

Bug: 187864524
Bug: 188713178
Test: atest libdm_test
Change-Id: Ie8a130baa54e6e16d8d159389bd760bf873eca40
2021-05-26 19:29:07 +01:00
David Anderson
7e2d32bc06 Merge "KillZramBackingDevice: Return immediately if backing_dev is none." 2021-05-26 03:29:05 +00:00
Akilesh Kailash
18a307beb4 Merge "snapuserd: Add test case" 2021-05-26 02:29:53 +00:00
Kelvin Zhang
22d2c263a8 Merge "Add helptext for snapshotctl map" 2021-05-25 21:00:44 +00:00
Kelvin Zhang
c1e78883eb Add helptext for snapshotctl map
Test: no need
Change-Id: I709d02ccd478d6bed34808dc20cbba9ed89097c1
2021-05-25 14:43:52 -04:00
Yi-Yo Chiang
23816e84ca Make fs_mgr_overlayfs_mount_fstab_entry() available for user builds
Rename fs_mgr_overlayfs_mount_fstab_entry() to
fs_mgr_mount_overlayfs_fstab_entry() and move it out of
fs_mgr_overlayfs.cpp to make it available for user builds.

Add checks to unsure overlayfs mount point doesn't contain symbolic
link or /../.

Check the mount point with an allowlist if user build. The mount point
should either be /vendor, /product ... or their submounts, or strict
submounts of /mnt/vendor and /mnt/product.

Bug: 188862155
Test: Boot test with overlayfs mount entries on user build
Change-Id: I3b60dfa4b63cf2ae0754f53d1d08365aa7be1ee0
2021-05-25 22:10:30 +08:00
Yo Chiang
f7584a223c Merge changes I5058cbe8,Ia0b3f1c9
* changes:
  adb-remount-test: Strengthen skip_administrative_mounts
  fs_mgr_overlayfs_mount_fstab_entry(): Rename source device name
2021-05-25 05:01:17 +00:00
Andrew Walbran
3aedc7edc8 Rename VirtManager to VirtualizationService.
Bug: 188042280
Test: atest VirtualizationTestCases
Change-Id: I0e549ef02c7327f57c3d04853b3eefed7403d8e8
2021-05-24 11:41:13 +00:00
Yi-Yo Chiang
f931ad9446 adb-remount-test: Strengthen skip_administrative_mounts
Refactor skip_administrative_mounts so that it filters by device name,
mount point and filesystem type. (Was filtering by device name and mount
point.)

We need this because pseudo filesystems such as tmpfs and overlayfs can
have free-formed device name:

  blah /mnt/mnt_point overlay ro,lowerdir=...

However the filesystem type (third field of /proc/mounts) must be
reflecting the actual filesystem, so to robustly filter out
administrative filesystems, we have to check the filesystem type field.

Bug: 188862155
Test: adb-remount-test.sh
Change-Id: I5058cbe8a36920f25b73a5d5833e9fc5a096e90f
2021-05-23 16:42:11 +08:00
Akilesh Kailash
b3b264c15f snapuserd: Add test case
Add unit test to test reading dm-user block device
without user-space daemon. IO's should fail
with IO error.

Bug: 188362117
Test: cow_snapuserd_test
Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: Ida4efb4373904f6bb92f9904af9fe8443724bd2c
2021-05-22 17:57:48 +00:00
Yi-Yo Chiang
7b90e6936c fs_mgr_overlayfs_mount_fstab_entry(): Rename source device name
adb-remount-test.sh would fail if a overlayfs named "overlay" is mounted
in first_stage_init via fs_mgr_overlayfs_mount_fstab_entry():

  [  FAILED  ] overlay takeover unexpected at this phase

Prepend the source device name with "overlay-", so that the overlayfs
mounted by fs_mgr_overlayfs_mount_fstab_entry() mustn't be named
"overlay".

Bug: 188862155
Test: adb-remount-test.sh
Change-Id: Ia0b3f1c92ed5650c3e584fba23758344a4733657
2021-05-22 22:33:13 +08:00
Treehugger Robot
a14beb2dbc Merge "Fix implicit cast from ssize_t to size_t in KeyedVector.h" 2021-05-22 03:46:09 +00:00
David Anderson
5267127597 Update documentation for SnapshotMergeReport.
Bug: 188909957
Test: N/A
Change-Id: I84496a3cce44745ff9b6ef91f3af2bb8102bf2a0
2021-05-21 18:58:27 -07:00
Michael Butler
6ecfbf3309 Revert "Add libneuralnetworks_shim.so to requireLibs."
This reverts commit 14f6751df1.

Reason for revert: Removing libneuralnetworks_shim.so from Android S

Change-Id: I23acbdc31ddc488ad59225b483936905fa3652ee
Merged-In: I23acbdc31ddc488ad59225b483936905fa3652ee
2021-05-21 19:57:26 +00:00
Vishnu Nair
0878f71613 Fix implicit cast from ssize_t to size_t in KeyedVector.h
Fixes a compiler warning for implicit conversion changes from signed
to unsigned which surfaced when refactoring native input libraries.
Add an explicit cast to avoid adding -Wno-sign-conversion compile
flags.

Test: b libsurfaceflinger_unittest
Change-Id: I8866aef7f09ca5173604abe18c586b68bbf12ed6
2021-05-21 16:45:46 +00:00
Elliott Hughes
2dc28bcfc4 Merge "Increase coverage of Timers to 100%." 2021-05-20 19:37:59 +00:00
Yo Chiang
71db89b1da Merge "fs_mgr_overlayfs: Polish fs_mgr_overlayfs_mount_fstab_entry()" 2021-05-20 06:40:36 +00:00
Yi-Yo Chiang
dcf1c1f462 fs_mgr_overlayfs: Polish fs_mgr_overlayfs_mount_fstab_entry()
* Add logs.
* Append "override_creds=off" overlayfs mount flag only if
  fs_mgr_overlayfs_valid() returns kOverrideCredsRequired.
  Pre-4.6 kernels or kernels without the override_creds patch don't
  need or don't recognize the override_creds mount flag.
  (Background: I832c8ca3fce0269bdef4ce988541adb7ba9662ed)
* mkdir(mount_point) before mount() to ensure the mount point exists.
  This could happen if the mount point is in a tmpfs, such as /mnt.

Bug: 186342252
Test: Boot to normal with overlayfs mount entries in first stage fstab
Change-Id: I1a05696346610d7fd61de6d25c379520fd58ca9b
2021-05-20 06:40:27 +00:00
Yo Chiang
b440fc9c06 Merge "first_stage_mount: Remove "overlay" hack from InitRequiredDevices()" 2021-05-20 06:40:07 +00:00