Commit graph

26187 commits

Author SHA1 Message Date
Nick Kralevich
ab1413013f Merge "give zygote AID_READPROC" am: 3a724a8f5d am: d3a2573eea
am: 1af7e94c93

Change-Id: I8cfe782263e97ea98e577cd422ddeac9b7a70b22
2016-11-03 18:21:34 +00:00
Nick Kralevich
1af7e94c93 Merge "give zygote AID_READPROC" am: 3a724a8f5d
am: d3a2573eea

Change-Id: I903806d31750a77451724f4ac198b7396e1aae94
2016-11-03 18:18:04 +00:00
Nick Kralevich
d3a2573eea Merge "give zygote AID_READPROC"
am: 3a724a8f5d

Change-Id: Ie877330cba17a429ec3cd26eafaaeca3df66cc59
2016-11-03 18:15:04 +00:00
Treehugger Robot
3a724a8f5d Merge "give zygote AID_READPROC" 2016-11-03 18:08:55 +00:00
Jin Qian
8fd0ce9bc9 Merge "Set file capabilities after writing file data" am: dd4e5ae943 am: c6fbcd7579
am: ded50a76f6

Change-Id: I00df0fa9dd75217c57ffe791bd39f788cc3c9d38
2016-11-03 17:35:30 +00:00
Jin Qian
ded50a76f6 Merge "Set file capabilities after writing file data" am: dd4e5ae943
am: c6fbcd7579

Change-Id: Ie1256b68bbf185b640791aac7cb3e5ea63dc1857
2016-11-03 17:32:30 +00:00
Jin Qian
c6fbcd7579 Merge "Set file capabilities after writing file data"
am: dd4e5ae943

Change-Id: I135c6ebf4fc9b11a7ed9798be1ce0a88862386a5
2016-11-03 17:29:31 +00:00
Treehugger Robot
dd4e5ae943 Merge "Set file capabilities after writing file data" 2016-11-03 17:25:43 +00:00
Robert Sesek
7f2acb02fa Merge "Add fs_config entries for the webview_zygote." am: 2260c09983 am: 0dad6acaba
am: 4552626a4f

Change-Id: Ib964eca412ce5ddd0374695832355ef3ed900ea2
2016-11-03 15:38:23 +00:00
Robert Sesek
4552626a4f Merge "Add fs_config entries for the webview_zygote." am: 2260c09983
am: 0dad6acaba

Change-Id: I1197f428e7d3cca04c2e34cbdfcc27c562346999
2016-11-03 15:35:23 +00:00
Robert Sesek
0dad6acaba Merge "Add fs_config entries for the webview_zygote."
am: 2260c09983

Change-Id: I4c4ae12dc5a0625a4e73905ff11e2d5461aec237
2016-11-03 15:32:23 +00:00
Treehugger Robot
2260c09983 Merge "Add fs_config entries for the webview_zygote." 2016-11-03 15:26:19 +00:00
Jin Qian
d0515e7165 Set file capabilities after writing file data
File capabilities will be cleared if we set them before writing file data.

Bug: 32543395

Change-Id: I88cc0a0ec23cd6fc6dbe86c93a76914809d7e5f9
2016-11-02 16:37:11 -07:00
Steven Moreland
0c54c1e8d6 Merge "Update for hidlized hwservicemanager." am: 480af3f633 am: 82c67f5662
am: b394786624

Change-Id: I0d57a9e186fd2f67656a10628afd86b320bae506
2016-11-02 22:33:20 +00:00
Steven Moreland
b394786624 Merge "Update for hidlized hwservicemanager." am: 480af3f633
am: 82c67f5662

Change-Id: If478e3fc58a44e69f731bc82f173bf9bd10a5f91
2016-11-02 22:27:34 +00:00
Steven Moreland
82c67f5662 Merge "Update for hidlized hwservicemanager."
am: 480af3f633

Change-Id: I2c11b0249ab77e9dc22a76f6aa66026ebf3ed00d
2016-11-02 22:23:56 +00:00
Treehugger Robot
480af3f633 Merge "Update for hidlized hwservicemanager." 2016-11-02 22:17:25 +00:00
Nick Kralevich
c21169c59f give zygote AID_READPROC
In zygote wrapping mode, ZygoteConnection does a check to see if the pid
reported by the wrapped process is either child process that was
forked, or a decendent of it. This requires read access to other
processes /proc files. Grant zygote AID_READPROC to allow this access.

Bug: 32610632
Test: manual inspection of /proc files to verify group.
Test: manual inspection of zygote's children to make sure they do not
      inherit AID_READPROC

Change-Id: I3619a9ae33c8077e068e8024f7c7d44cfca6fb76
2016-11-02 13:48:32 -07:00
Steven Moreland
ba825ac33f Update for hidlized hwservicemanager.
Bug: 32313592
Test: end to end
Change-Id: I76a7ee01413b28e95e9f19fcde90f6372502ec67
2016-11-02 13:29:34 -07:00
Dimitry Ivanov
57fe52c3f5 Merge "Return nullptr from FindNamespaceByClassLoader for NB-enabled apps." am: c54c533cf6 am: b870bbd69a
am: 011074f0da

