Commit graph

68724 commits

Author SHA1 Message Date
Peter Collingbourne
93406da189 Merge "Run MTE tests on zero-sized allocations." 2021-05-14 03:58:13 +00:00
Treehugger Robot
a9d1799d3f Merge "Add missing //apex_available:platform to debuggerd" 2021-05-14 01:34:03 +00:00
David Anderson
9ac43f5421 Merge "libsnapshot: Move ImageManager creation to DeviceInfo." 2021-05-14 00:12:41 +00:00
Peter Collingbourne
aa544796ae Run MTE tests on zero-sized allocations.
Bug: 187879470
Change-Id: I9547f3032af9d1a921f8597a53389d25af33b369
2021-05-13 14:08:41 -07:00
Elliott Hughes
e9c7c5c80c Merge "Remove String16::remove." 2021-05-13 19:04:33 +00:00
David Anderson
b2ee4c14c9 libsnapshot: Move ImageManager creation to DeviceInfo.
This refactoring moves ImageManager creation out of SnapshotManager,
where it had always been rather awkward, and into IDeviceInfo so it can
participate in dependency injection.

The "first-stage init" state is now part of IDeviceInfo as well.

Bug: 187396878
Test: vts_libsnapshot_test
      libsnapshot_fuzzer_test
Change-Id: Ic4b3e93527cc074ec18c0c26440dbdb2504d0d5e
2021-05-13 11:33:38 -07:00
David Srbecky
1cbdc2a530 Merge "Update API of MapInfo from libunwindstack" 2021-05-13 09:49:52 +00:00
Peter Collingbourne
fc7852b741 Merge "Test that out-of-bounds UAF is not detected with MTE." 2021-05-13 02:53:23 +00:00
David Srbecky
d8ab48b4db Update API of MapInfo from libunwindstack
Use accessors to for all the fields.

Test: build
Change-Id: I68d149d914d4a4b088aaf822fe222a5d9e56ae80
2021-05-13 01:51:58 +01:00
Peter Collingbourne
dc47634ec4 Test that out-of-bounds UAF is not detected with MTE.
This type of error is unlikely and attempting to detect it with MTE
is likely to produce false positive reports. Make sure that this type
of error is not detected by the allocator.

Change-Id: I90676d1a031411d6b725890311317802bc24b459
2021-05-12 15:56:43 -07:00
Elliott Hughes
2cf0411910 Remove String16::remove.
This function, ironically, is being removed.

Even more amusing, it was never "remove" anyway --- it literally did
the opposite, and removed everything *except* the range you passed to
it, and should probably have been called "keep"!

I'm looking at reimplementing much of libutils, but first I'm improving
test coverage, and literally every test I wrote for this failed. And
then when I fixed the "obvious bugs" in the implementation, I found
there actually were a couple of existing unit tests --- that mostly
served to demonstrate just how counter-intuitive this function was.

Bug: http://b/156999009
Test: treehugger
Change-Id: I41fd85f7c0988070f4039f607d2e57523d862ed9
2021-05-12 20:24:26 +00:00
Akilesh Kailash
fcd105d5dd Merge "snapuserd: Remove assertions from daemon" 2021-05-12 18:04:22 +00:00
Akilesh Kailash
2a89cf82fa snapuserd: Remove assertions from daemon
Assertions in daemon will terminate the daemon.
This can bring the entire device to halt as the mount partitions
are mounted of snapshot devices and IO's will be hung in
"D" (uninterruptible state) eventually leading to sysrq crash.

Convert the relevant assertions into appropriate error codes and
propagate the error code back to dm-user.
IO will eventually fail but should not impact the overall usage of the device.

Bug: 187903835
Test: vts_libsnapshot, cow_snapuserd_test, full OTA
Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: Iaf093898837d2aff5703ea1e615aecf7c1e53a8f
2021-05-12 17:31:38 +00:00
Paul Duffin
69caa70145 Add missing //apex_available:platform to debuggerd
This does not currently cause any problems but it does block progress
on the referenced bugs.

Bug: 187910671
Bug: 187914588
Test: m droid
Change-Id: I977cd842101187441ddbc873eac25598295aab06
2021-05-12 11:22:55 +01:00
Treehugger Robot
0839837fa4 Merge "libutils: remove the unused StopWatch lap functionality." 2021-05-12 01:38:10 +00:00
Elliott Hughes
afa6e9fc04 libutils: remove the unused StopWatch lap functionality.
It's not tested, and it's not used. Also remove the fuzzer which is just
wasting CPU cycles.

This gets us to 100% function coverage, 100% line coverage, and N/A
branch coverage for StopWatch.

