Commit Graph

52589 Commits

Author SHA1 Message Date
Kiyoung Kim 862c07f22b Add library list for VNDK using core variant
Some device requires VNDK_USING_CORE_VARIANT list, but it was not
implemented in previous. Adding this library list to the build target so
it can be added to system image.

Bug: 141695559
Test: m -j passed & Tested from Cuttlefish
Change-Id: I52750583050401098ca8dacee9cf84e8c5727e36
2019-09-27 14:11:19 +09:00
nelsonli 745a306f71 [vts-core] Add vts_core_meminfo_test to vts-core
Add vts_core_meminfo_test to vts-core suite and transfer to test it
by using base GTest.

Bug: 132702215
Test: atest vts_core_meminfo_test
Change-Id: Ia7924179cde0b79a6787b3533259ea8e90594585
2019-09-27 09:43:51 +08:00
Yifan Hong 3edff134ef Merge "libsnapshot: refactor CreateUpdateSnapshots" 2019-09-27 01:11:22 +00:00
Elliott Hughes 458f221ef1 Merge "debuggerd: increase the default limit on tombstones to 32." 2019-09-27 00:37:21 +00:00
Jim Blackler d2da814d1f lmkd: Maintain pid to taskname mapping to amend kill reports.
Required because the kernel cannot always get the taskname safely at
the time the process is killed (due to competition for mm->mmap_sem).

Test: manually
Bug: 130017100
Signed-off-by: Jim Blackler <jimblackler@google.com>
Change-Id: I27a2c3340da321570f0832d58fe9e79ca031620b
2019-09-26 16:27:03 -07:00
Tom Cherry 9328021ce7 init: add tips for debugging linker errors when launching init services
Test: we can see linker errors in dmesg when following these tips
Change-Id: I86b65e01d06ed7c0b908c4512d55872cd5595eca
2019-09-26 15:24:40 -07:00
Suren Baghdasaryan fc867c9cb1 libmeminfo: Report VMA flags in procmem report
Add VMA flags into procmem report so that we can distinguish different
sections of an executable or a library.

Bug: 138148041
Test: procmem -h <PID>
Change-Id: I062464aa1f1c508bcc8ef05a6d9cfad9a4318d95
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2019-09-26 14:51:40 -07:00
Elliott Hughes ec220cd877 debuggerd: increase the default limit on tombstones to 32.
We're missing useful crashes, especially on hwasan builds.

Bug: http://b/140580637
Test: run crasher
Change-Id: Ib5d8d3bd3fc4d7fec77d0b10302e5595f97a3515
2019-09-26 14:36:01 -07:00
Treehugger Robot f0d17fb50e Merge changes from topic "remove_ashmemd"
* changes:
  libcutils: route to /dev/ashmem<boot_id> instead of ashmemd
  ueventd: duplicate /dev/ashmem
2019-09-26 17:56:53 +00:00
Tom Cherry 3a803eb2d4 Update init/fs_mgr for new logwrapper function
Test: cuttlefish boots, fsck logs seen
Change-Id: Icbc01161b44e097be813f4af648fa671739078b9
2019-09-26 10:29:57 -07:00
Tom Cherry ff7d067ffa logwrap: convert to C++, rename function logwrap_fork_execvp().
Call the function now logwrap_fork_execvp() and fix const correctness
issues, so no longer do callers need to const_cast<> their args.

Test: logwrapper still works
Change-Id: Iea34f5cae90a06a37d395bf9a91e01fb38c35fa6
2019-09-26 10:29:57 -07:00
Colin Cross 2a62d42704 Merge "Use libcrypto_static instead of libcrypto" 2019-09-26 14:32:33 +00:00
Martin Stjernholm 4cbf095493 Merge "Must use libdexfile_support_static in a static executable." 2019-09-26 14:24:46 +00:00
Tom Cherry 7d91385cf5 Merge "logwrapper: open child_ptty in child process and remove ignore_int_quit" 2019-09-26 13:52:25 +00:00
Kiyoung Kim 4b45eab15b Merge "Find or guess installed libraries for VNDK library list" 2019-09-26 00:58:15 +00:00
Hamzeh Zawawy c7ea8817ea Merge "Add fuzzer for libsparse" 2019-09-25 23:56:09 +00:00
Treehugger Robot fb897dc1f5 Merge "logd: remove logd.both test" 2019-09-25 23:16:13 +00:00
Yifan Hong 98aa26fe69 libsnapshot: refactor CreateUpdateSnapshots
This function is too big. Refactor it a bit.

