Commit Graph

4658 Commits

Author SHA1 Message Date
Robert Sesek
000552a64d Merge "Use the correct value for Process.WEBVIEW_ZYGOTE_UID." am: 572f65fb58
am: cb7119385e

Change-Id: Iaf7a31629d06d87400796899f659926e5186ac41
2018-01-23 21:52:04 +00:00
Treehugger Robot
572f65fb58 Merge "Use the correct value for Process.WEBVIEW_ZYGOTE_UID." 2018-01-23 18:14:00 +00:00
Andreas Gampe
03eb67c287 Merge "Debug: Add attachJvmtiAgent with classloader" am: 940c0341f0
am: 878abd8e91

Change-Id: I862a822ef7600030f7b435fe9b9368961cf4694b
2018-01-22 20:01:18 +00:00
Robert Sesek
bceb382572 Use the correct value for Process.WEBVIEW_ZYGOTE_UID.
When the libcutils constant was added there a merge conflict, which
caused the AID_WEBVIEW_ZYGOTE value to land with a different value than
the Java-side Process value. Nothing yet uses the Process constant, so
there were no ill effects.

Test: m
Change-Id: I8cc87bce1ddbdcdaf79d85c828d86837e96cce21
2018-01-22 12:29:21 -05:00
Andreas Gampe
571b700fb6 Debug: Add attachJvmtiAgent with classloader
Add classloader support to android.os.Debug.attachJvmtiAgent. For
the original version without a given classloader, look up the
application's main classloader.

Bug: 65016018
Bug: 70901841
Test: m
Test: cts-tradefed run commandAndExit cts-dev
Change-Id: I649b6883e05dc2f75073fe1f978423f6a7b880df
2018-01-18 22:02:53 -08:00
Victor Hsieh
dec688691d Merge "Reland: Move zygote's seccomp setup to post-fork" am: 7839672e22
am: 4249466562

Change-Id: Idbf4d7add5e41d2d01f4a3c2ff6e8f1b1735faeb
2018-01-18 01:23:32 +00:00
Victor Hsieh
c8176efe2e Reland: Move zygote's seccomp setup to post-fork
Before this change, seccomp filter setup is as early as in zygote's main
function.  To make it possible to split app and system server's filter,
this postpone the setup to after fork.  It also starts to call app
specific and system server specific setup function.

The filter setup is done in Zygote's ForkAndSpecializeCommon.  This is
because adding a seccomp filter must be done when either the caller has
CAP_SYS_ADMIN or after the PR_SET_NO_NEW_PRIVS bit is set.  Given that
setting PR_SET_NO_NEW_PRIVS breaks SELinux domain transition
(b/71859146), this must be done after Zygote forks but before
CAP_SYS_ADMIN is droppped.

Test: (cts) -m CtsSecurityTestCases -t android.security.cts.SeccompTest
Test: no selinux denial flood in dmesg with selinux enforced
Test: debuggerd -b `pidof com.android.phone`  # logcat shows tombstoned
      received crash request
Bug: 63944145
Bug: 71859146

Change-Id: I8215c8530d3d0de504a270488f8e29635805e8b0
2018-01-17 09:30:44 -08:00
Yifan Hong
bb2d749981 Merge "android.os.VintfObject: update for VNDK version format change." am: eac8c121fe
am: d9b9d49a66

Change-Id: I69512885ec3372e45f775bb7f6a8b828f8be490e
2018-01-12 23:22:02 +00:00
Treehugger Robot
eac8c121fe Merge "android.os.VintfObject: update for VNDK version format change." 2018-01-12 22:12:39 +00:00
Yifan Hong
8da8798ca3 android.os.VintfObject: update for VNDK version format change.
Test: CTS device info collect
Bug: 36400653

Change-Id: I7b22f82ddd9ddc3b0930b5c1564435c42be2a6fa
2018-01-11 15:05:19 -08:00
Erik Kline
805104f40f Merge changes I47ccfa99,I5db1de3e am: 08498c32f4
am: 03f3294103

Change-Id: I311f6c299daf1c8d21731187d8e78e55c5767564
2018-01-11 12:43:38 +00:00
Erik Kline
1742fe1309 Extract DNS setting logic into DnsManager class
In future, managing DNS-over-TLS hostname lookup and netd programming
can be encapsulated here.

Test: as follows
    - built
    - flashed
    - booted
    - runtest frameworks-net passes
Bug: 64133961
Change-Id: I47ccfa99c30c780524c45c4af605e720ccba34a0
2018-01-11 18:16:50 +09:00
Victor Hsieh
5e1a526cf4 Merge "Revert "Move zygote's seccomp setup to post-fork"" am: 54da93b981
am: 8fffe22ab1

