Commit graph

43968 commits

Author SHA1 Message Date
David Sehr
8f5f643c57 Merge "Enable building ATRACE stubs on Windows" 2019-01-07 21:38:45 +00:00
Treehugger Robot
e7bb1b3e39 Merge "Adding Android Binder Bridge (abb) utility launched from adbd." 2019-01-07 19:34:32 +00:00
Zimuzo
c55a8c6afb Set system property if 'updatable' process crashes too frequently
Critical processes currently cause the device to reboot into recovery when they
crash 4 times in 4mins.

We extend this feature to a new 'updatable' class of init services.
If these services crash 4 times in 4mins, instead of rebooting into bootloader,
we set ro.init.updatable_crashing to '1'. apexd and update_verifier will
listen to that property and try to abort and rollback updates, staged apex
modules and new slots respectively.

Test: Tested manually by marking zygote as updatable and killing zygote
frequently, verified that property is set.
Bug: 120598832
Change-Id: I7d47ea1223f7792a834981c729694242ab3f28c9
2019-01-07 19:26:10 +00:00
Narayan Kamath
8464d79877 Allow the system user to read apex_data_file.
For consistency with APKs, signature verification is performed
in the system_server. This includes checking that the signature of
an updated install matches the signature of the active package that
it updates. For this, it requires search access to /data/apex and
read access to the files under that directory.

Test: m
Change-Id: I8795b26b9a40ba7126c2a548fbec82ff322a1453
2019-01-07 19:15:10 +00:00
Yifan Hong
789d905b50 Merge "Add none to supported fs type" 2019-01-07 18:26:19 +00:00
Sandeep Patil
fa2d8d5541 libmeminfo: Add SmapsRollup
This adds the tests and SmapsRollup() parsing function in
ProcMemInfo. Adds tests to check the return value as well as
the correctness.

Bug: 111694435
Test: libmeminfo_test 1 --gtest_filter=TestProcMemInfo.*
Test: libmeminfo_benchmark --benchmark_filter=BM_SmapsRollup_
Result:
----------------------------------------------------------
Benchmark                   Time           CPU Iterations
----------------------------------------------------------
BM_SmapsRollup_old       4751 ns       4730 ns     149458
BM_SmapsRollup_new       4858 ns       4837 ns     144636
----------------------------------------------------------

Change-Id: Ia051fe53a7622e3091502ff7166efafae35e7935
Signed-off-by: Sandeep Patil <sspatil@google.com>
2019-01-07 09:43:37 -08:00
Sandeep Patil
c24f1e3c63 meminfo: Add ReadVmallocInfo()
This is to replace occurrences of get_allocated_vmalloc_memory().
Splitting into libmeminfo already found a bug with current code which
failed to account for memory allocated by modules due to addition of
the extra [%module_name%] in __builtin_return_address().

  See: https://elixir.bootlin.com/linux/latest/source/kernel/kallsyms.c#L373

Also improves the performance a bit in the process.

Bug: 119639955
Bug: 111694435
Test: libmeminfo_test 1 --gtest_filter=SysMemInfoParser.TestVmallocInfo
Test: libmeminfo_benchmark --benchmark_filter=BM_VmallocInfo_*
Result:
----------------------------------------------------------------
Benchmark                         Time           CPU Iterations
----------------------------------------------------------------
BM_VmallocInfo_old_fixed     459239 ns     457268 ns       1532
BM_VmallocInfo_new           386032 ns     384353 ns       1821
----------------------------------------------------------------

Change-Id: I1b6606ac73b5cc2dac31d24487b462ec9abfb2ef
Signed-off-by: Sandeep Patil <sspatil@google.com>
2019-01-07 09:41:55 -08:00
Alex Buynytskyy
640407d632 Adding Android Binder Bridge (abb) utility launched from adbd.
Once launched, abb will listen for incoming Binder cli requests.
Executing in-process provides 6x latency improvement (125ms vs 25ms on
PixelXL) for commands like 'package path'

Intended usage by Android Studio for fast deployment and patching of APKs.

Test: manual
BUG: 111621042

