Commit graph

43897 commits

Author SHA1 Message Date
Matthew Maurer
1f9461786e Merge "trusty: Add trusty unittest control utility" 2019-01-05 04:23:25 +00:00
Treehugger Robot
70718dba91 Merge "llkd: enhance list properties" 2019-01-05 03:11:50 +00:00
Tom Cherry
9a9a4ad84c Merge "ueventd: create a /dev/block/by-name/ symlink without a partition name" 2019-01-05 01:06:16 +00:00
Yifan Hong
ea1c779067 Add none to supported fs type
Test: mount sdcard in recovery on cuttlefish
Change-Id: I23b0ce418f8240cfdaa2d560678989067d746de6
2019-01-04 15:28:30 -08:00
David Anderson
dbce5856d5 Merge "liblp: Allow GSI metadata to bypass slot suffixing checks." 2019-01-04 23:03:37 +00:00
David Anderson
c80c6ac9dd Merge "liblp: Add API for adding predetermined linear extents to partitions" 2019-01-04 23:03:10 +00:00
Josh Gao
4175cee3cc debuggerd_client: resolve tid to tgid when dumping Java stacks.
Bug: http://b/121438213
Test: debuggerd_test32
Test: debuggerd_test64
Change-Id: I4d114c8b0c4586ba64de5b45b47b0ec5c10354f8
2019-01-04 13:57:09 -08:00
Treehugger Robot
b815e6ccd4 Merge "llkd: check stack for wait_on_page_bit_killable" 2019-01-04 21:55:15 +00:00
Treehugger Robot
3cd02e8908 Merge "llkd: report stack signature matched" 2019-01-04 21:54:53 +00:00
Mark Salyzyn
da2aeb0c42 llkd: handle 'adbd shell setsid' to preserve adbd
A zombie setsid process occurs when adb shell setsid <command> is
issued, however llkd can only detect if it is a result of a kernel
livelock by killing the associated parent, which would be adbd;
resulting in the adb connection(s) being terminated.  Will special
case this condition in order to preserve adbd for debugging purposes.

We parse <parent>&<child> in ro.llk.blacklist.parent as this
association, thus adbd&[setsid] covers this special case.
Ampersand was selected because it is never part of a process name,
however a setprop in the shell requires it to be escaped or quoted;
init rc file where this is normally specified does not have issue.

getComm() is effectively pure, so hold on to the return value for
sake of efficiency.

This also reverts commit 599958d114
which granted adbd blanket parent immunity from monitoring on
userdebug builds.  The new logic is a more refined means of
preserving the live lock checking associated with adbd and allows
the operation to be performed on user builds.

POC: date ; adb shell setsid sleep 900 ; date
Positive for bug, reports less than 15 minutes, otherwise solved.

Test: llkd_unit_test
Bug: 120983740
Change-Id: I6442463a48499d925a3a074423a24a1622905559
2019-01-04 13:49:48 -08:00
Michael Ryleev
129fadf051 trusty: Add trusty unittest control utility
It is designed to connect to user specified port and
implements unittest logging protocol supported by
typical unittest ap running on Trusty side.

Test: manual
Change-Id: I6e37ccee9b9e4dde563ef0e4f531b42091cc2bd8
2019-01-04 11:54:26 -08:00
Mark Salyzyn
8a5f081763 llkd: enhance list properties
Because of the limited length of properties, and to ease the
complexity of product and vendor adjustments, the comma separated
list properties will use a leading comma to preserve the defaults
and add or subtract entries with + and - prefixes respectively.

Without the leading comma, the list is explicitly specified as before.

Cleanup:
- use empty() instead of space() == 0 (or converse if != 0)
- if (unlikely) pprocp can not be allocated, to a to_string(ppid) check

For testing, observe before and after llkd_unit_test below to
confirm leading comma effects for example:

livelock: ro.llk.stack=wait_on_page_bit_killable,bit_wait_io,\
                       __get_user_pages,cma_alloc
