Commit graph

26135 commits

Author SHA1 Message Date
Mark Salyzyn
76cd9044eb Merge "logd: switch to using arraysize() from libbase macros" am: fc08963f85
am: cb2314e5bd

Change-Id: I53e38186288dfe9f5ed12be997be99ab192c3a93
2016-11-03 22:17:32 +00:00
Mark Salyzyn
cb2314e5bd Merge "logd: switch to using arraysize() from libbase macros"
am: fc08963f85

Change-Id: If17fd9389ec65f379fa42096e835be2ed667f703
2016-11-03 22:14:34 +00:00
Treehugger Robot
fc08963f85 Merge "logd: switch to using arraysize() from libbase macros" 2016-11-03 22:07:42 +00:00
Mark Salyzyn
c6b19d743d Merge changes Ifb1b550c,Ic7377efc am: 11f8b20068
am: 360cd76695

Change-Id: I9c5f5a97718e43546c206c4a90e28adb1569602f
2016-11-03 21:04:55 +00:00
Mark Salyzyn
f3f501dbfe liblog: test report pmsg not configured if ENOMEM return am: 5febc51318
am: cfd44772d7

Change-Id: I3bb3684390b90c030f72a50ce9546b9a433d087b
2016-11-03 21:04:49 +00:00
Mark Salyzyn
bf7818defc logd: clear DUMPABLE am: 6a70ded7bf
am: d1687af980

Change-Id: Ibae1ae2b8251ae5ee65f32ad5859273ec29ec708
2016-11-03 21:04:44 +00:00
Mark Salyzyn
360cd76695 Merge changes Ifb1b550c,Ic7377efc
am: 11f8b20068

Change-Id: Ibd116625a10578c33c655eaae594610ce949fd23
2016-11-03 21:01:50 +00:00
Mark Salyzyn
cfd44772d7 liblog: test report pmsg not configured if ENOMEM return
am: 5febc51318

Change-Id: Ia7ff221bdcbf76b19e971ffde23706ad4a8840a8
2016-11-03 21:01:49 +00:00
Mark Salyzyn
d1687af980 logd: clear DUMPABLE
am: 6a70ded7bf

Change-Id: I4bcfb53d9c4a13761c80a8f2070320c85b486b0b
2016-11-03 21:01:45 +00:00
Mark Salyzyn
11f8b20068 Merge changes Ifb1b550c,Ic7377efc
* changes:
  liblog: test report pmsg not configured if ENOMEM return
  logd: clear DUMPABLE
2016-11-03 20:53:09 +00:00
Mark Salyzyn
c8d3194098 logd: switch to using arraysize() from libbase macros
Test: logd-unit-tests, liblog-unit-tests & logcat-unit-tests
Bug: 32450474
Change-Id: Iacdc4677f2c83898a7812c2af2c36e7ff7d92764
2016-11-03 12:27:29 -07:00
Mark Salyzyn
5febc51318 liblog: test report pmsg not configured if ENOMEM return
NB: bionic stdio is broken when providing appropriate errno value(s)
    on failure so libc.__pstore_append will not report pmsg
    misconfigured correctly on android for now.

Test: misconfigured kernel, watch for this message in liblog-unit-tests
Change-Id: Ifb1b550c7d3a3888000459c2f68c392cc23c379f
2016-11-03 11:20:59 -07:00
Mark Salyzyn
6a70ded7bf logd: clear DUMPABLE
Do not allow anyone to see logd memory.

Test: gTest logd-unit-tests, liblog-unit-tests and logcat-unit-tests
Bug: 32450474
Change-Id: Ic7377efcb7e1d3cd91b50741061037a0fb589045
2016-11-03 11:20:59 -07: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
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
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
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
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
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
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
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
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
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