Commit graph

45514 commits

Author SHA1 Message Date
Nicolas Geoffray
4cfa281a8d Merge "Don't abort the build if a repo doesn't have the test/vts/tools/build/."
am: 82503887fa

Change-Id: I3414b6d9ce6d6251fd37d396937c43fbe7bb2cd6
2019-02-08 01:00:25 -08:00
Nicolas Geoffray
82503887fa Merge "Don't abort the build if a repo doesn't have the test/vts/tools/build/." 2019-02-08 08:48:28 +00:00
Nicolas Geoffray
646c6d902d Don't abort the build if a repo doesn't have the test/vts/tools/build/.
Test: build with master-art manifest
Exempt-From-Owner-Approval: Required for unbreaking ART development.
Change-Id: I6afc0e5444dfa21532a4c802f8c463091cab2b11
2019-02-08 08:47:12 +00:00
Josh Gao
c1f4e167b6 Merge "adb: "support" O_CLOEXEC in adb_open on Windows."
am: 9c4fda6cd2

Change-Id: Ie24c95b84e62093cb63e79ec52b3d378c4531698
2019-02-07 23:02:55 -08:00
Treehugger Robot
9c4fda6cd2 Merge "adb: "support" O_CLOEXEC in adb_open on Windows." 2019-02-08 06:56:47 +00:00
Josh Gao
ad68f429ca Merge "adb: hopefully deflake test_adb.py."
am: 151499e47e

Change-Id: I38b0a7c693a3e4b6eabb092d15309539972d982e
2019-02-07 21:54:41 -08:00
Treehugger Robot
151499e47e Merge "adb: hopefully deflake test_adb.py." 2019-02-08 05:46:16 +00:00
Wei Wang
a3c0dd8444 Merge "bootstat: Update boot reason property earlier"
am: 575996837c

Change-Id: I43e99524c872574130cc3cac9c5ac5d537d9a6db
2019-02-07 19:07:40 -08:00
Erick Reyes
bfee2d4e16 Merge "meminfo: add tools/dmabufinfo_dump to dmabufinfo"
am: 708d45979c

Change-Id: I95ab09ca503e96073724327ba0a76b284883f506
2019-02-07 19:06:59 -08:00
Wei Wang
575996837c Merge "bootstat: Update boot reason property earlier" 2019-02-08 02:55:13 +00:00
Wei Wang
4e9c653c93 bootstat: Update boot reason property earlier
bootstat updates boot reason upon boot_complete, however users of the
updated properties e.g. getLastShutdownReason from PowerManager could
be called before boot_complete. This introduces a inconsistency and
racing for those APIs.

In this CL, we change boot reason to be updated at the same time when
zygote starts where persist properties have been loaded already. Also
the initialization of bootloader's boot reason is pulled into post-fs
where all kernel command line arguments have been parsed in init already.

Bug: 122696730
Bug: 119509425
Test: trigger thermal shutdown and see warnings
Test: verify boot reason properties updated correctly post boot
Change-Id: Ia393b98ea072bc0ae6e4110d111393b34be0ee5d
Signed-off-by: Wei Wang <wvw@google.com>
2019-02-08 02:55:06 +00:00
Treehugger Robot
708d45979c Merge "meminfo: add tools/dmabufinfo_dump to dmabufinfo" 2019-02-08 02:53:54 +00:00
Tri Vo
6e62fa3a58 Merge "vts test for /proc/<pid>/smaps_rollup"
am: a0b17a3d8b

Change-Id: I04bccf644a70f229892e4a2e063c316a7b917515
2019-02-07 18:15:11 -08:00
Treehugger Robot
a0b17a3d8b Merge "vts test for /proc/<pid>/smaps_rollup" 2019-02-08 02:05:55 +00:00
Erick Reyes
5b2347da1d Merge "meminfo: Fix dmabufinfo total ref accounting"
am: 32afafa67e