- Reorder checks / variable initializations a bit.
  They are independent of each other, so they can be
  safely reordered.
- Put snapshot creation and initialization to their own
  functions so that CreateUpdateSnapshots looks shorter.

Test: libsnapshot_test
Change-Id: I135b415d8e046dd91d31326fe7962ae44be4ccf8
2019-09-25 15:20:50 -07:00
Yifan Hong ab09a1764b Merge changes Iab867ded,Id37e34b4
* changes:
  libsnapshot: CreateUpdateSnapshots reuse COW space
  libsnapshot: fix tests
2019-09-25 22:19:50 +00:00
Yifan Hong bc71949dd7 Merge "libsnapshot: Fix mocked property fetcher" 2019-09-25 22:19:35 +00:00
Josh Gao 3a22e8cf73 Merge "adb: fragment host linux USB writes when needed." 2019-09-25 21:20:54 +00:00
Tom Cherry bbc489a468 logd: remove logd.both test
This test checks that kernel /dev/log* and logd do not exist and have
content in them simultaneously.  The kernel logger was removed years
ago, so that half of the test is no longer relevant.  Once that half
is removed, this test is essentially "is logd online and does it have
logs", which is already tested for in other tests, so we remove this
on entirely.

Test: logd unit tests
Change-Id: I71dff742f66fc791b7a661a363d4239363140b3f
2019-09-25 14:20:44 -07:00
Treehugger Robot 9e8f01101f Merge "liblp: convert more functions to use string_view (#5)" 2019-09-25 20:49:36 +00:00
hamzeh d17dc6af52 Add fuzzer for libsparse
Bug: 141129284
Test: SANITIZE_TARGET="hwaddress fuzzer' make libsparse_fuzzer
Change-Id: I54e19d399f7ea29a45734f1ddc520ceec56add09
2019-09-25 13:27:52 -07:00
Tom Cherry 013289364e logwrapper: open child_ptty in child process and remove ignore_int_quit
Opening child_ptty before fork() means that the parent process will
use child_ptty as the controlling terminal if it doesn't already have
one.  This is a problem, because when the parent_ptty closes, SIGHUP
will be sent to the parent process, since its controlling terminal has
closed.

It's better to have the child process start its own session and then
open child_ptty as its controlling terminal.  In this case, the child
process will get SIGHUP if the parent process exits, but the parent
process avoids the original issue.

There is a concern that the child_ptty will never be opened and
POLLHUP will never be generated, but there is a work-around in place
with a timeout to handle that extremely rare situation.

Secondly, remove the ignore_int_quit logic.  It is described to
totally ignore these signals, similar to `nohup` which should be
preferred.  However, it regressed shortly after being introduced in
2013 and serves essentially no purpose currently.

Thirdly, add a forward_signals option that does what we should have
done the whole time with signals: it forwards SIGHUP, SIGQUIT, and
SIGINT to the child process and let that process handle them.  This
only needs to be enabled in the `logwrapper` case itself.  Other
processes should not need to change any signals.  This fixes case 3)
below.

Lastly, add O_CLOEXEC where appropriate.

Test: launch process as `adb shell logwrapper yes`
      1) The both processes exit when given SIGINT
      2) The process prints when abbreviated is not enabled
      3) The process does print when abbreviated is enabled;
         this was previously broken
Test: launch process as `adb shell` then `logwrapper yes`
      4) The both processes exit when given SIGINT
      5) The process prints if abbreviated is enabled or not.
      6) Ctrl-c then Ctrl-c again rapidly and observe that the
         logwrapper process is terminated by the second Ctrl-c.
