Commit graph

42958 commits

Author SHA1 Message Date
bohu
ea0c3cbc18 adb: correct tcpip help message
'adb tcpip <mode>' is meant to affect adbd, not
the host adb server.

BUG: 111434128
Change-Id: I78c958bfbede60b20fb7e0f2444e5b21ecb90f7a
2018-10-24 10:38:33 -07:00
Anton Hansson
ac305c82d6 Merge "Create /data/preloads on post-fs-data" 2018-10-24 17:09:11 +00:00
Martin Stjernholm
0b4d4826a6 Merge "Remove unnecessary dynamic dependency on libbase." 2018-10-24 16:49:13 +00:00
Tom Cherry
76b4299943 Merge "init: if vendor_init can read a property, let it be a trigger too" 2018-10-24 15:52:06 +00:00
Martin Stjernholm
53aec482aa Remove unnecessary dynamic dependency on libbase.
This code only uses android-base/macros.h.

Bug: 118374951
Test: mmma system/core/libnativebridge && for f in out/host/linux-x86/nativetest{,64}/*/*; do $f; done
Change-Id: Ifa5a5a3c9370bd128ddd301ea352746699715929
2018-10-24 16:11:45 +01:00
Anton Hansson
c38a63646b Create /data/preloads on post-fs-data
This directory is used for preloads that are typically placed in
the system_other image and copied to /data on first boot if the
cppreopts script is installed.

Bug: 80508492
Test: make
Change-Id: I4121b07ee2fc96d533075d1907557de7e4be4ee0
2018-10-24 15:29:16 +01:00
Treehugger Robot
551efd11f7 Merge "Fix off by one error." 2018-10-24 00:52:15 +00:00
Christopher Ferris
afd6e7712f Merge "Always init gnu_debugdata interface if it exists." 2018-10-24 00:38:51 +00:00
Christopher Ferris
e8c4ecf49e Always init gnu_debugdata interface if it exists.
Every real call always sets the value to true to init the gnu_debugdata
interface, so remove this parameter.

Test: Builds, unit tests pass.
Change-Id: I07fb3adbbd5b65b51c0dc7608561e820a5095051
2018-10-23 12:13:54 -07:00
Josh Gao
b59a38d343 Merge "Add feature flag for b/110953234 fix." 2018-10-23 18:30:11 +00:00
Treehugger Robot
74cdc8a542 Merge "Accept apex packages as argument." 2018-10-23 18:29:53 +00:00
Josh Gao
fb08510784 Add feature flag for b/110953234 fix.
Bug: http://b/110953234
Bug: http://b/117946501
Test: adb features
Test: test_device.py
Change-Id: I340a30544a6d0ab1b2545e5371c8f98d04158c56
2018-10-23 18:28:46 +00:00
Treehugger Robot
6153677ff5 Merge "llkd: Skip apexd for process checks" 2018-10-23 17:13:28 +00:00
Florian Mayer
9c36a99ebc Fix off by one error.
Change-Id: I18a2d177f3212626b7091150f42dfe151e47570e
2018-10-23 18:10:41 +01:00
Tao Bao
bebeb7e951 Merge "healthd: GRSurface now is a class." 2018-10-23 17:06:35 +00:00
Dario Freni
29814deaa7 Accept apex packages as argument.
Bug: 112669193
Test: Successfully reaches PackageManager. Doesn't break existing flows.
Change-Id: If4a173e290ebf0b70beb97111a6d75400da7ec8d
2018-10-23 11:07:16 +01:00
Treehugger Robot
33eb652783 Merge "adb: don't use <error.h>." 2018-10-23 03:53:50 +00:00
Treehugger Robot
6d6d9a8052 Merge "Remove bcp_dep." 2018-10-23 02:23:09 +00:00
David Anderson
3e77d7a960 Merge "liblp: Add MetadataBuilder helpers for pruning unused groups." 2018-10-23 01:50:39 +00:00
Elliott Hughes
d2aaede610 adb: don't use <error.h>.
This should fix the bloody Mac build, which doesn't have <error.h>. Since
we weren't entirely happy with error(3) anyway, switch to the toybox
style of error_exit and perror_exit, which are slightly briefer and quite
a bit more intention-revealing.

Bug: N/A
Test: builds
Change-Id: Ic8e411906c363af51657da5ce947b25a0b6bb1f3
2018-10-22 17:04:32 -07:00
Treehugger Robot
fa677f573a Merge "liblp: Move free-region calculation into a separate function." 2018-10-22 23:41:27 +00:00
Tom Cherry
b35f827c97 init: if vendor_init can read a property, let it be a trigger too
There is a list of 'stable_properties' that vendor_init can use as
property triggers for Treble property compliance.  This list came about
since init parses init scripts before all partitions are mounted and
therefore before all property context files are available, such that
init cannot use the normal SELinux mechanisms for determining if a
given property is vendor_init readable.

Currently though, we require all partitions that would contain
property context files to be mounted during first stage mount, so we
can use the normal SELinux mechanisms here, so this change deprecates
the stable_properties list and moves init to use SELinux to determine
if a property can be a trigger.

Bug: 71814576
Test: vendor_init fails to use non-readable properties as a trigger
Test: vendor_init successfully uses readable properties as a trigger
Change-Id: I6a914e8c212a3418cbf4a8a07215056aad2e0162
2018-10-22 16:16:03 -07:00
Mark Salyzyn
e81ede85c7 llkd: Skip apexd for process checks
apexd is a sensitive daemon, and the ability to ptrace this domain is
restricted by SELinux policy.  apexd spawns a binder thread which
makes matching difficult, as we would instead need to use
/system/bin/apexd as the blacklist key.

Change llkd to also check for a match on the basename of the
executable path.  This will solve a gotcha expectation when creating
a blacklist key.

Without this change, llkd continues to generate SELinux denials of

type=1400 audit(0.0:1764): avc: denied { ptrace } for comm="llkd" scontext=u:r:llkd:s0 tcontext=u:r:apexd:s0 tclass=process permissive=0

Commit 5390b9add4 was originally intended
to fix these denials, but it seems to have had no effect and the denials
are still being generated.  This change will fix it.

Test: none
Change-Id: I00aa10dfff30c65a120ad30582b820e2d4b1bb38
2018-10-22 16:11:02 -07:00
Evgenii Stepanov
d33653a26e Remove bcp_dep.
Since the build system move to kati/ninja, build command is an
implicit dependency of a target. This makes the bcp_dep / bcp_md5
thing obsolete.

Test: make

Change-Id: I4ce9ebdabfc72b188e49f12888054d63b3cda64d
2018-10-22 16:08:01 -07:00
Treehugger Robot
190fd10913 Merge "fs_mgr: overlayfs unit test" 2018-10-22 22:02:36 +00:00
Tao Bao
777af95c4e healthd: GRSurface now is a class.
Test: mmma -j system/core/healthd
Change-Id: I696542535cf4707c707c4f024de504ce343b1e69
2018-10-22 13:20:33 -07:00
Josh Gao
f5518d04f1 Merge "adb: set main thread in transport tests." 2018-10-22 20:01:44 +00:00
Josh Gao
95a3916ef9 Merge changes I9b77c105,I0b369d16,I59602c20,Iae4f3d55
* changes:
  adbd: implement a nonblocking USB Connection.
  adbd: rename daemon/usb.cpp to daemon/usb_legacy.cpp.
  adbd: open functionfs ep0 as O_RDWR.
  adbd: extract functionfs fd creation.
2018-10-22 19:45:33 +00:00
Elliott Hughes
f2b170573f Merge "adb: rationalize fatal/error logging." 2018-10-22 19:44:11 +00:00
Mark Salyzyn
0b23968e25 fs_mgr: overlayfs unit test
Provide a means to test out overlayfs work

Test: adb-remount-test.sh
Bug: 109821105
Bug: 117605276
Change-Id: Ia6114c8f4d0c3424cb869d002cc61cfc6863151c
2018-10-22 12:36:10 -07:00
Treehugger Robot
abdf6f2938 Merge "logcat: include 'kernel' and 'security' buffers in logcat --help" 2018-10-22 19:33:15 +00:00
David Anderson
5cb50a24bc liblp: Add MetadataBuilder helpers for pruning unused groups.
These will help update_engine clear the target slot before applying an OTA.

Bug: 117182932
Test: liblp_test gtest
Change-Id: I6ad370e617f22f2098245a0028a93488f9ac8674
2018-10-22 12:00:23 -07:00
David Anderson
11440493a7 liblp: Move free-region calculation into a separate function.
In preparation for supporting multiple block devices, this factors out
the free-list calculation for resizing partitions.

Additionally, it fixes a bug where space in between the first usable
sector and the first extent wasn't added to the free list.

Bug: 116802789
Test: liblp_test gtest
Change-Id: I965760eef0176020e9a5691ce1be2c8b5e0c8bc8
2018-10-22 12:00:13 -07:00
Tom Cherry
d2c7613fc0 logcat: include 'kernel' and 'security' buffers in logcat --help
Bug: 115798272
Test: documentation looks right
Change-Id: I35dcc51e6779e7382843d4d92fb6182ddf0e0202
2018-10-22 11:16:07 -07:00
Josh Gao
c51726cbec adbd: implement a nonblocking USB Connection.
Implement a Connection that implements a nonblocking interface to
functionfs, to replace the existing implementation that uses two
threads that loop and call read and write respectively. The existing
implementation is vulnerable to a race condition that can occur when a
connection is terminated, where one thread can notice failure and
complete reinitialization of the USB endpoints before the other thread
noticed anything went wrong, resulting in either the first packet
coming from the other end disappearing in to the void, or the other end
getting a packet of garbage.

As a side benefit, this improves performance on walleye from:

    push 100MiB: 10 runs: median 49.48 MiB/s, mean 50.00 MiB/s, stddev: 2.77 MiB/s
    pull 100MiB: 10 runs: median 75.82 MiB/s, mean 76.18 MiB/s, stddev: 6.60 MiB/s

to:

    push 100MiB: 10 runs: median 73.90 MiB/s, mean 73.51 MiB/s, stddev: 5.26 MiB/s
    pull 100MiB: 10 runs: median 105.90 MiB/s, mean 107.19 MiB/s, stddev: 6.10 MiB/s

Test: python test_device.py
Change-Id: I9b77c1057965edfef739ed9736e5d76613adf60a
2018-10-19 17:53:18 -07:00
Treehugger Robot
5336d40ed4 Merge "logd: clear timeout if no start time is given" 2018-10-20 00:03:08 +00:00
Josh Gao
7badb33233 adb: set main thread in transport tests.
Previously, we were relying on tests run previously to set the main
thread ID, which fails when the tests are sharded.

Test: for i in `seq 0 4`; do GTEST_SHARD_INDEX=$i GTEST_TOTAL_SHARDS=5 /data/nativetest64/adbd_test/adbd_test; done
Change-Id: I15ce70b4598b6ffcf3f5467d16c917f23f668daf
2018-10-19 15:38:10 -07:00
Elliott Hughes
4679a39610 adb: rationalize fatal/error logging.
Let's use LOG(FATAL)/PLOG(FATAL) for actual fatal stuff.

Add a Windows error(3) and move folks who didn't really mean "abort"
fatal over to it. Also get rid of syntax_error which wasn't adding a
lot of value, and most of the places it was adding "usage: " didn't seem
entirely appropriate anyway.

In particular, we seemed to have confused fastdeploy.cpp into aborting
in most user error cases, and none of the reviewers noticed. Clearly
we'd all lost track of far too many options.

(I've also cleaned up a few random instances of fprintf(3) + exit(2).)

Bug: N/A
Test: manual
Change-Id: I3e8440848a24e30d928de9eded505916bc324786
2018-10-19 14:04:24 -07:00
Tom Cherry
e2d30d14d0 logd: clear timeout if no start time is given
This code was accidentally deleted in the refactoring of
4f22786cc9 cause the
logd.timeout_no_start test to start failing.

Bug: 117942520
Test: logd unit tests
Change-Id: Id7994230a89d7f8c2cb1f36a8ca1175a6b398de0
2018-10-19 13:51:35 -07:00
Tom Cherry
5083be5d72 Merge "init: Add some ASAN helpers" 2018-10-19 20:41:24 +00:00
Treehugger Robot
4ef4b57512 Merge "fs_mgr: fs_mgr_overlayfs_teardown_one use .<hidden>" 2018-10-19 20:10:17 +00:00
Tom Cherry
e0042419f8 init: Add some ASAN helpers
Init is special.

It starts early and does not pick up the Android ASAN options provided
on the environment.  Therefore we pull in /system/asan.options in
explicitly if it exists.  We provide sane defaults that will allow the
system to boot otherwise.

Logging is complicated because it needs to go to the kernel log.
So use sanitizer functions to install log functions.

Bug: 117879229
Test: m && m SANITIZE_TARGET=address
Test: init boots with ASAN enabled
Change-Id: I72c033a1f86ba5d6b2e4f943e7a3acd0d399c8bf
2018-10-19 11:18:58 -07:00
Mark Salyzyn
9b44e80948 fs_mgr: fs_mgr_overlayfs_teardown_one use .<hidden>
Switch to using a leading . to reference a teardown directory, and
if the top directory (/mnt/scratch/overlay) report ENOTEMPTY then
check if there is any non-hidden content, and if not then consider
removing the scratch partition.

Although not currently a problem, use basename of mount point in
fs_mgr_overlayfs_teardown_one when referencing the overlay directory
tree to match the setup behavior.  Would have become a problem if
we started dealing with sub-mount points (eg: /vendor/firmware_mnt).

Test: manual
Bug: 109821105
Change-Id: I05dafe29c9e376e8423aedc8783fe674a657b3ee
2018-10-19 16:49:16 +00:00
Tom Cherry
7a08c896dd Merge changes Iea270320,Ib9063185
* changes:
  init: allow properties to be used for the keycodes option
  init: use rvalues references for callees of ParseLineSection()
2018-10-19 15:43:43 +00:00
Treehugger Robot
1230ddc94b Merge "liblp: Always align the first usable sector." 2018-10-19 05:29:17 +00:00
Treehugger Robot
62833808b0 Merge "Add O_CLOEXEC" 2018-10-19 02:52:52 +00:00
Howard Ro
18a936b3ad Merge "Revert "Make native metrics logger write to statsd socket"" 2018-10-19 02:12:15 +00:00
David Anderson
6f4722e98e Merge "liblp: Reserve the first logical block of the super partition." 2018-10-19 02:04:08 +00:00
Howard Ro
44874e5b0e Revert "Make native metrics logger write to statsd socket"
This reverts commit 34bc567a93.

Reason for revert: build failure

Change-Id: I67e0270051a82db7f524ed219316f02f2766d6e1
2018-10-19 01:41:07 +00:00
Nick Kralevich
2991949001 Add O_CLOEXEC
Prevent an FD from accidentally leaking across an exec() boundary.

Test: code compiles.
Change-Id: I90ca6e332802700403f401db016cc6c0c72b0ea3
2018-10-18 16:09:40 -07:00