livelock: ro.llk.stack=...,SyS_openat,...

Test: llkd_unit_test
Bug: 120983740
Change-Id: Ia3d164c2fdac5295a474c6c1294a34e4ae9d0b61
2019-01-04 11:43:15 -08:00
Mark Salyzyn
b658ffa2f3 llkd: check stack for wait_on_page_bit_killable
User process in S state blocked by deadlock in I/O system

wait_on_page_bit is covered by regular D state tracking.

Bug: 120776455
Test: long term stability on multiple devices
Change-Id: Icdb99b8095f384cb440f0f2bdeba86c5991b9ef4
2019-01-04 10:46:05 -08:00
Mark Salyzyn
22e05fb5a4 llkd: report stack signature matched
Adjusted debugging messaging to add clarity.  Report _which_ stack
signature matched that triggered the kernel panic.  Reduce the noise
associated with missing /stack to VERBOSE as that is for development
debugging only.

Test: observe during unit test we see something like following logs:

livelock: Found SyS_openat in stack for pid XXX
livelock: S 120.000s XXX->YYY port-bridge [kill]
livelock: Killing '/vendor/bin/port-bridge' (XXX) to check forward\
          scheduling progress in S state for\
          '/vendor/bin/port-bridge' (YYY)
. . .
livelock: Found SyS_openat in stack for pid XXXXX
livelock: S 120.000s XXXXX->XXXXX llkd_unit_test [kill]
livelock: Killing '/data/nativetest64/llkd_unit_test/llkd_unit_test\
          (XXXXX) to check forward scheduling progress in S state

Test: llkd_unit_test
Bug: 33808187
Change-Id: Ifac7dd9a656208563bb20e28739abb741358d964
2019-01-04 10:46:05 -08:00
Jim Blackler
1417cdbddb Add start time to LmkKillOccurred
This is to measure an application's behavior with respect to being LMKed
(the longer an app lives before being LMKed, the better).

Bug: 119854389
Test: Manual
Change-Id: I4ef6433391c8758626334731d2b5de038e4468ae
Merged-In: I4ef6433391c8758626334731d2b5de038e4468ae
(cherry picked from I4ef6433391c8758626334731d2b5de038e4468ae)
2019-01-04 11:36:54 +00:00
David Anderson
126e481972 liblp: Allow GSI metadata to bypass slot suffixing checks.
Bug: 121210348
Test: manual test
Change-Id: I40634c72b0255197a5c16e23553f4cf54bc32579
2019-01-03 18:19:43 -08:00
David Anderson
189727089e liblp: Add API for adding predetermined linear extents to partitions
Bug: 121210348
Test: manual test
Change-Id: Ie9af456d5193e962a3bcf0cc5dcd22e794d143f6
2019-01-03 18:18:45 -08:00
Felix
fb55955462 health: Add CAP_WAKE_ALARM to service via init
platform/interfaces/health/2.0/default/healthd_common.cpp wants to use
timerfd_create() to register a wakealarm.

To use the timerfd_create() syscall with CLOCK_BOOTTIME_ALARM,
CAP_WAKE_ALARM is needed.

Since the .rc file for android.hardware.health@2.0 is shipped here in
system/core, update it here.

Signed-off-by: Felix <google@ix5.org>
Change-Id: I6cd5701b6e5cac37eb021d894251a3a9dc590b95
2019-01-04 02:24:41 +01:00
Treehugger Robot
1476931e02 Merge "CallStack: include prefix/tag when unlinked" 2019-01-04 00:45:38 +00:00
Steven Moreland
8338072591 CallStack: include prefix/tag when unlinked
Bug: N/A
Test: manual
Change-Id: I8f7a19744af938a02d876ab81c1dafee04744f96
2019-01-03 10:17:07 -08:00
Sandeep Patil
ac535f9713 Merge "fiemap_writer: First cut implementation with write() support." 2019-01-03 15:56:15 +00:00
Bowgo Tsai
b92fc1f423 fs_mgr_avb: introducing class VBMetaData
Currently vbmeta images are stored in AvbSlotVerifyData defined in
libavb, which contains some fields that isn't needed by fs_mgr.
e.g., loaded_partition, rollback_indexes. Adding a new class VBMetaData
to replace it.

