Commit graph

67301 commits

Author SHA1 Message Date
Treehugger Robot
d3ba0e28cd Merge "Reland "Create a pool of 20 measurement files per library for coverage."" 2021-01-05 19:16:50 +00:00
Jiyong Park
0f2c5417c3 Merge "init: Sort the list of flattened APEX folders to avoid variations" 2020-12-31 03:51:03 +00:00
Adrian DC
9449583bc3 init: Sort the list of flattened APEX folders to avoid variations
* In 'ActivateFlattenedApexesFrom', the 'readdir' detects
   the APEX folders in a random way that depends on filesystems,
   built packages and order of the build chain

 * In normal cases, this is not an issue, however when building
   with Go configurations, we have a case where the package
   'com.android.tethering.inprocess' is built along the
   'com.android.tethering' overriden binary, and depending on
   the 'readdir' output, the mounts break the Tethering service

Change-Id: I8ac4a0284d8d885f732c71e846933869cf16a0bd
Signed-off-by: Adrian DC <radian.dc@gmail.com>
2020-12-30 22:41:33 +01:00
Treehugger Robot
da1264206c Merge "snapuserd: Enable in recovery." 2020-12-30 08:27:43 +00:00
Jaegeuk Kim
8e944335a4 Merge "fastboot: f2fs: handle return code correctly" 2020-12-30 02:54:32 +00:00
Daniel Rosenberg
ff5f4cc734 Merge "libsnapshot: Add decompression check to Inspect_Cow" 2020-12-30 00:04:04 +00:00
Jaegeuk Kim
58d10c209a fastboot: f2fs: handle return code correctly
The f2fs shares the fsck return code for sload.f2fs, since it calls fsck after
loading files.

enum {
	FSCK_SUCCESS                 = 0,
	FSCK_ERROR_CORRECTED         = 1 << 0,
	FSCK_SYSTEM_SHOULD_REBOOT    = 1 << 1,
	FSCK_ERRORS_LEFT_UNCORRECTED = 1 << 2,
	FSCK_OPERATIONAL_ERROR       = 1 << 3,
	FSCK_USAGE_OR_SYNTAX_ERROR   = 1 << 4,
	FSCK_USER_CANCELLED          = 1 << 5,
	FSCK_SHARED_LIB_ERROR        = 1 << 7,
};

Bug: 176471360
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Change-Id: I06289670834f29a59e704e772791f12328a073f8
2020-12-29 19:56:36 +00:00
Daniel Rosenberg
71a642689c libsnapshot: Add decompression check to Inspect_Cow
This adds the -d option to Inspect_Cow, which will cause it to attempt
to decompress all data blocks, reporting any errors it encounters.
Useful for detecting corruption in Cow files.

Bug: 172026020
Test: Inspect_Cow -d [cow_file]
Change-Id: Iebf5f7f485b33b36daab4ab07005ca37e51d692f
2020-12-28 18:20:19 -08:00
Daniel Rosenberg
53296d800b Merge "libsnapshot: Add cluster breaks after ops" 2020-12-29 02:14:57 +00:00
Treehugger Robot
8a573b4d9e Merge "init.rc: start tombstoned before switching mount namespace" 2020-12-28 23:11:53 +00:00
Remi NGUYEN VAN
f3f83ace67 Merge "Add apex_available to libnetutils" 2020-12-24 01:46:30 +00:00
Daniel Rosenberg
770099bde1 libsnapshot: Add cluster breaks after ops
Previously, we'd check if a new cluster was needed before we added a Cow
Operation. This would cause an op's associated data to go to the wrong
location, so instead we check if we'll need a new cluster after writing
each op.