Change-Id: Ic6b927ab28f75fb46f60dd77d5ae4ccf98c0b329
2018-01-10 19:57:17 +00:00
Treehugger Robot
54da93b981 Merge "Revert "Move zygote's seccomp setup to post-fork"" 2018-01-10 18:46:36 +00:00
Victor Hsieh
fe6a51fcb5 Revert "Move zygote's seccomp setup to post-fork"
This reverts commit 6a4a339832.

Reason for revert: caused some SELinux error

Bug: 71768585
Change-Id: I0ef270ec6fed1d5d96b4257ec1a2dd6a55a816ed
Merged-In: Ic1b81e146b52b68445ba634de39657f199107da3
2018-01-10 17:22:55 +00:00
Victor Hsieh
dacb02bf5a Merge "Move zygote's seccomp setup to post-fork" am: 5d33c10a96
am: b629f9e12c

Change-Id: I7d4c6b22c70955a9f594b0e55149a203df56f6fc
2018-01-09 21:58:58 +00:00
Treehugger Robot
5d33c10a96 Merge "Move zygote's seccomp setup to post-fork" 2018-01-09 21:41:19 +00:00
Victor Hsieh
6a4a339832 Move zygote's seccomp setup to post-fork
Before this change, seccomp filter setup is as early as in zygote's main
function.  To make it possible to split app and system server's filter,
this postpone the setup to after fork.  It also starts to call app
specific and system server specific setup function.

In terms of performance since this happens at fork, the measure shows
the overhead is negligible.  Assuming 130 instruction in the BPF, on
walleye, even when running on little core with fixed low frequency, each
setup took about 60.9us on average.  When it runs on big core with
higher frequency, it took about 39.3us.

Test: (cts) -m CtsSecurityTestCases -t android.security.cts.SeccompTest
Bug: 63944145

Change-Id: I748735b478405098beac1e200d911c13ea60e380
Merged-In: I748735b478405098beac1e200d911c13ea60e380
2018-01-09 20:16:01 +00:00
Hans Boehm
f81791c141 Merge "Only count uncleared ProxyMap refs when deciding to crash" am: 90027eb1c2
am: c9e7c10afb

Change-Id: I70169c5eeb5dbdaa751ea7b9369feb3663d79952
2018-01-09 19:38:55 +00:00
Hans Boehm
d2fb7df2c1 Only count uncleared ProxyMap refs when deciding to crash
Add a method to compute the size of a ProxyMap without cleared
references. Use it in the crash decision. Report both counts, as
well as the count after a forced GC before actually crashing.

Rename the histogram generating function after a small refactoring
to make that easier.

When we crash, we now generate a message like the following
(generated here with reduced thresholds):

01-03 01:40:52.273  4793  4947 E JavaBinder: java.lang.AssertionError:
Binder ProxyMap has too many entries: 277 (total), 275 (uncleared),
257 (after GC). BinderProxy leak?

after the histogram. Unfortunately, the intervening GC may take some
time, and other intervening messages may sneak into the log between
them.

Experiments so far suggest that none of this greatly affects the
decision when to die. But this eliminates uncertainty as to whether
there was really a problem.

Bug: 71353150

Test: Tested with reduced thresholds, and then booted AOSP.
Change-Id: I53f24bae23eedcdb78a1c32296c65692b7bb2c42
2018-01-08 14:30:42 -08:00
Steven Moreland
98fa8b7eb0 Merge "Generic Mutable class for HIDL code." am: 0f05ce94c3
am: a4ac12c3ac

Change-Id: I1914e805b15064b40b963840eddf87a0bbd41169
2018-01-08 20:25:30 +00:00
Steven Moreland
4bfa2ebb89 Generic Mutable class for HIDL code.
In general, using Mutable inside of structures
or as API arguments is a code smell. However, it
is the most syntactically clean way of fetching
something out of a lambda or inner class.

Using this, one can do:
Mutable<Result> res = new Mutable<>();
hidlObject.foo((...) -> {
    res.value = ...;
});

There is an alternative:
Result a[] = new Result[1];
hidlObject.foo((...) -> {
    a[0] = ...;
});

However, this alternative syntax is relatively messy.

Bug: N/A
Test: boot, use w/ wifi
Change-Id: Ibff13c653cc17bd25ddbb0534ba21ef485bff7aa
2018-01-05 19:13:06 +00:00
hj.seo
35d0ac5e07 Merge "Modify getting of primary storage size" am: 1c876b73b3
am: f8adea8255