Bug: 112103720
Bug: 117960205
Test: boot crosshatch
Change-Id: I480461dad3c6aca7e028097662a3b06c3aa6646d
2019-01-03 18:17:56 +08:00
Josh Gao
f0ea1e6e5d libutils: use libbase_headers instead of libbase.
Bug: http://b/121391019
Test: treehugger
Change-Id: I0e5d218b9afe6f832cc6bd0ef78bc1a5581f3e2f
2019-01-02 14:31:26 -08:00
Bowgo Tsai
583540330c Adding libfs_avb unittest framework
This commit adds the fundamental test framework for the upcoming
changes in libfs_avb. It replies on 'avbtool' to append AVB
metadata and then extracts the vbmeta content into an internal
|vbmeta_images_| variable for comparison later.

Bug: 117960205
Test: m libfs_avb_host_unittest
Test: ./out/host/linux-x86/nativetest/libfs_avb_host_unittest/libfs_avb_host_unittest
Test: atest --rebuild-module-info
Test: atest libfs_avb_host_unittest

Change-Id: I0cb8e8f04bc4b8628576565e7ff1920d7c81ecac
2019-01-02 09:58:08 +00:00
Sandeep Patil
40d06258b6 Merge "meminfo: Use getprogname(3) in all tools." 2019-01-01 03:49:55 +00:00
Sandeep Patil
7b20fb677e meminfo: Use getprogname(3) in all tools.
Test: procrank2 -h;librank2 -h;procmem2 -h
Bug: none

Change-Id: Ieccd943b7140a7866694eea047969500bb3bb972
Signed-off-by: Sandeep Patil <sspatil@google.com>
2018-12-30 13:42:20 -08:00
Sandeep Patil
faa257ee0f fiemap_writer: First cut implementation with write() support.
The library is meant to help write to a file using its FIEMAP and the
raw block device.

Bug: 121211685
Test: fiemap_writer_test /data/local/tmp/foo.raw /dev/block/sda21
Test: fiemap_writer_test /data/local/tmp/foo.raw /dev/block/sda21 1073741824
Test: fiemap_writer_test /data/local/tmp/foo.raw /dev/block/sda21 \
      --gtest_filter=FiemapWriter.CheckBlockDevicePath
Test: fiemap_writer_test /data/local/tmp/foo.raw /dev/block/sda21 32768 \
      --gtest_filter=FiemapWriter.CheckWriteError
Test: fiemap_writer_test /data/local/tmp/foo.raw /dev/block/sda21 \
      --gtest_filter=VerifyBlockWritesExt4.CheckWrites
Test: fiemap_writer_test /data/local/tmp/foo.raw /dev/block/sda21 \
      --gtest_filter=VerifyBlockWritesF2fs.CheckWrites

Change-Id: I7b580afddc829c1064ebb52b7a6c7600a2fb2772
Signed-off-by: Sandeep Patil <sspatil@google.com>
2018-12-29 11:11:30 -08:00
Ryan Haining
0c2d673fcc Merge "Allow dlopen()ing libraries from the netd APEX on pasan build" 2018-12-28 21:14:46 +00:00
Ken Chen
30200f1e24 Allow dlopen()ing libraries from the netd APEX on pasan build
This is a workaround to allow us to use libnetd_resolv.so from
the resolver APEX before b/120661824 is fixed.

We cannot put the APEX into the search path due to b/120661824,
but we can put it into the permitted path,