Bug: 172026020
Test: cow_api_test (ClusterCompressGz)
Change-Id: Ia43afedcfd430961b34f5914da4265b89e6fadb9
2020-12-22 21:43:26 -08:00
Treehugger Robot
292fd5458d Merge "trusty: Add vendor variant of libtrusty_coverage" 2020-12-23 00:02:57 +00:00
Stephen Crane
c602562bb2 trusty: Add vendor variant of libtrusty_coverage
We want to add coverage statistics to the trusty-ut-ctrl tool, which is
a vendor binary. Thus we need a vendor variant of libtrusty_coverage.
Merges system libtrusty_test and vendor libtrusty into a single
vendor_available library so that we can add vendor_available to
libtrusty_coverage and make it accessible from vendor tools.

Bug: 175221942
Test: make libtrusty_coverage
Change-Id: I68cc8f1c1580bda8591dbe744e9751474811576d
2020-12-22 22:39:40 +00:00
Bernie Innocenti
bc053268cf Merge "Add explicit Result::ok() checks where needed" 2020-12-21 18:31:58 +00:00
Bernie Innocenti
062ef5356d Add explicit Result::ok() checks where needed
Test: m checkbuild continuous_instrumentation_tests continuous_instrumentation_tests_api_coverage continuous_native_tests device-tests platform_tests
Exempt-From-Owner-Approval: mechanical mass refactoring
Change-Id: I8d40b1e3cb5d2f76baf77b8a190df4366909f7b6
2020-12-20 17:06:17 +00:00
Bernie Innocenti
989efb67e3 Merge "Add explicit Result::has_value() checks where needed" 2020-12-20 07:36:38 +00:00
Bernie Innocenti
62ba2b11b1 Add explicit Result::has_value() checks where needed
Test: m checkbuild continuous_instrumentation_tests continuous_instrumentation_tests_api_coverage continuous_native_tests device-tests platform_tests
Change-Id: Ifd5dcda48e370d750e243d427e68a77dce333951
2020-12-19 21:17:16 +09:00
Kevin Brodsky
13d86ad6bf init.rc: start tombstoned before switching mount namespace
Unlike apexd, tombstoned uses the regular dynamic linker path
(/system/bin/linker64). As a result, starting it after we have
switched to the default mount namespace but before APEXes have been
activated fails, because /system/bin/linker64 does not exist between
those two events. Fix that by starting tombstoned even earlier,
before we have switched mount namespace.

