Commit graph

54690 commits

Author SHA1 Message Date
Haibo Huang
affe5e1eed Merge "Fix build with new googletest"
am: 01a3f13452

Change-Id: Ie3a4476f479edefdb4661f5c2c3c3947fd0e3637
2019-11-09 20:20:18 -08:00
Haibo Huang
01a3f13452 Merge "Fix build with new googletest" 2019-11-10 04:08:34 +00:00
Haibo Huang
cf8a5b0e0e Fix build with new googletest
The new googletest requires prefix to be non-empty.

Exempt-From-Owner-Approval: fix test
Change-Id: Ic039cb657b455919e429a3ec2107893b1734e8a1
2019-11-10 04:08:25 +00:00
Colin Cross
adf38dff62 Merge "Replace -Weverything with -Wextra"
am: eb8cccf772

Change-Id: I27b0e534025e10bf4d81e2e11f3a8434c2a92933
2019-11-08 14:46:58 -08:00
Treehugger Robot
eb8cccf772 Merge "Replace -Weverything with -Wextra" 2019-11-08 22:24:28 +00:00
Elliott Hughes
41531f1a83 Merge "fastdeploy: fix tests."
am: ef6d913027

Change-Id: Ib8032c617fa55d68e9f77958e3523f4d8e14f384
2019-11-08 13:30:22 -08:00
Elliott Hughes
ef6d913027 Merge "fastdeploy: fix tests." 2019-11-08 21:11:45 +00:00
Colin Cross
b1ea33b64c Replace -Weverything with -Wextra
-Weverything is not recommended, use -Wextra.

Bug: 143713277
Test: mma
Change-Id: Ic242983ce984ae87d4b6937af8c106abe8e38364
2019-11-08 13:09:00 -08:00
Ray Essick
f1b983fc5f Merge "configs for jailed procs to dump code coverage data"
am: 0bc3f6b124

Change-Id: Ie5537966e186ee0d689ea538a3cedb416d4b93ac
2019-11-08 10:12:11 -08:00
Nikita Ioffe
3cafc01845 Merge "userspace reboot: don't re-install keyring when remounting userdata"
am: 838f5ccf9b

Change-Id: Id5af475db411f928ec074c78cea7a20ab5585767
2019-11-08 10:06:21 -08:00
Treehugger Robot
0bc3f6b124 Merge "configs for jailed procs to dump code coverage data" 2019-11-08 17:51:16 +00:00
Suren Baghdasaryan
01c95dde60 Merge changes from topic "native process registration"
am: 8106c8e09f

Change-Id: I9b475b9951680bea22307b5a19bd1f5ed76398bb
2019-11-08 09:42:29 -08:00
Suren Baghdasaryan
39221d8e60 lmkd: Support process types when registering a process
am: e353d8642c

Change-Id: I1a32dd8f9fbd0b08820c41890573f64b21871cb0
2019-11-08 09:42:21 -08:00
Suren Baghdasaryan
e03bddc1b5 lmkd: Add library function to unregister a process
am: 4c6d3d737f

Change-Id: I63cd62270d2609b1e7c1879d8bd949125740dbd9
2019-11-08 09:42:09 -08:00
Suren Baghdasaryan
64cb3cfcc4 lmkd: Prepare lmkd to support connection from init process
am: adb54f81bf

Change-Id: I5850786646044bd2b7e6704022a4db011c16f811
2019-11-08 09:41:55 -08:00
Suren Baghdasaryan
9de60e7c00 lmkd: Restrict process record modifications to the client that created it
am: 12ab187885

Change-Id: Ifdc8abe57936f126d855ad70be653b38d70fd026
2019-11-08 09:41:36 -08:00
Nikita Ioffe
838f5ccf9b Merge "userspace reboot: don't re-install keyring when remounting userdata" 2019-11-08 17:38:00 +00:00
Suren Baghdasaryan
8106c8e09f Merge changes from topic "native process registration"
* changes:
  init: Add support for native service registration with lmkd
  lmkd: Support process types when registering a process
  lmkd: Add library function to unregister a process
  lmkd: Prepare lmkd to support connection from init process
  lmkd: Restrict process record modifications to the client that created it
2019-11-08 17:25:10 +00:00
Tom Cherry
548ad58a2c Merge "Do not run init CTS test on secondary ABI"
am: be49555bca

Change-Id: I72d866852392b818a0b802a2a6b673ea247bbd83
2019-11-08 08:41:20 -08:00
Elliott Hughes
5f9a2958c8 Merge "ziparchive: add a corpus for the fuzzer."
am: 16366e36d5