Bug: b/122073006
Test: builds, boots
Test: system/netd/tests/runtests.sh
Change-Id: If6f13ba9dc249d019b820a7c37cf6d4cdd8d0a7d
2018-12-28 17:20:01 +08:00
Tom Cherry
cf557efb19 Merge "init: document the early init boot phase" 2018-12-28 00:48:45 +00:00
Treehugger Robot
79f304771c Merge "adbd: strip nulls from all service strings." 2018-12-27 21:14:29 +00:00
Tom Cherry
a961611a99 init: document the early init boot phase
With all of the changes made to the early init boot phase, the
README.md needs updating for future referencing.

Test: none

Change-Id: Ia572577c683add449a4e091ffd4d1597682e9325
2018-12-27 12:51:32 -08:00
Treehugger Robot
16845e6c51 Merge "dmctl: Add verbose 'dmctl list devices'" 2018-12-27 20:38:30 +00:00
Josh Gao
6bd16b1d22 adbd: strip nulls from all service strings.
Other services are checking for exact equality, like jdwp.

Test: adb jdwp
Change-Id: I1081904621b111b0143a275bd9337f903fe9c111
2018-12-27 11:19:44 -08:00
Josh Gao
d2bd2edf25 Merge changes Icce121a4,I0f95d348
* changes:
  adb: switch connect_to_remote to string_view.
  adb: switch skip_host_serial to string_view.
2018-12-27 02:03:36 +00:00
Josh Gao
d5db4e1b97 Merge changes I1d899134,If4ea92ae,I92c05721,I298517b6,Iccbeb619, ...
* changes:
  adb: add stroll equivalent for string_view.
  adb: finish switching service creation to string_view.
  adb: switch socket spec to string_view.
  adb: switch daemon_service_to_fd to string_view.
  adb: switch usb_linux helper to string_view.
  adb: switch unix_open to string_view.
2018-12-27 01:38:42 +00:00
Josh Gao
d0fa13e5f7 adb: switch connect_to_remote to string_view.
Test: test_adb.py
Test: test_device.py
Test: $ANDROID_HOST_OUT/nativetest64/adb_test/adb_test
Test: adb shell /data/nativetest64/adbd_test/adbd_test
Change-Id: Icce121a4c62bf0fa636a35bcae31d057cdff8fd2
2018-12-26 11:48:14 -08:00
Josh Gao
3add0c4d42 adb: add stroll equivalent for string_view.
Test: $ANDROID_HOST_OUT/nativetest64/adb_test/adb_test
Test: adb shell /data/nativetest64/adbd_test/adbd_test
Change-Id: I1d89913474fcd1aa4a856b5e4583a3c1f076ddd4
2018-12-26 11:48:14 -08:00
Josh Gao
bd76720955 adb: switch skip_host_serial to string_view.
Rename it to something more appropriate, while we're at it.

Test: test_adb.py
Test: test_device.py
Test: $ANDROID_HOST_OUT/nativetest64/adb_test/adb_test
Test: adb shell /data/nativetest64/adbd_test/adbd_test
Change-Id: I0f95d348eeacb45a810696d748c8340d2068f666
2018-12-26 11:48:14 -08:00
Josh Gao
d19b77ac12 adb: finish switching service creation to string_view.
Test: test_adb.py
Test: test_device.py
Test: $ANDROID_HOST_OUT/nativetest64/adb_test/adb_test
Test: adb shell /data/nativetest64/adbd_test/adbd_test
Change-Id: If4ea92aee1c0264d946de72483f8d715d96fcfd8
2018-12-21 11:53:27 -08:00
Josh Gao
9dd1f5c0b7 adb: switch socket spec to string_view.
Test: test_adb.py
Test: test_device.py
Test: $ANDROID_HOST_OUT/nativetest64/adb_test/adb_test
Test: adb shell /data/nativetest64/adbd_test/adbd_test
Change-Id: I92c057215e041b98abb026628ea4acfba8a8132d
2018-12-21 11:53:27 -08:00
Josh Gao
e26154167c adb: switch daemon_service_to_fd to string_view.
Test: test_adb.py
Test: test_device.py
Test: $ANDROID_HOST_OUT/nativetest64/adb_test/adb_test
Test: adb shell /data/nativetest64/adbd_test/adbd_test
Change-Id: I298517b688650c9d94bf837284e0264ca0ac6702
2018-12-21 11:52:56 -08:00
Tom Cherry
2c56d7cdda ueventd: create a /dev/block/by-name/ symlink without a partition name
Create /dev/block/by-name/<device> symlink for block devices that are
boot devices but do not have a partition name given.