Test: treehugger
Change-Id: Ib5e08510ef1046a6f2af3f0b8a1c317a8bb39fd4
2021-05-11 16:33:47 -07:00
Treehugger Robot
c85c9ee4e6 Merge "libutils: remove obsolete README." 2021-05-11 20:56:19 +00:00
Elliott Hughes
af021e87a6 libutils: remove obsolete README.
This dates from when libutils was still part of frameworks, and talks
about stuff that *didn't* move out of frameworks.

Test: treehugger
Change-Id: Icf22eebc417bcb37abdbfdc89e9a3f14894e18c2
2021-05-11 12:01:26 -07:00
Treehugger Robot
661c65dc07 Merge "Fix CtsFsMgrTestCases failures" 2021-05-11 07:13:17 +00:00
Yi-Yo Chiang
e3cbb0a9eb Fix CtsFsMgrTestCases failures
fs_mgr flags "slotselect" and "slotselect_other" are specific to A/B
devices, so remove these options from testcases because
CtsFsMgrTestCases could be ran on a non-A/B device.

Fixes: 187759127
Fixes: 187427233
Test: atest CtsFsMgrTestCases on sdk_phone64_x86_64-userdebug
Change-Id: I31c1429652629bb68e0ca504295c959ac7e013e2
2021-05-11 07:12:22 +00:00
Tianjie Xu
023ac49db2 Merge "Add a unittest for fingerprint calculation" 2021-05-11 06:08:53 +00:00
Akilesh Kailash
0efd6c2a4c Merge "snapuserd: Fix merging of overlapping copy blocks" 2021-05-10 20:01:13 +00:00
Tianjie
69e880e257 Add a unittest for fingerprint calculation
Add a test to check the build fingerprint when the dynamic build
id is in use.

Bug: 186786987
Test: th
Change-Id: I44d6be0c18552f319bcb8d19cca5659ce580d26c
2021-05-10 12:11:28 -07:00
Akilesh Kailash
9ea1acb847 snapuserd: Fix merging of overlapping copy blocks
As part of r.android.com/c/1678745/7, overlapping
copy operations was allowed to batch merge which
is not right. The intention of that CL was
to avoid un-necessary write traffic involved
in flushing data to scratch space. However,
as part of the optimization, copy operations
were merged. More specifically, the problem
comes into play when the number of overlapping
copy operations is more than the read-ahead
window size (2MB).

I have added a new test case to test this
specific code path to avoid future regressions.

Additionally, remove un-necessary "send()"
as part of "detach" response from snapuserd server.
Client is not waiting for any response. It
just creates a race window which is harmless
but error log will be misleading.

Bug: 187506548
Test: cow_snapuserd which tests the similar
configuration as seen in the COW file in the bug
report.
Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: Ic0f1ddd390f79966aabfbeadb7d64bc5bb86e83b
2021-05-10 08:32:06 +00:00
Tianjie Xu
57b9a5370e Merge "Support appending vbmeta digest to id/fingerprint" 2021-05-08 22:56:56 +00:00
Treehugger Robot
61668cf10f Merge "fs_avb_test_util: adding logs for debugging" 2021-05-08 04:18:24 +00:00
Bowgo Tsai
314d344736 fs_avb_test_util: adding logs for debugging
Bug: 187303962
Test: atest libfs_avb_internal_test
Change-Id: I793d36a05657e661b3dfebc4eb609dde2a7fd3e6
2021-05-07 16:53:04 +08:00
Tianjie
becfa77e5d Support appending vbmeta digest to id/fingerprint
Background in http://go/compatible-build-fingerprint. To uniquely
identify the mixed build, we plan to append the unique vbmeta digest
to ro.build.id.

If BOARD_USE_VBMETA_DIGTEST_IN_FINGERPRINT is true, the build system
will not set ro.build.id. Instead, init will set it at runtime, by
appending the digest to the legacy build id.

Bug: 186786987
Test: build and boot a device with new build id
Change-Id: Idea57df599bfd6eede760671e2555541f7dc3f21
2021-05-06 22:31:54 +00:00
Roman Kiryanov
8371ec25ab Merge "Remove the tech debt from the property_service" 2021-05-06 20:53:39 +00:00
Roman Kiryanov
2d1a401b6e Remove the tech debt from the property_service
emulator migrated to bootconfig, we don't use
the kernel command line to pass userspace properties.

Bug: 182291166
Test: boot
Signed-off-by: Roman Kiryanov <rkir@google.com>
Change-Id: Iff2f627aec64b7ba2240444639acedc76a1aa806
2021-05-06 11:55:29 -07:00
David Anderson
cedb057e2b Merge changes Ibffdd9c9,Ief5a16d1
* changes:
  libsnapshot: Add a test case for unexpected snapshots during data resets.
  libfiemap: Add some dependency injection.