Change-Id: Ic6358e2ab8fd40b8a1c542c5caa9df694317f426
2019-02-07 17:54:45 -08:00
Josh Gao
aa95aa063f adb: hopefully deflake test_adb.py.
The reconnection test is spuriously failing on test infrastructure for
unclear reasons, which might be due to a race between the connection
attempt and the first command we send. Insert a sleep to hopefully
reduce the flakiness.

Bug: http://b/123247844
Test: ./test_adb.py (but it didn't fail for me in the first place)
Change-Id: Ic36924c16bae424accfec700af4623794fd1f123
2019-02-07 17:53:29 -08:00
Erick Reyes
32afafa67e Merge "meminfo: Fix dmabufinfo total ref accounting" 2019-02-08 01:48:01 +00:00
Jesse Hall
20ee5af257 Merge "Freshen libsystem/OWNERS"
am: 3dbdf65afc

Change-Id: Ic4201d5e1527534d7c6ebdd3f0bc7e8f69651b4f
2019-02-07 14:47:28 -08:00
Treehugger Robot
3dbdf65afc Merge "Freshen libsystem/OWNERS" 2019-02-07 22:33:39 +00:00
Josh Gao
4b019a5f25 adb: "support" O_CLOEXEC in adb_open on Windows.
Previously, we were rejecting the flag and failing with EINVAL. File
handles aren't inherited by default, so just ignore the flag.

Bug: http://b/123753498
Test: adb install --streaming foo.apk
Change-Id: I17401fcdd58024956d47a5c4c0c57b06831d9817
2019-02-07 14:23:39 -08:00
Mark Salyzyn
d191b29fb7 Merge "fs_mgr: overlayfs: fs_mgr_overlay_setup true if already mounted"
am: c6a2d7d5cd

Change-Id: Ibaa209524a61d1c08b9c7a98bcc5b496240d2d41
2019-02-07 10:33:13 -08:00
Mark Salyzyn
c6a2d7d5cd Merge "fs_mgr: overlayfs: fs_mgr_overlay_setup true if already mounted" 2019-02-07 18:25:55 +00:00
Jesse Hall
9c8e3c3a93 Freshen libsystem/OWNERS
Test: none
Change-Id: I6ce1f28bdc6553910a4e4dafb125d05d9e11035a
2019-02-07 10:19:01 -08:00
Mark Salyzyn
694af77137 Merge "fs_mgr: overlayfs support legacy devices (marlin)"
am: 4e3a5f61a4

Change-Id: I09bddd7ed609e42518ad16067e03c73bc84ce3eb
2019-02-07 10:17:09 -08:00
Mark Salyzyn
4e3a5f61a4 Merge "fs_mgr: overlayfs support legacy devices (marlin)" 2019-02-07 18:03:55 +00:00
Jiyong Park
6649f7447e Merge "Configure /system/apex/com.android.runtime.[debug|release]/bin/*"
am: 186661d135

Change-Id: I41121a2d65b08ed6d81a9831d20e933bf01585a7
2019-02-07 08:21:58 -08:00
Jiyong Park
186661d135 Merge "Configure /system/apex/com.android.runtime.[debug|release]/bin/*" 2019-02-07 16:08:24 +00:00
Elliott Hughes
756066f0c5 Merge "MappedFile and FileMap should support zero-length mappings."
am: 5f5ffc8e19

Change-Id: I98b1465f0bf851a611358fb12dff85bc3965cd5e
2019-02-07 07:51:42 -08:00
Elliott Hughes
5f5ffc8e19 Merge "MappedFile and FileMap should support zero-length mappings." 2019-02-07 15:45:03 +00:00
Joel Fernandes
b03663ebdf Merge changes from topic "memfd-support"
am: 3133b695e0

Change-Id: If70d5632834e2772157ee1dd27fd38cbe4aa5f00
2019-02-07 06:23:51 -08:00
Joel Fernandes
3133b695e0 Merge changes from topic "memfd-support"
* changes:
  init: set the sys.use_memfd property to false
  Add support for memfd
2019-02-07 14:17:13 +00:00
Martin Stjernholm
76ea084a85 Merge "Add some overview docs for classloader-namespace."
am: d338c1f8e6

Change-Id: I2fca58806fc11b7bc3b6cbb695c0d7bd4b00bed8
2019-02-06 21:42:38 -08:00
Treehugger Robot
d338c1f8e6 Merge "Add some overview docs for classloader-namespace." 2019-02-07 05:35:46 +00:00
Suren Baghdasaryan
71eee1e10c Merge "libprocessgroup: Fix file mode parsing that requires octal values"
am: 3a22225ac6

Change-Id: I3fbd65934177bc0fee7200562e925ca22a45de95
2019-02-06 21:06:32 -08:00
Suren Baghdasaryan
3a22225ac6 Merge "libprocessgroup: Fix file mode parsing that requires octal values" 2019-02-07 04:54:28 +00:00
Suren Baghdasaryan
e401604868 Merge "libprocessgroup: Fix cgroup directory ownership setup"
am: 40673c9250

Change-Id: Ib1441b21b326f2033488e42b8f818768c947c28c
2019-02-06 17:55:36 -08:00
Suren Baghdasaryan
40673c9250 Merge "libprocessgroup: Fix cgroup directory ownership setup" 2019-02-07 01:42:00 +00:00
Joel Fernandes
ae7f052328 init: set the sys.use_memfd property to false
The sys.use_memfd property is set by default to false in Android
to temporarily disable memfd, till vendor and apps are ready for it.
The main issue: either apps or vendor processes can directly make ashmem
IOCTLs on FDs they receive by assuming they are ashmem, without going
through libcutils. Such fds could have very well be originally created with
libcutils hence they could be memfd. Thus the IOCTLs will break.

Set default value of sys.use_memfd property to true once the issue is
resolved, so that the code can then self-detect if kernel support is present
on the device. The property can also set to true from adb shell, for
debugging.

Bug: 113362644

Change-Id: I0f572ef36cac2a58fe308ddb90bbeffbecdaed3b
Signed-off-by: Joel Fernandes <joelaf@google.com>
2019-02-07 00:40:22 +00:00
Joel Fernandes
519440468b Add support for memfd
This patch adds support to make libcutils create and use memfd where
possible, instead of ashmem.

The libcutils library is made dynamic, since apps are still sending over
ashmem FDs to processes and we are working on moving those apps away
from ashmem. The best we can do for that is make the library work, and
force apps in the long run to move away from directly using ashmem.

Due to further complications mentioned in the 'NOTE' section of the
patch, memfd is kept disabled for now, so nothing changes yet. To enable
it, set the sys.use_memfd property (check user_debug build).

Bug: 113362644
Change-Id: I491cb7841b664db5b1c26b3e07a440a14810e182
Signed-off-by: Joel Fernandes <joelaf@google.com>
2019-02-07 00:40:13 +00:00
Tom Cherry
212343f813 Merge "init: allow services to have no capabilities set"
am: 500b6c0e86

Change-Id: I098343aab9180998fac51d18ed3ee7440997aaa4
2019-02-06 16:10:49 -08:00
Tom Cherry
500b6c0e86 Merge "init: allow services to have no capabilities set" 2019-02-06 23:48:36 +00:00
Mark Salyzyn
fab9f08ea5 fs_mgr: overlayfs: fs_mgr_overlay_setup true if already mounted
fs_mgr_overlayfs_setup return false second time around if all
are setup. It should report true if candidate list is all done.

Test: adb-remount-test.sh
Bug: 122602260
Change-Id: Ic9e16489e2c8ac4d3de91fcf8cfceedc23595e94
2019-02-06 15:35:45 -08:00
Mark Salyzyn
6d109ecba3 fs_mgr: overlayfs support legacy devices (marlin)
Expand the tests to deal with the boot environment for marlin.
Recognize that older overlayfs drivers do not report to /sys/module
and the parsing /proc/filesystem is another place to interrogate this.

Suppress adb push and pull noise during testing.  Resolve APEX
failures.  Add some cleanup to test script.

NB: Running test to completion is difficult because marlin's USB
    driver is flakey enough through the multitude of reboots and
    may not reconnect.  The tester will have to notice when a reboot
    is stalling and manually disconnect and reconnect the USB
    connection to trigger discovery and to continue through the
    test sequences.  To make this easier, report when we are
    waiting for the device to make it easier to babysit.

Test: system/core/fs_mgr/tests/adb-remount-test.sh
Bug: 120448575
Bug: 123079041
Change-Id: I5fc5f01b4e4788ac57541cb5235f7ac4e4284d71
2019-02-06 15:35:29 -08:00
Erick Reyes
fd79d4305a meminfo: add tools/dmabufinfo_dump to dmabufinfo
Adding tool to dump the dmabuf information using the dmabufinfo library.

Test: run "dmabuf_dump" and "dmabuf_dump <pid>" on crosshatch
Bug: 63860998

Change-Id: I16fe0a701deb5086ca0e1a8ceecb70dbc17934e6
Signed-off-by: Erick Reyes <erickreyes@google.com>
2019-02-06 15:26:05 -08:00
Erick Reyes
e3518d41d8 meminfo: Fix dmabufinfo total ref accounting
The number of references to a buffer total_refs was not accounting for
a process holding multiple references to the same buffer.

Also, clarify AppendDmaBufInfo functionality in comments

Change-Id: I044a18acad1570492a925d51b9464d5b0e60ca35
Signed-off-by: Erick Reyes <erickreyes@google.com>
2019-02-06 15:26:05 -08:00
Elliott Hughes
eb0ef145fd MappedFile and FileMap should support zero-length mappings.
Bug: http://b/119818070 "app crashes when reading asset of zero length"
Test: ran tests
Change-Id: Idd2ad6f6e72c8e445aff78a460fac96dea41c950
2019-02-06 14:29:35 -08:00
Suren Baghdasaryan
e3ad888011 libprocessgroup: Fix cgroup directory ownership setup
When cgroup directory is created its user and ownership gets set, however
because previous code was storing getpwnam() return value the second
invocation would effectively override the previous ones result. Fix this
by copying necessary results. Also change getpwnam() to getgrnam() when
group name is converted into gid. getpwnam() works because of the way
Android uses these ids, however more generally this is incorrect and
getgrnam() should be used instead.

Bug: 111307099
Test: verified user/group membership of the cgroup directories
Change-Id: I78668bc1a36a74f53d8e9825e2d06e3e09501e7a
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2019-02-06 14:28:23 -08:00
Martin Stjernholm
b78f6ec7ef Add some overview docs for classloader-namespace.
Courtesy of jiyong@.

Test: n/a
Change-Id: I4ee239c63a5b5f90516b05af25b32ff22b147d53
2019-02-06 21:51:27 +00:00
Suren Baghdasaryan
c760231891 libprocessgroup: Fix file mode parsing that requires octal values
JSON supports only decimal values and therefore file mode which should
use octal values has to be represented as strings. Fix the implicit
octal-to-decimal conversion and convert from string to octal in the code.

Bug: 111307099
Test: confirmed by verifying correct file permissions

Change-Id: I3ef9de0aea259f93bf74efeffca72d37d4740e15
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2019-02-06 21:01:41 +00:00
Tom Cherry
1cd082d421 init: allow services to have no capabilities set
In particular, this allows services running as the root user to have
capabilities removed instead of always having full capabilities.

Test: boot device with a root service with an empty capabilities
      option in init showing no capabilities in /proc/<pid>/status
Change-Id: I569a5573ed4bc5fab0eb37ce9224ab708e980451
2019-02-06 11:25:18 -08:00