Change-Id: Ica84eb2ec9628efa441ecd627b119f3361feaf9f
2019-01-07 15:45:11 +00:00
Mark Salyzyn
3009be5cb6 Merge "llkd: handle 'adbd shell setsid' to preserve adbd" 2019-01-07 15:37:46 +00:00
Logan Chien
c2aad281fc Merge "Fix runtime namespace links for vendor processes" 2019-01-07 05:19:49 +00:00
Logan Chien
c0bb441b15 Fix runtime namespace links for vendor processes
This commit removes the soname filter from the namespace fallback link
from `runtime` to `system` in the vendor process.  This fixes the
problem that vendor process might fail to load `libnetd_client.so`,
`libc_malloc_debug.so`, `libc_malloc_debug_leak.so`, and other libc
dependencies.

This commit also removes the namespace fallback link from `runtime` to
`default` in the vendor process.  According to the comments in [1], the
original intention was to allow the access to `/system/${LIB}` not
`/vendor/${LIB}`.  Furthermore, `com.android.runtime` suppose to work
without libraries from `/vendor/${LIB}`.

[1] https://android-review.googlesource.com/c/858456

Bug: 119867084
Bug: 122025516  # Motivation of this commit
Test: Executables under vendor partition are not blocked by
`libnetd_client.so` not found error.

Change-Id: I682baada9d755910832474bb3d8307cd49c21ece
2019-01-07 11:14:34 +08:00
Treehugger Robot
32b695daa7 Merge changes from topic "fiemap-writer-1"
* changes:
  fiemap_writer: enforce filesystem optimal block size alignment
  fiemap_writer: Fix file pinning / pinning status check code.
2019-01-07 01:48:46 +00:00
Tri Vo
4f408746cf ueventd.rc: Move device-specific entries to /vendor/ueventd.rc.
Bug: 110962171
Test: boot sailfish, taimen, blueline
Change-Id: If740c2bd85409c9a057cff68f8bfd870cad35b37
2019-01-06 16:15:07 -08:00
Treehugger Robot
301b394a36 Merge "Skip building libfs_avb unittest for Mac" 2019-01-06 07:46:44 +00:00
Bowgo Tsai
a99a1f275c Skip building libfs_avb unittest for Mac
Bug: 117960205
Test: m libfs_avb_host_unittest
Change-Id: Ib53efe3e36a3f70134b2431c2c0bfed52fdd3df6
2019-01-06 13:41:45 +08:00
Sandeep Patil
eb28e0c44b fiemap_writer: enforce filesystem optimal block size alignment
... instead of using the block size from the underlying block device.

Bug: 121211685
Test: fiemap_writer_test /dev/block/sda21 (on blueline)

Change-Id: I6038d3f06505a397280b0482e33814b4883be9a2
Signed-off-by: Sandeep Patil <sspatil@google.com>
2019-01-05 17:38:31 -08:00
Sandeep Patil
d2b2e21f59 fiemap_writer: Fix file pinning / pinning status check code.
The IsFilePinned() function is still not being called because I am still
seeing # blocks moved when I run following test on
aosp_blueline-userdebug.

 $ fiemap_writer_test /dev/block/sda21 \
 --gtest_filter=FiemapWriterTest.CheckWriteError

Bug: 122138114
Test: fiemap_writer_test /dev/block/sda21

Change-Id: I08d74093a082674d621772d202143d2f32e7c665
Signed-off-by: Sandeep Patil <sspatil@google.com>
2019-01-05 15:29:54 -08:00
Treehugger Robot
0dd3725982 Merge "Adding libfs_avb unittest framework" 2019-01-05 10:57:13 +00:00
Treehugger Robot
aed2ee9664 Merge "fs_mgr_avb: introducing class VBMetaData" 2019-01-05 06:41:14 +00:00
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
android-build-team Robot
83cda925e1 Merge cherrypicks of [5929407, 5929627, 5929597, 5929598] into pi-platform-release
Change-Id: I96a4dbe887b725b458061cfc5d64b42f2e554038
2019-01-03 23:49:30 +00:00
Greg Kaiser
7c932e95c3 fs_mgr_fstab: Add Adiantum support
Adiantum is a crypto method Android is supporting for devices
which don't have AES CPU instructions.  See the paper
"Adiantum: length-preserving encryption for entry-level processors"
(https://eprint.iacr.org/2018/720.pdf) for more details.

We add Adiantum to our list of supported encryption modes.

Bug: 112010205
Test: Tested on a device
Change-Id: I14a400164803a1e217d378ad9bd8b67a61b8b7d0
Merged-In: I14a400164803a1e217d378ad9bd8b67a61b8b7d0
(cherry picked from commit 1b3082642af6f846eb9bcd4fb5c001eed2cfd8a4)
2019-01-03 23:49:20 +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