Change-Id: I291fef4af5af22160952be48415463619d300ff2
2018-01-03 01:29:57 +00:00
Treehugger Robot
1c876b73b3 Merge "Modify getting of primary storage size" 2018-01-03 01:10:49 +00:00
Andreas Gampe
906d0c9375 Merge "Binder: Log a histogram of binder proxies to logcat on death" am: 4b7abe301c
am: 3c57709e70

Change-Id: I322ced9619f9982182c5b739007988fda89c6f30
2017-12-27 20:24:50 +00:00
Andreas Gampe
3fc030f083 Binder: Log a histogram of binder proxies to logcat on death
To help investigate potential BinderProxy leaks, attempt to log a
histogram of BinderProxy descriptors to the logcat before asserting.

Bug: 71353150
Test: m
Change-Id: I47313814160678369b15e7dc5851d8096c286b9d
2017-12-27 09:30:45 -08:00
hj.seo
e82e89ef90 Modify getting of primary storage size
Settings application shows internal storage size using API getTotalBytes in StorageStatsManager.
This API calls getPrimaryStorageSize() in StorageManager.
getPrimaryStorageSize() returns /data parition size calculated API roundStorageSize() in FileUtils.
Using this API, total primary storage size returns 8GB if 16GB emmc size device has /data partition size below 8GB.
So we should modify getting of primary storage size close to real emmc size.
getPrimaryStorageSize() will be calculated sum of /data and /system partition size.

Test: Check primary storage size in Settings application

Change-Id: I3ad33534b1c55d09afbb0e9be1c408c02c442842
Signed-off-by: hj.seo <hj.seo@lge.com>
2017-12-26 09:24:53 +09:00
Bowgo Tsai
3a315ab982 Merge "Disable AVB check in runtime vintf" am: 86c9951383
am: a241b4d488

Change-Id: Icf111bfeedde4a134ac77af935afff096961a852
2017-12-07 10:19:47 +00:00
Treehugger Robot
86c9951383 Merge "Disable AVB check in runtime vintf" 2017-12-07 08:15:35 +00:00
Hans Boehm
9020d22c6d Merge "Ensure that debug builds crash again if there is a BinderProxy leak." am: db122f90d9
am: 4fc1bb0e37

Change-Id: I949a3896f7613fe8bd3d92badba0fea5b3343e39
2017-12-01 15:56:23 +00:00
Hans Boehm
4fc1bb0e37 Merge "Ensure that debug builds crash again if there is a BinderProxy leak."
am: db122f90d9

Change-Id: Ibc470d844139fd2f74434a26d01903c67eb51f86
2017-12-01 15:46:09 +00:00
Hans Boehm
db122f90d9 Merge "Ensure that debug builds crash again if there is a BinderProxy leak." 2017-12-01 15:34:29 +00:00
Bowgo Tsai
78934c9b8b Disable AVB check in runtime vintf
GSI disables AVB by overriding vbmeta partition.
When a device can run runtime vintf checking, it should already
pass AVB, so we don't need to check AVB in runtime vintf.

We cannot change the original VintfObject.verify() because AVB check is
still needed for android.os.RecoverySystem to verify a newly downloaded
OTA package.

Bug: 68016134
Test: Boot with GSI and there is no Android System dialog
Change-Id: Ie1efa6f1abd8fa8f495aededd145c0ab2c0c1fae
Merged-In: Ie1efa6f1abd8fa8f495aededd145c0ab2c0c1fae
2017-12-01 12:09:50 +08:00
Hans Boehm
c79595fefa Ensure that debug builds crash again if there is a BinderProxy leak.
This fails when trying to run the AOSP mailer with CRASH_AT_SIZE = 500,
when the check interval is reduced sufficiently so that the test is
actually executed. System server has been observed to use more than
1000 BinderProxies. Thus 5000 seems like roughly the lowest safe limit.

Note that the test is executed somewhat rarely, so we may exceed
this number by quite a few before we actually crash.

Bug: 65760710
Test: Builds, AOSP boots & works for a few tasks. Fails as expected
with reduced limit.

Change-Id: I1c999b85e1ba1bd1d166a9ffba4f0b3992ffee45
2017-11-30 15:29:11 -08:00
Kevin Hufnagle
fcd96e847f cherry-pick from oc-dev: docs: Note regarding device IDs, Build.java
am: d6ebb55c62