2021-05-06 17:57:46 +00:00
David Anderson
53dfaceac4 Merge "Add cow_api_test to presubmit." 2021-05-06 17:36:27 +00:00
Treehugger Robot
b212a33c58 Merge "Link libcrypto in host unit tests for libavb" 2021-05-06 14:49:35 +00:00
Treehugger Robot
0d712ad3a2 Merge "Revert "init: adding fallback paths for debug ramdisk"" 2021-05-06 07:05:41 +00:00
Yo Chiang
d7115b8463 Merge "Rename system/cote/cpio/ -> system/core/mkbootfs/" 2021-05-06 06:43:37 +00:00
David Anderson
7cdbd8e64d Merge "OverlayFS support for fstab" 2021-05-06 01:28:52 +00:00
David Anderson
cbf8420b2a Add cow_api_test to presubmit.
These are unit tests for important VAB functionality. They are very
quick to run and should be included in presubmit testing.

Bug: N/A
Test: th green
Change-Id: I02e24c76df365e9fb2d68f904e930dce60b9bdaf
2021-05-05 15:29:35 -07:00
David Anderson
a06eac491c Merge "Ensure vts_libsnapshot_test will pass after being interrupted." 2021-05-05 22:22:33 +00:00
David Ng
d926aded73 OverlayFS support for fstab
Add overlayfs (lowerdir) mount entry support to fstab.

  overlay  <final dir>  overlay lowerdir=/1:/2

E.g.
  overlay /vendor overlay lowerdir=/odm/vnd_ovl1/1:/odm/vnd_ovl2

Test: Ensure mounting with fstab overlayfs entry
Change-Id: Ib025e203f8ac1836ab62dfa96fb14e8e108f82fb
2021-05-05 09:30:18 -07:00
Martin Stjernholm
7b5e682da1 Merge "Require libjdwp from the ART APEX." 2021-05-05 14:30:50 +00:00
Mohammad Islam
a2de531f2c Merge "Add execute permission to /data/apex/decompressed directory" 2021-05-05 12:31:43 +00:00
Yi-Yo Chiang
3987c0663a Rename system/cote/cpio/ -> system/core/mkbootfs/
Test: Presubmit
Change-Id: I1a55ce97817ebb3d7a7e97cb7a41ba61cbe878e3
2021-05-05 19:03:36 +08:00
Bowgo Tsai
26c1b74998 Revert "init: adding fallback paths for debug ramdisk"
This reverts commit 6cb4311f4d.

Reason for revert: no need to keep the compatibility now

Bug: 186485355
Change-Id: Iffdf3abebc17f32e36f3b3fe2b4f9c2592da9653
Test: TreeHugger
2021-05-05 10:31:29 +00:00
David Anderson
1de6c16ad7 Ensure vts_libsnapshot_test will pass after being interrupted.
We try to clean up previous test runs, but this can crash since we
haven't opened fake-super yet. Refactor the harness so we always open
fake-super if it exists. If it does, we'll delete and recreate it after
cleanup. If it doesn't, we'll create it immediately.

It's still possible that cleanup can fail: If interrupted during a merge,
libsnapshot does not allow cleanup until the merge completes. The test
harness doesn't bother handling this case yet.

Bug: 187151854
Test: vts_libsnapshot_test, ctrl+c, run again
Change-Id: I58a7094336a391cff493a31e4f80d8c8b1b166f8
2021-05-04 22:21:08 -07:00
David Anderson
6939583deb Merge "init: Add tests and document the new fnmatch behavior in ExternalFirmwareHandler." 2021-05-05 00:21:34 +00:00
Steven Moreland
1c65d40154 Merge "libutils: LightRefBase: incStrongRequireStrong" 2021-05-04 23:52:12 +00:00
Christopher Ferris
24b15570b1 Merge "Re-add backtrace note about unreadable elf." 2021-05-04 21:44:53 +00:00
Steven Moreland
c2dc7cd31c libutils: LightRefBase: incStrongRequireStrong
Allow LightRefBase to be used with
ANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION, mainly for
libhwui.

Bug: N/A
Test: libutils_test
Change-Id: I251c874a80f0a069572bc51da45f8f8e74ba6f5b
2021-05-04 21:42:26 +00:00
Eric Biggers
890fd0c239 Merge "init: make reboot_on_failure not apply to manually stopped services" 2021-05-04 21:06:12 +00:00
Treehugger Robot
f737614ce9 Merge "Add a small testcase for snapshot writer." 2021-05-04 19:37:19 +00:00