Test: boot normally
Change-Id: I8c100b0d30dce02a2dd31aebcfea538b8eed9b19
2018-12-21 09:27:38 -08:00
Tom Cherry
c02d05dc1c Merge "logd: improve logd prune" 2018-12-21 16:20:14 +00:00
Martin Stjernholm
f679c58787 Merge "Revert^2 "Linker namespace configuration for the Runtime APEX."" 2018-12-21 13:30:22 +00:00
Treehugger Robot
a7d2ffa821 Merge "Move DwarfCfaInfo::kTable from data.rel.ro to rodata" 2018-12-21 12:58:26 +00:00
Martin Stjernholm
e71d91e729 Revert^2 "Linker namespace configuration for the Runtime APEX."
This reverts commit a0d9f2fd6c.

Original change: Needs to support e.g. app_process in "default" ->
libnativehelper in "runtime" -> platform libs in "default" -> libc etc in "runtime".

Always make sure to switch namespaces when switching library paths between
/system and the APEX, so that internal library dependencies in both
locations are loaded from their own directory. E.g. libc++ and libbase live
in both places, and their dependents must always load the version they were
compiled with.

This CL also adds a temporary workaround to not break hwasan builds
(b/121038155).

Bug: 119867084
Bug: 113373927
Bug: 121038155
Change-Id: I58d09ed091dd82b2162c4a0b51555174d9322e0e
Test: Flash and reboot device
Test: Remount / read-write, then on device: rm -f system/lib{,64}/lib{c,m,dl}.so; system/bin/dex2oat -h; stop && start
Test: mmma bionic/tests/ && adb root && adb shell rm -rf /data/nativetest\* && adb push out/target/product/taimen/data/nativetest* /data/ && adb shell /data/nativetest64/bionic-unit-tests/bionic-unit-tests && adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests
Test: cts-tradefed run commandAndExit cts-dev -m CtsJniTestCases
Test: cts-tradefed run commandAndExit cts-dev -m CtsCompilationTestCases
Test: cts-tradefed run commandAndExit cts-dev -m CtsBionicTestCases (8 failures remain unchanged by this CL)
Test: Patch internal; lunch taimen_hwasan-userdebug && m SANITIZE_TARGET=hwaddress && vendor/google/tools/flashall -w && adb shell /vendor/bin/sh -c ls
2018-12-21 11:15:52 +00:00
Josh Gao
5021cfc135 adb: switch usb_linux helper to string_view.
Test: test_adb.py
Test: test_device.py
Test: $ANDROID_HOST_OUT/nativetest64/adb_test/adb_test
Test: adb shell /data/nativetest64/adbd_test/adbd_test
Change-Id: Iccbeb61905852b72fceec1bca498895b38a2e7d4
2018-12-21 01:43:34 -08:00
Josh Gao
0f29cbc750 adb: switch unix_open to string_view.
Test: test_adb.py
Test: test_device.py
Test: $ANDROID_HOST_OUT/nativetest64/adb_test/adb_test
Test: adb shell /data/nativetest64/adbd_test/adbd_test
Change-Id: Ieecc9b1b7f2111f4da45d4bbd1b7703535fe7d4d
2018-12-21 01:43:31 -08:00
David Anderson
bcede5f61a Merge "init: Don't fail first stage mount for formattable partitions." 2018-12-21 07:52:42 +00:00