Change-Id: I88bf4c778a04b5f43a7fcd22d4aadb378860bb8a
2017-11-30 19:24:10 +00:00
Kevin Hufnagle
d6ebb55c62 cherry-pick from oc-dev: docs: Note regarding device IDs, Build.java
Added note within getSerial() in android.os.Build class. Device
identifiers, such as hardware serial numbers, can be modified if a
device is rooted. Others can use key attestation to discover these
changes. Added a note to this effect within this method.

Test: make ds-docs -j8

Bug: 38312326
Change-Id: I76e3f6a15b9a8673ca3304218653e8cd26da38d7
Original-Change-Id: Ibd2dab621c14683e12a213957b567ee49b8d00fd
2017-11-29 14:41:05 -08:00
Dianne Hackborn
532c2f8a36 Merge "Add documentation for O and O_MR1 target SDK changes." into oc-mr1-dev
am: b94e697dcf

Change-Id: I40ef78ee243cbb2f5967115e40740a3f36b253ef
2017-11-28 00:50:13 +00:00
Dianne Hackborn
a47d0453d9 Add documentation for O and O_MR1 target SDK changes.
Whoops, forgot to do this!

Bug: 69805350
Test: built and looked
Change-Id: Ic42cbcb7a62e7474c4864d66944452fed2e9005c
2017-11-27 14:08:16 -08:00
Yifan Hong
8cf7761747 Merge "android.os.HidlSupport: add getPidIfSharable() for HALs"
am: e72b6f0d31

Change-Id: I7ea5895cdfd09786732b597be600329a334c1cb4
2017-11-22 23:06:33 +00:00
Yifan Hong
e72b6f0d31 Merge "android.os.HidlSupport: add getPidIfSharable() for HALs" 2017-11-22 22:51:19 +00:00
Yifan Hong
bb0bd00b00 android.os.HidlSupport: add getPidIfSharable() for HALs
... that returns PID of the process for debuggable builds.
This calls into the C++ equivalent of the function.

Test: lshal
Bug: 68992575

Change-Id: Ia177c709c6930510035cff33dc2389441a76351d
2017-11-20 11:51:07 -08:00
Calin Juravle
af657ae978 Merge "Workaround to get passed the broken install flow"
am: b0e6508a5b

Change-Id: Icbad0d985b4d8d3e206ee5e426cdd1f58955aec1
2017-11-17 02:46:57 +00:00
Calin Juravle
b0e6508a5b Merge "Workaround to get passed the broken install flow" 2017-11-17 02:36:29 +00:00
Jakub Pawlowski
b6946d8563 Merge "Add getProfileParentId (1/2)"
am: 7a2c66359a

Change-Id: Iea965e42bb79f939381971e8dd9466b824606ee0
2017-11-17 01:40:05 +00:00
Jeff Sharkey
5f44aa798b Workaround to get passed the broken install flow
For fresh installs the PM does not set the app uid before invoking
dexopt; so we would always get a bogus GID.

This is a temporary workaround which fixes the GID of newly
installed apps to an arbitrary UNKNOWN gid.

Test: adb install
Bug: 64548938
Bug: 69331247

(cherry picked from commit a73e165c2e)

Change-Id: I6438ec8cfca88df813e166f9ef5821e62faf524a
2017-11-17 00:17:21 +00:00
Jakub Pawlowski
0f1f5b7953 Add getProfileParentId (1/2)
Bluetooth service needs to natively access id of parent profile. Add
method exposing it.

Test: cts-tradefed run cts-dev -m DevicePolicyManager --test
com.android.cts.devicepolicy.ManagedProfileTest#testBluetooth
Bug: 69284968
Change-Id: I697906f2959b0736c1d3cc6af7560c27d77ce11b
2017-11-15 15:37:53 -08:00
Koji Fukui
8d36beec24 Merge "Remove AutofillManagerClient after AutofillManager is finalized"
am: dd5384a4fe

Change-Id: If0b092c5e18005fb4b8c1fd8405f4d666c98de5a
2017-11-15 02:35:18 +00:00
Treehugger Robot
dd5384a4fe Merge "Remove AutofillManagerClient after AutofillManager is finalized" 2017-11-15 02:23:27 +00:00
Xin Li
220871a697 Merge commit '98e12851336b7db16e583f9afac63ecc97465980' from
oc-mr1-dev-plus-aosp-without-vendor into stage-aosp-master.

Change-Id: Ia7b8da4a00d215160e4a4fa40f6044208d1297b7
Merged-In: I19846d2a3ee27aecbae2367a74ee49082eea154d
2017-11-14 12:31:11 -08:00
Jeff Sharkey
7e875df695 Merge "Better, consistent definition of AID_SHARED_GID." 2017-11-14 16:49:30 +00:00