Change-Id: I2d0b623089199616a344ece9bd37ec56b5f16cfe
2019-11-08 08:40:53 -08:00
Treehugger Robot
be49555bca Merge "Do not run init CTS test on secondary ABI" 2019-11-08 16:29:44 +00:00
Treehugger Robot
16366e36d5 Merge "ziparchive: add a corpus for the fuzzer." 2019-11-08 16:22:41 +00:00
Ray Essick
36e6f6d128 configs for jailed procs to dump code coverage data
list system calls used for dumping code coverage information; empty on
non code coverage builds. Mini-jail configurations can include this file
instead of trying to manage the list themselves.

Bug: 139313557
Test: arm32/arm64/x86 media svcs w/native coverage on, kill -37 to dump stats.
Change-Id: I7323a9739803756a76f54e4a98e995522cab71ef
2019-11-08 08:20:29 -08:00
Nikita Ioffe
63898aa2b2 userspace reboot: don't re-install keyring when remounting userdata
From the implementation of FscryptInstallKeyring it looks like it will
install a new keyring on each call.

Another approach would be change FscryptInstallKeyring to first call
request_key[0] (http://man7.org/linux/man-pages/man2/request_key.2.html),
and don't add keyring in case request_key succeeded, but it looks like
that libkeyutils doesn't provide such functionality.

Since I was there, I've also added checks that we are not trying to
remount userdata on FDE devices.

Test: adb reboot userspace
Bug: 135984674
Change-Id: I2e063d7d87a3c2c26810e913a33e3a5c0364332b
2019-11-08 16:11:04 +00:00
Elliott Hughes
74f0fc6b18 fastdeploy: fix tests.
Actually log results of adb commands, so we can see why this fails.

Fix the asan-detected use of a value from a reused part of the stack.

Test: atest FastDeployTest on Linux (with an asan adb)
Change-Id: I4d2bbae62a301e16065d604a2c9918077489cafb
2019-11-08 15:39:50 +00:00
Jooyung Han
3c7735e9d6 Merge "migrate *.libraries.txt from Make to Soong"
am: 7e5fb6b322

Change-Id: I5d82dae724dffb43a74461b1b890c85cfdd145fe
2019-11-07 20:14:09 -08:00
Treehugger Robot
7e5fb6b322 Merge "migrate *.libraries.txt from Make to Soong" 2019-11-08 04:04:14 +00:00
Tom Cherry
a4eeeadcd3 Do not run init CTS test on secondary ABI
Init unit tests refer to libraries that do not exist for the
secondary ABI, and we'd rather test the libraries on the device than
statically link them, so only test the primary ABI.

Init will only run on the primary ABI in any case, and doesn't have
much arch specific code in it.

Bug: 143560509
Test: build
Change-Id: I3c1883b3b55e5a06391d2885242f38c74eab621d
2019-11-07 16:06:38 -08:00
Tom Cherry
03c0a3ab1b Merge "Add require_root for libcutils tests"
am: 71ed80a229

Change-Id: Iee3d2079aedcbd7d022fb78c1fc9f0f8afeb9c59
2019-11-07 15:58:20 -08:00
Treehugger Robot
71ed80a229 Merge "Add require_root for libcutils tests" 2019-11-07 23:34:24 +00:00
Elliott Hughes
9e63ba787d ziparchive: add a corpus for the fuzzer.
Reuse the existing test data.

Test: ran fuzzer on host, saw a lot more log spam
Change-Id: If57e4b8708832d7296b118e6926d41951d4a3ca9
2019-11-07 14:24:04 -08:00
Tom Cherry
e41aded12d Add require_root for libcutils tests
7 of these tests require root

Test: these tests pass as root
Change-Id: Ife4d1ae0c8fe8a2ace288c584ac044a37bae0b3e
2019-11-07 14:06:21 -08:00
John Stultz
b4bd2480e3 Merge "healthd: Fix incorrect return check"
am: ec56c59dbb

Change-Id: I31afdaee07cb1639ee545dcb4e6c15230c0a507f
2019-11-07 13:43:19 -08:00
Treehugger Robot
ec56c59dbb Merge "healthd: Fix incorrect return check" 2019-11-07 21:18:59 +00:00
Paul Crowley
e9fa41b0dd Merge "Make encryption action an argument to mkdir"
am: 449282c021

Change-Id: I53cd2369f2f0c2f182ea7768284dfe15d2db98f6
2019-11-07 12:28:49 -08:00
Paul Crowley
449282c021 Merge "Make encryption action an argument to mkdir" 2019-11-07 20:06:47 +00:00
Suren Baghdasaryan
c29c2baa69 init: Add support for native service registration with lmkd
init should be able to register native services with lmkd so that they
can be killed when needed. Only processes with oom_score_adjust not
equal to the default -1000 will be registered with lmkd because with the
score that low the process is unkillable anyway.
Inform lmkd when a registered process is killed so that the record can be
removed.
Change init.rc to start lmkd during init phase so that it is there to
register other services.
Replace hardcoded oom_score_adj values with appropriate definitions.

Bug: 129011369
Test: boot and verify native service registration
Change-Id: Ie5ed62203395120d86dc1c8250fae01aa0b3c511
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2019-11-07 18:19:31 +00:00
Suren Baghdasaryan
e353d8642c lmkd: Support process types when registering a process
Add an optional process type field into lmkd registration protocol so that
applications can be distinguished from services.

Bug: 129011369
Test: boot and verify native service registration
Change-Id: Ie610b5d07cbe247a55ab31bc079ee5c5923bea11
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2019-11-07 18:19:15 +00:00
Suren Baghdasaryan
4c6d3d737f lmkd: Add library function to unregister a process
Introduce lmkd_unregister_proc helper function. Fix a bug where
lmkd_pack_set_procremove used a wrong structure as a parameter.

Bug: 129011369
Test: verify process record removal when it is manually killed
Change-Id: I7ab5a499f6b1c6eecfdba4d0a5ec916053e2726a
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2019-11-07 18:18:54 +00:00
Suren Baghdasaryan
adb54f81bf lmkd: Prepare lmkd to support connection from init process
In order to register native services init needs ability to communicate with
lmkd. Make liblmkd_utils library available in recovery mode so that init
can link to it and add a data socket in lmkd to support additional
connection from init. Ensure SOCK_CLOEXEC type for lmkd socket to prevent
init children from inheriting it.

Bug: 129011369
Test: boot and verify native service registration
Change-Id: Iaa4f59282fb10f838f6811571e97d55754b1bd41
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2019-11-07 18:18:46 +00:00
Suren Baghdasaryan
12ab187885 lmkd: Restrict process record modifications to the client that created it
Associate each registered process with the PID of the lmkd client that
registered it to prevent one client from updating records of another
client.

Bug: 129011369
Test: boot and verify native service registration
Change-Id: Id8ca7bb6314df225d04da6469b523d2cdc237eaa
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2019-11-07 18:15:04 +00:00
Suren Baghdasaryan
cb00f46509 Merge "Add libcutils_test into TEST_MAPPING"
am: 7f44a83d8f

Change-Id: I04fa2774b20bf3a16e2717b515331952f3df3458
2019-11-07 08:54:35 -08:00
Suren Baghdasaryan
7f44a83d8f Merge "Add libcutils_test into TEST_MAPPING" 2019-11-07 16:43:54 +00:00
Jeongik Cha
6c79feed0e Merge "Turn on executable bit on system_ext/bin"
am: ad3069eb72

Change-Id: I47bcbf1c7680fae26b5ae406e3662c761b220cb5
2019-11-07 07:32:02 -08:00
Treehugger Robot
ad3069eb72 Merge "Turn on executable bit on system_ext/bin" 2019-11-07 15:13:56 +00:00
Nikita Ioffe
8e6f742942 Merge "userspace reboot: unmount apexes and switch to bootstrap namespace"
am: 7051bb3d74

Change-Id: Id6faa761242f1396c1234767e8badad414e6ffbf
2019-11-07 04:30:06 -08:00
Nikita Ioffe
7051bb3d74 Merge "userspace reboot: unmount apexes and switch to bootstrap namespace" 2019-11-07 12:09:46 +00:00
Jeongik Cha
4e467e71e9 Turn on executable bit on system_ext/bin
Setting executable bit on system_ext/bin is missing, so add them into
list.

Bug: 144066307
Test: m && check if system_ext/bin/* have execute permission.
Change-Id: I89c9e0d2d54f965ecd058bb9e77ba77b7ed164c1
2019-11-07 16:51:49 +09:00
Nikita Ioffe
770d11fa2d Merge "Make remount into checkpointing for ext4 userdata a no-op"
am: dbee3618be

Change-Id: I48aca418c618529f791b4f828fd6b39bce827a75
2019-11-06 18:33:53 -08:00
Nikita Ioffe
ab91ee986b userspace reboot: unmount apexes and switch to bootstrap namespace
This will bring device to the state closer to the one during normal boot

Bug: 135984674
Test: adb install system/apex/shim/com.android.apex.cts.shim.v1.apex
Test: adb reboot userspace
Test: verified install succeeded
Change-Id: I6ef73bde2ca817c8a62bf19b8f1895dd0d6d2829
2019-11-07 02:13:38 +00:00