Change-Id: I1c6874a3b11edbbd38e9b79d639e0c1557311996
2016-11-02 16:12:16 +00:00
Dimitry Ivanov
011074f0da Merge "Return nullptr from FindNamespaceByClassLoader for NB-enabled apps." am: c54c533cf6
am: b870bbd69a

Change-Id: I15d9d46071941e871e332ae5ab83fc4a3b73042c
2016-11-02 16:09:47 +00:00
Dimitry Ivanov
b870bbd69a Merge "Return nullptr from FindNamespaceByClassLoader for NB-enabled apps."
am: c54c533cf6

Change-Id: If1801f74a0a55e3cb526f1f00566d119d14da92a
2016-11-02 16:06:49 +00:00
Treehugger Robot
c54c533cf6 Merge "Return nullptr from FindNamespaceByClassLoader for NB-enabled apps." 2016-11-02 16:00:45 +00:00
Jorge Lucangeli Obes
9a9af0158e Merge "init: Add support for ambient capabilities." am: 043bc971f2 am: c406474c54
am: 5794ea38f4

Change-Id: Id0f0585862d6c05e7af25185baf9d46f108ccaf5
2016-11-02 15:58:28 +00:00
Jorge Lucangeli Obes
5794ea38f4 Merge "init: Add support for ambient capabilities." am: 043bc971f2
am: c406474c54

Change-Id: Ic10ad2ddc2e416eff46b5a43f517a1409e273c34
2016-11-02 15:55:57 +00:00
Jorge Lucangeli Obes
c406474c54 Merge "init: Add support for ambient capabilities."
am: 043bc971f2

Change-Id: I92b7b0f5397e4d938b9c1f1e74aa2145c2297371
2016-11-02 15:52:56 +00:00
Treehugger Robot
043bc971f2 Merge "init: Add support for ambient capabilities." 2016-11-02 15:47:01 +00:00
Jorge Lucangeli Obes
24b29132a0 init: Add support for ambient capabilities.
Ambient capabilities are inherited in a straightforward way across
execve(2):

"
If you are nonroot but you have a capability, you can add it to pA.
If you do so, your children get that capability in pA, pP, and pE.
For example, you can set pA = CAP_NET_BIND_SERVICE, and your
children can automatically bind low-numbered ports.
"

This will allow us to get rid of the special meaning for AID_NET_ADMIN
and AID_NET_RAW, and if desired, to reduce the use of file capabilities
(which grant capabilities to any process that can execute the file). An
additional benefit of the latter is that a single .rc file can specify
all properties for a service, without having to rely on a separate file
for file capabilities.

Ambient capabilities are supported starting with kernel 4.3 and have
been backported to all Android common kernels back to 3.10.