Test: simulate a failure in child() before opening child_tty and
      observe logwrapper and the child exiting appropriately.

Change-Id: Ia76cd17e16535500170d8f5e2183b3bbbf843df7
2019-09-25 12:59:52 -07:00
Treehugger Robot 070c030289 Merge "adb: fix infinite loop when attempting to push to //foo." 2019-09-25 19:59:51 +00:00
Tom Cherry 993d07fc53 Merge changes from topic "boringssl-kmsg"
* changes:
  Redirect boringssl_self_test stdio to kmsg
  init: add stdio_to_kmsg option
2019-09-25 19:56:03 +00:00
Tri Vo 92fd3caff7 libcutils: route to /dev/ashmem<boot_id> instead of ashmemd
Having libcutils ask ashmemd for ashmem fds results in unsatisfactory
performance/memory overhead. Introduce a duplicate of /dev/ashmem and
route to it instead.

Our goal remains as before, namely, use SELinux to phase out usage of
ashmem that doesn't go through libcutils.

Bug: 139855428
Test: boot aosp_crosshatch, browse internet, use camera
Change-Id: I02260a9042acb412571b11f1f4c1d8608483064a
2019-09-25 12:50:16 -07:00
Tri Vo ff89b8d8c2 ueventd: duplicate /dev/ashmem
We want ashmem to only be used via libcutils API, with long-term goal
being deprecation of ashmem with memfd. To do that we route libcutils to
a new source of ashmem fds. We then phase out uses of /dev/ashmem that
doesn't go through libcutils using SELinux.

In Q, we introduced ashmemd as the source of ashmem fds to libcutils.
However, having a separate process and, consequently, binder hops to
handle /dev/ashmem results in performance/memory overhead.

To address the overhead, replace ashmemd with a duplicate of
/dev/ashmem. Name it /dev/ashmem<boot_id>, where boot_id is a random
number generated on each boot. This way we make sure that developers
don't accidentally depend on /dev/ashmem<boot_id>, as that name can't be
hardcoded.

Bug: 139855428
Test: writing "add"/"remove" to /sys/class/misc/ashmem/uevent correctly
adds/removes /dev/ashmem and /dev/ashmem/boot_id
Change-Id: I36d23116048bfcd99903ba46cc133161835a2cfa
2019-09-25 12:49:38 -07:00
Yifan Hong 30bdee9910 libsnapshot: CreateUpdateSnapshots reuse COW space
At the second update for Virtual A/B device,
PartitionCowCreator thinks the COW partitions in
the existing super metadata as occupied. In fact, these
partitions aren't used after the merge.

Now, unmap these partitions from the device mapper. If
something bad happens and the previous update has not been
merged yet, the unmap will fail. Then, delete these old
COW partitions from the device.

Test: Virtual A/B update twice
Bug: 135752105
Change-Id: Iab867ded19755089e6e0800e553a10fbcddbb931
2019-09-25 12:13:17 -07:00
Yifan Hong 3396e9327a libsnapshot: fix tests
- Add TestDeviceInfo(string, string) to avoid holding
the 'rebooted' TestDeviceInfo variable after ownership is
transferred

- OTA client calls BeginUpdate after unmapping partitions.

Test: run libsnapshot_test
Change-Id: Id37e34b421d728eb320c0e0906abef3b61897e7c
2019-09-25 12:13:17 -07:00
Yifan Hong 30adb65103 libsnapshot: Fix mocked property fetcher
Add a new SnapshotTestPropertyFetcher that sets up
good defaults for all test cases in libsnapshot_test.

Test: run libsnapshot_test
Change-Id: I6e0b31872d604bbd5f15b64ab7a8ea56d7c67405
2019-09-25 12:05:53 -07:00
Josh Gao 76b64ba826 adb: fix infinite loop when attempting to push to //foo.
dirname (on glibc, at least) preserves multiple leading slashes, and we
were looping until path != "/", which would lead to an infinite loop
when attempting to push to a path like //data/local/tmp.