To avoid reintroducing the bug fixed by 2c9c8eb5ff ("init.rc:
create /data/vendor* earlier"), also make sure that /data/vendor* is
still created before /data/vendor/tombstones.

While at it, move the creation of /data/anr before starting
tombstoned, because tombstoned assumes that /data/anr exists.

Fixes: 81c94cdce6 ("Start tombstoned early in post-fs-data.")
Test: boot fvp-eng and fvp_mini-eng, check that tombstoned starts
      succesfully on the first attempt
Change-Id: Ic52383c35fb39c61c2f0e0665fd10e795895d50d
2020-12-17 16:09:36 +00:00
Pirama Arumuga Nainar
4fc933cca4 Reland "Create a pool of 20 measurement files per library for coverage."
This reverts commit 0c4fb3dd4b.

Reason for revert: Permissions issue in b/173448692 are fixed.

Change-Id: Ic0382484c8e46470b4d7986681229fef0f0dcdfc
2020-12-17 01:43:07 +00:00
Treehugger Robot
cf110de8d2 Merge "ueventd: Fix property variable for ro.hardware in ueventd.rc" 2020-12-16 13:38:48 +00:00
Youkichi Hosoi
63fdd1ba24 ueventd: Fix property variable for ro.hardware in ueventd.rc
Property variables should be written ${x.y} to be expanded.

Bug: 175645356
Test: The property ro.hardware is expanded properly.
Change-Id: Idf7ff7ecc002e6e4de4ccef70e89dcc1c10e63d0
2020-12-16 15:54:15 +09:00
David Anderson
ce066ba5d1 snapuserd: Enable in recovery.
Bug: N/A
Test: snapuserd.recovery builds
Change-Id: Ibc1bbdda9bfe6c70ca6fe47bfd0140c263db9515
2020-12-15 13:09:04 -08:00
David Anderson
819ca32a0a Merge changes from topic "snapuserd-gflags"
* changes:
  snapuserd: Add a no-socket mode.
  snapuserd: Use gflags for arguments.
2020-12-15 21:05:24 +00:00
Tri Vo
56bcb02b6e Merge "trusty: Retrieve coverage PCs from coverage record" 2020-12-15 20:15:08 +00:00
Christopher Ferris
2047676149 Merge "Update for v5.10 kernel headers." 2020-12-15 19:40:15 +00:00
Colin Cross
a93ec546aa Merge "Use libchrome as a shared library" 2020-12-15 18:40:55 +00:00
Treehugger Robot
0b8d2fef69 Merge "init: don't generate tombstones for expected test failures" 2020-12-15 18:22:09 +00:00
Tom Cherry
94b1c57d93 init: don't generate tombstones for expected test failures
The firmware_handler.HandleAbort and subcontext.RecoverAfterAbort
tests intentionally abort in the child process to ensure that
ueventd/init can recover if their child processes die.  This generates
a tombstone which causes confusion.  This change resets SIGABRT to
SIG_DFL right before the abort(), so that the child processes will
exit normally without generating a tombstone or writing a crash to
logcat.

Bug: 169771958
Bug: 175383788
Test: run the above tests and verify no stack traces are printed to
      logcat and no tombstones are generated.
Change-Id: Ica09548d1c7a766bf5d9ff2e26c9fd558e85c7c1
2020-12-15 06:38:55 -08:00
Nikita Ioffe
356b184468 Merge "Log start of the test to logcat" 2020-12-15 12:21:46 +00:00
Christopher Ferris
6ddc2c56c9 Update for v5.10 kernel headers.
Test: Builds.
Change-Id: I6c4b04751df026ef7cbb91627174188c5e6d137c
2020-12-14 22:36:37 -08:00
Treehugger Robot
5fa4d4cc44 Merge changes from topic "dma-buf-heap-system-uncached"
* changes:
  ueventd.rc: Add /dev/dma_heap/system-uncached permissions
  ueventd.rc: Reduce permissions for /dev/dma_heap/system to 444
2020-12-15 06:16:50 +00:00
Stephen Crane
e962930d19 trusty: Retrieve coverage PCs from coverage record
Adds the ability to retrieve and save program counter information from
the trusty coverage record data. PC information is saved to a .sancov
file, parseable by the LLVM sancov tool. Sancov can then symbolize and
display this coverage information for consumption by humans.

Adds a sancov dump to the libtrusty_coverage_test for testing.

Bug: 175221942
Test: atest libtrusty_coverage_test
Test: Retrieve sancov file and manually symbolize with sancov
Change-Id: I342ea2ca9abb87986b2904ff69415544ee6070fc
2020-12-14 22:06:13 -08:00
Treehugger Robot
f101219263 Merge "libsnapshot: Remove misleading message" 2020-12-15 04:47:25 +00:00
Treehugger Robot
00ed8bdddb Merge "Update message versionioning system" 2020-12-15 01:25:12 +00:00
Daniel Rosenberg
28b73f8472 libsnapshot: Remove misleading message
If we read up to a label, this error message is unneeded, and if we
don't, we already return an error message before this, leaving the old
message as entirely redundant and misleading.

Test: Run, verify "No COW Footer, recovered data" does not show in logs
Bug: 172026020
Change-Id: I31d054ccf898cf93c71ff201f0868e57cd1a6135
2020-12-14 17:12:07 -08:00
John Stultz
efb6e07e0a ueventd.rc: Add /dev/dma_heap/system-uncached permissions
Add permissions for dev/dma_heap/system-uncached dmabuf heap.

This should match the dmabuf system heap.

Signed-off-by: John Stultz <john.stultz@linaro.org>
Change-Id: I9253d56c72d45e228539f709e76ba0862ae03d96
2020-12-14 23:29:55 +00:00
John Stultz
dc01a02a1a ueventd.rc: Reduce permissions for /dev/dma_heap/system to 444
Jeffrey Vander Stoep noted the permissions for the system dmabuf
heap should be 444 instead of 666, as we only need to open and
call ioctl on the device.

Signed-off-by: John Stultz <john.stultz@linaro.org>
Change-Id: I650c9fabfffd1eac5f59bbc7fa1e0ae1f5646bd9
2020-12-14 23:29:35 +00:00
Tri Vo
5a611cb834 Merge "trusty: fuzz: Link libtrusty_test statically" 2020-12-14 20:39:09 +00:00
David Anderson
81e163fc55 Merge "libsnapshot: Don't export snapuserd server includes." 2020-12-14 18:47:19 +00:00
David Anderson
a056eca5ba snapuserd: Add a no-socket mode.
In first-stage init, during the selinux transition, no socket is needed.
It's even advantageous not to create one, since it greatly reduces the
amount of avc audits. This patch allows starting snapuserd with a preset
list of socket commands that it can run on startup.

Bug: 173476209
Test: manual test
Change-Id: I758d99097372e4dffb252e2836fd859b7fed162a
2020-12-14 00:48:50 -08:00
David Anderson
4e67f589de snapuserd: Use gflags for arguments.
This is in preparation for expanding the command-line features of
snapuserd.

Bug: N/A
Test: builds
Change-Id: Id33c4f190dc0f99cd436f0e9a6b1d6ee92e245e4
2020-12-14 00:42:25 -08:00
David Anderson
42a04ac3b4 libsnapshot: Don't export snapuserd server includes.
Also, move main() to snapuserd_daemon.cpp.

Bug: N/A
Test: builds
Change-Id: Iddeec5785450caa59a7e55daaa63b4584087392e
2020-12-14 00:41:18 -08:00
Shawn Willden
4f45dc3a7e Update message versionioning system
Bug: 171845787
Test: Build
Change-Id: Ie769113070a8a755a268f65e36384fe333c798b6
2020-12-13 10:56:50 -07:00
Wenhao Wang
75e5fc4361 Merge "trusty: Add ExtraCounters to Confirmationui Fuzzer" 2020-12-12 00:46:04 +00:00
Treehugger Robot
e107d445f6 Merge "Add new owners to various sub-projects." 2020-12-11 22:59:43 +00:00
Tri Vo
cafdd7c335 trusty: fuzz: Link libtrusty_test statically
Simplifies development flow because libtrusty_test.so doesn't need to be
pushed with the fuzzer.

Bug: 171750250
Test: m trusty_gatekeeper_fuzzer && adb sync data && \
adb shell /data/fuzz/arm64/trusty_gatekeeper_fuzzer/trusty_gatekeeper_fuzzer
Change-Id: I7c83b5784ede4881dcd9c2dd33c97bf49fcde6ff

Change-Id: Iba60f03000bfca15b00e484ef3a168604c65554a
2020-12-11 13:19:55 -08:00
Elliott Hughes
21de4e727e Add new owners to various sub-projects.
Test: treehugger
Change-Id: Ia2a99c0499633ccc5d23c37a1ec93867c876d637
2020-12-11 12:45:45 -08:00
Wenhao Wang
bf40c084cc trusty: Add ExtraCounters to Confirmationui Fuzzer
Add ExtraCounters to Confirmationui fuzzer so that the fuzzer can
grab the coverage information of the Confirmationui TA.

Bug: 174402999
Bug: 171750250
Test: /data/fuzz/arm64/trusty_confirmationui_fuzzer/trusty_confirmationui_fuzzer
Change-Id: I2e287281e7c8100f0d48413fbe0ff99d397a74c1
2020-12-11 10:56:40 -08:00
Nikita Ioffe
9e4b111a33 Log start of the test to logcat
This makes it easier to associate logs written during the test with the
test case that was running.

Test: atest CtsInitTestCases
Change-Id: I832f1c9ba8358341c934fdd91a65f5739bc98e37
2020-12-11 18:00:45 +00:00