I chose to not use Minijail here (though I'm still using libcap) for
two reasons:

1-The Minijail code is designed to work in situations where the process
is holding any set of capabilities, so it's more complex. The situation
when forking from init allows for simpler code.

2-The way Minijail is structured right now, we would not be able to
make the required SELinux calls between UID/GID dropping and other priv
dropping code. In the future, it will make sense to add some sort of
"hook" to Minijail so that it can be used in situations where we want
to do other operations between some of the privilege-dropping
operations carried out by Minijail.

Bug: 32438163
Test: Use sample service.
Change-Id: I3226cc95769d1beacbae619cb6c6e6a5425890fb
2016-11-01 19:56:14 -04:00
Dimitry Ivanov
800083d229 Return nullptr from FindNamespaceByClassLoader for NB-enabled apps.
This function is always called by the frameworks in order to
initialize vulkan layer path. For NB apps returning nullptr
disables vulkan layer library lookup as expected.

Bug: http://b/32542970
Test: mm
Change-Id: I426b2b9f5ea7227b00f063ed6040f37bb2b4f21f
2016-11-01 14:48:45 -07:00
Prashant Malani
aef042cfee resolve merge conflicts of 863442b to nyc-mr2-dev-plus-aosp
Change-Id: If8787efbbf81d5e86625b2f4e771f6720c99c4c1
2016-11-01 11:34:32 -07:00
Prashant Malani
863442bba2 fs_mgr: Add support for at-boot verification
am: 34543c03e6

Change-Id: If604d33eb1efa4681343015332728e67dc39511d
2016-10-31 23:03:50 +00:00
Josh Gao
68207fd92e Merge "adb: add adb reconnect offline to reconnect offline devices." am: 0945380e36 am: 1d51d6d6aa
am: 35beaca383

Change-Id: Ib220d1820ece143ac8a9286f4f4cbc55d3ff9be6
2016-10-31 21:44:46 +00:00
Josh Gao
35beaca383 Merge "adb: add adb reconnect offline to reconnect offline devices." am: 0945380e36
am: 1d51d6d6aa

Change-Id: I83cca311becc99b3ea4a3f2b213397af5554768c
2016-10-31 21:38:46 +00:00
Josh Gao
1d51d6d6aa Merge "adb: add adb reconnect offline to reconnect offline devices."
am: 0945380e36

Change-Id: I832f5c97f455b2b38b4bcd734759cb9561ec9b31
2016-10-31 21:33:19 +00:00
Josh Gao
0945380e36 Merge "adb: add adb reconnect offline to reconnect offline devices." 2016-10-31 21:26:23 +00:00
Nick Kralevich
96b19bebc4 Merge "init: Put init in group AID_READPROC" am: 995560919c am: ba2a810deb
am: 041a72ab30

Change-Id: Id63decb5358e8ab31db57b657b24f416f75e39a6
2016-10-31 19:35:38 +00:00
Nick Kralevich
041a72ab30 Merge "init: Put init in group AID_READPROC" am: 995560919c
am: ba2a810deb

Change-Id: Id46e8132118a0c07ba3db362318c2709e48ceddd
2016-10-31 19:29:11 +00:00
Nick Kralevich
ba2a810deb Merge "init: Put init in group AID_READPROC"
am: 995560919c

Change-Id: Id2271f8200b020fe5ccaa82e3ea4b68368a6adf1
2016-10-31 19:21:49 +00:00
Treehugger Robot
995560919c Merge "init: Put init in group AID_READPROC" 2016-10-31 19:13:35 +00:00
Wei Wang
065312c1a8 Merge "Fix log for early_mount" am: fff1669341 am: fc60c4694c
am: e17f82f8b1

Change-Id: I284bb6d787dd0939775011ccbdc6b6a5bc2f5927
2016-10-31 15:22:52 +00:00
Wei Wang
e17f82f8b1 Merge "Fix log for early_mount" am: fff1669341
am: fc60c4694c

Change-Id: If1ca10ed2aef36192f06459f097277d5c28f6f99
2016-10-31 15:16:51 +00:00
Wei Wang
fc60c4694c Merge "Fix log for early_mount"
am: fff1669341

Change-Id: I1624e4ac16b6bab7e6aaddb4ef9def01a5c8d15c
2016-10-31 15:10:21 +00:00
Treehugger Robot
fff1669341 Merge "Fix log for early_mount" 2016-10-31 15:04:38 +00:00
Robert Sesek
a2ceaf6b8b Add fs_config entries for the webview_zygote.
The webview_zygote is a non-root zygote process that creates isolated_app
children for rendering web content. It needs:
- CAP_SETUID and CAP_SETGID to change the UID of the new child process.
- CAP_SETPCAP to clear the capability bounding set after forking.

Test: m
Test: angler boots

Bug: 21643067
Change-Id: I986fa04be54e812f5dd2afa14e5d2d3e474e2b10
2016-10-31 10:33:36 -04:00
Daichi Hirono
a86f7916e4 Merge "Add FuseBridgeLoop to libappfuse." am: b5ce6f02dd am: de21fbb30b
am: b1bcc950f9

Change-Id: Ia66fae4a7a9eb774d696374325996a405d276fce
2016-10-31 06:27:21 +00:00
Daichi Hirono
b1bcc950f9 Merge "Add FuseBridgeLoop to libappfuse." am: b5ce6f02dd
am: de21fbb30b

Change-Id: I94dca86db976b167283da1ea2fbf220d92737150
2016-10-31 06:20:51 +00:00
Daichi Hirono
de21fbb30b Merge "Add FuseBridgeLoop to libappfuse."
am: b5ce6f02dd

Change-Id: I61d931b7f9b21cad7c5702c1ca362ac10ea91e00
2016-10-31 06:13:50 +00:00
Treehugger Robot
b5ce6f02dd Merge "Add FuseBridgeLoop to libappfuse." 2016-10-31 06:09:32 +00:00
Nick Kralevich
80960d2a9a init: Put init in group AID_READPROC
bootcharts currently only show root's processes, which isn't very
useful. To investigate and track boot duration issues, we need a way for
init to see all the pids. Add init to GID 3009 (aka AID_READPROC)

Ensure that init's children don't inherit this GID by always clearing
supplementary group IDs on fork.

Bug: 32506197
Test: Device boots and /proc/1/status says init is in gid 3009
Test: zygote starts and the Group: line in /proc/ZYGOTEPID/status is empty
Change-Id: Iba90717aaa591f1d6030a379a272aee003600c0a
Not-Tested: bootchart actually works. Speculative fix.
2016-10-29 12:20:00 -07:00
Wei Wang
313b352382 Fix log for early_mount
Test: on device
Bug: 32508724
Change-Id: Ib2908b19f6068012d5597ac4cc590ffb0c063b75
2016-10-28 18:05:36 -07:00