Bug: http://b/141311284
Test: python -m unittest test_device.FileOperationsTest.test_push_multiple_slash_root
Change-Id: I182b3e89ef52579c716fdb525e9215f1fe822477
2019-09-26 01:56:58 +08:00
Treehugger Robot e7180a796c Merge "Allow --disable-verification when top-level vbmeta is in 'boot'" 2019-09-25 15:50:05 +00:00
Treehugger Robot b4a65cf1ec Merge "[vts-core] Add vts_core_liblp_test to vts-core" 2019-09-25 05:54:31 +00:00
Treehugger Robot 92a9fbeeb6 Merge "[vts-core] add copy rules for *-gsi.avbpubkey" 2019-09-25 04:54:48 +00:00
Treehugger Robot 5781a185e1 Merge "[vts-core] Add libdm_test in vts-core" 2019-09-25 03:00:50 +00:00
Yifan Hong a1c1eb604d liblp: convert more functions to use string_view (#5)
Test: builds

Change-Id: I59ef370489b36410e3eaf90dc2623efaeefd613b
2019-09-24 19:34:54 -07:00
Kiyoung Kim fce2838611 Find or guess installed libraries for VNDK library list
Current implementation just uses VNDK library list from variable.
However this does not match with expected library name as some libraries
change their names from initial one by appending extra information such
as version. To match this name each libraries should be searched from
installed module list.

Bug: 141584631
Test: m -j passed
Test: Tested from cuttlefish
Change-Id: If9685be59404226de4db16642781546e478694fb
2019-09-25 10:38:56 +09:00
Treehugger Robot 069eae2efa Merge "Update auditParse to not prepend "b/" to bug IDs" 2019-09-24 21:50:58 +00:00
Treehugger Robot 8c055fbe3e Merge "snapshotctl: merge when boot" 2019-09-24 20:13:52 +00:00
Tom Cherry f5e872e9e9 Redirect boringssl_self_test stdio to kmsg
To aid in debugging if there are failures.

Bug: 137267623
Test: add prints to boringssl_self_test and see them
Test: add failure prints to the linker and see them before
      boringssl_self_test runs
Change-Id: I89d50c6a46df994d6ea1fadf00e3a8a796043234
2019-09-24 12:47:14 -07:00
Tom Cherry f74b7f5756 init: add stdio_to_kmsg option
Some services are not native android services and therefore don't log
via the normal mechanisms.  This gives developers an option to have
their stdout/stderr logs sent directly to kmsg.

Test: see test prints to kernel log
Change-Id: I7973ea74d5cab3a90c2cd9a3d5de2266439d0c01
2019-09-24 12:47:14 -07:00
Dan Shi 03ba5b9dfb Merge "Add require_root to adbd_test and libpackagelistparser_test" 2019-09-24 18:30:44 +00:00
Yifan Hong 71667636fb Merge "libsnapshot: add snapshotctl" 2019-09-24 18:06:53 +00:00
Tom Cherry 4356442029 Merge "Uevent: remove useless dir" 2019-09-24 17:42:09 +00:00
Martin Stjernholm 0560d0ef6f Merge "Rename ANDROID_RUNTIME_ROOT to ANDROID_ART_ROOT following APEX module name change." 2019-09-24 17:40:04 +00:00
Martin Stjernholm 2ad47f35a7 Must use libdexfile_support_static in a static executable.
The other one compiles in dlopen() calls that won't work.

Test: Build & boot
Bug: 141485154
Change-Id: I8ab697cfbe41bd21ad47655e47a0218d52738b58
2019-09-24 17:36:30 +01:00
Dan Shi d1360f4412 Add require_root to adbd_test and libpackagelistparser_test
Bug: 141272654
Test: atest
Change-Id: I14e0d3283cba79a2a4e36e1a1274d6921be5b629
2019-09-24 09:13:32 -07:00
Przemyslaw Szczepaniak 5cdf2ef310 Merge "Add libneuralnetworks_packageinfo to neuralnetworks apex dependencies." 2019-09-24 15:08:09 +00:00