Commit graph

44296 commits

Author SHA1 Message Date
Jooyung Han
55063b1444 Revert "Mark libs as double_loadable"
This reverts commit c624621554.

Reason for revert: These libs are no longer used by libmediandk(aosp/915075)

Change-Id: I5533a3c22263afb21f4053a569c4a646c9766404
2019-03-11 14:10:34 +00:00
Jooyung Han
c624621554 Mark libs as double_loadable
libs(libasyncio libmemtrack libprocinfo libusbhost) have
vendor variants and they are also used by LLNDK(libmediandk)
which means these libs can be double-loaded.

deps:
- libmediandk -> libmedia_jni -> libmtp -> libasyncio
- libmediandk -> libmedia_jni -> libandroid_runtime -> libmemtrack
- libmediandk -> libmedia_jni -> libandroid_runtime -> libdebuggerd_client -> libprocinfo
- libmediandk -> libmedia_jni -> libmtp -> libusbhost

Bug: 121280180
Test: m -j
Change-Id: I2c2b5d67cf47b85a2aa8c08f85c7e1a84490cf4e
2019-02-08 11:48:04 +09:00
Erick Reyes
32afafa67e Merge "meminfo: Fix dmabufinfo total ref accounting" 2019-02-08 01:48:01 +00:00
Treehugger Robot
3dbdf65afc Merge "Freshen libsystem/OWNERS" 2019-02-07 22:33:39 +00: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
4e3a5f61a4 Merge "fs_mgr: overlayfs support legacy devices (marlin)" 2019-02-07 18:03:55 +00:00
Jiyong Park
186661d135 Merge "Configure /system/apex/com.android.runtime.[debug|release]/bin/*" 2019-02-07 16:08:24 +00:00
Elliott Hughes
5f5ffc8e19 Merge "MappedFile and FileMap should support zero-length mappings." 2019-02-07 15:45:03 +00: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
Treehugger Robot
d338c1f8e6 Merge "Add some overview docs for classloader-namespace." 2019-02-07 05:35:46 +00:00
Suren Baghdasaryan
3a22225ac6 Merge "libprocessgroup: Fix file mode parsing that requires octal values" 2019-02-07 04:54:28 +00: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
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
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
Treehugger Robot
bece53e515 Merge "fs_mgr: fstab: logspam from empty flags" 2019-02-06 17:59:42 +00:00
Treehugger Robot
4fdc2ce2bb Merge "apexd: Create top-level /data/apex folders at boot" 2019-02-06 16:58:23 +00:00
Greg Kaiser
54801442bd Merge "libprocessgroup: Disable file descriptor caching temporarily" 2019-02-06 13:48:03 +00:00
Nikita Ioffe
bc744dc98f apexd: Create top-level /data/apex folders at boot
- package manager needs to read from /data/apex/active, hence 0750
- both /data/apex/backups and /data/apex/sessions are internal to apexd,
  hence 0700

Bug: 123927167
Fixes: 123927167
Test: apex_e2e_tests, flashall -w & checked folders were created
Change-Id: I06c28328afe4945d082acd890401651bd37fcb20
2019-02-06 11:49:46 +00:00
Treehugger Robot
54f7e57bac Merge "init: print property/value for wait_for_property" 2019-02-06 07:28:00 +00:00
Treehugger Robot
c03169caea Merge "fs_mgr: Remove fs_mgr_flags #define's" 2019-02-06 02:53:32 +00:00
Suren Baghdasaryan
bee9f5718b libprocessgroup: Disable file descriptor caching temporarily
File descriptor caching breaks boot on Android Go and Svelte targets.
Disable it temporarily to fix the builds and investigate the root cause
further.

Bug: 123868658
Test: Android Go device boots after this change

Change-Id: Idd0209029cde8454ea99b9de030f7a317c2988d7
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2019-02-06 02:15:37 +00:00
Wei Wang
c9352bb383 init: print property/value for wait_for_property
Bug: 123772265
Bug: 123788098
Test: Build
Change-Id: Ice130d7efab1f227a2f9021136621ad08f84fd23
2019-02-06 01:03:53 +00:00
Mark Salyzyn
c0d09a2603 fs_mgr: fstab: logspam from empty flags
If a flag is empty (eg: reading /proc/mounts), skip instead of
reporting "unknown flag: ". Do the same for "defaults".

Test: compile
Change-Id: Ibc3dc7154bbef4bb5dc6522d3226b6ca1e60ec24
2019-02-05 14:31:38 -08:00
Tri Vo
5bccd33e0b Merge "libcutils: route to ashmemd" 2019-02-05 21:38:50 +00:00
Tom Cherry
7dec4fdd38 fs_mgr: Remove fs_mgr_flags #define's
These are no longer used but I missed them in the last CL.

Test: treehugger
Change-Id: Iea5235cf2d105c80a406f0ef020080859c0d2ff7
2019-02-05 13:04:21 -08:00
Tom Cherry
7303edd194 Merge "Remove old C fs_mgr interface" 2019-02-05 17:06:03 +00:00
Anton Hansson
a13b119c3d Merge "Fix asan paths in ld.config" 2019-02-05 16:28:05 +00:00
Anton Hansson
b40f72d0ba Merge "Remove product_services rules if it's merged away" 2019-02-05 16:00:44 +00:00
Anton Hansson
2dae6f035e Fix asan paths in ld.config
As of Id663c5f284e3b4fc65ed8cb8c2da6bcf6542e034, the asan libs
are in the TARGET_COPY_OUT_X subpath of the /data/asan/ dir, rather
than just 'x' unconditionally.

Test: presubmit
Change-Id: I3a515791e237ad10703415ea532c7a089660d8e9
2019-02-05 12:36:58 +00:00
vichang
0b3848bec7 Merge "Expose public libraries from runtime namepsace to classloader namespace" 2019-02-05 12:34:00 +00:00
Anton Hansson
74e8d18a0b Remove product_services rules if it's merged away
TARGET_COPY_OUT_PRODUCT_SERVICES can be equal to
TARGET_COPY_OUT_PRODUCT, in which case the ld.config
lines containing PRODUCT_SERVICES are redundant.

Test: make and diff
Change-Id: I1dc24eb49d37f1ab0faa6eecdb0ccc974321f4ac
2019-02-05 12:27:43 +00:00
Treehugger Robot
31fd0ba559 Merge "Some tests are run from /data/local/tmp, and they need proper namespaces." 2019-02-05 11:04:48 +00:00
Treehugger Robot
54ef09c88e Merge "Reland: "Identify post-apexd crashing processes"" 2019-02-05 03:16:30 +00:00
Tom Cherry
685c2c7b1e Remove old C fs_mgr interface
Remove superfluous fs_mgr flags as well.

Bug: 62292478
Test: tree hugger, fs_mgr_unit_test
Change-Id: Ib307400941b46ca8bcb51d479668efd82fc3ed2d
2019-02-04 15:09:02 -08:00
Treehugger Robot
a42af36002 Merge "Move the tests to postsubmit group" 2019-02-04 21:58:41 +00:00
Zimuzo Ezeozue
23aa17ba42 Reland: "Identify post-apexd crashing processes"
This reverts commit 60b89aee4c.

Reason for revert: Blocking change merged, Icdfbdcc1efca540ac854d4df79e07ee61fca559f

Change-Id: Iec7f0b28ca3326d1dc1d86304751eee5e941235e
2019-02-04 21:41:12 +00:00
Treehugger Robot
6cb668b992 Merge "lmdk: Remove redundant 'if' check" 2019-02-04 20:16:56 +00:00
Dan Shi
5c937a3a5d Move the tests to postsubmit group
The tests are failing on ToT.

Bug: 123852953
Test: None
Change-Id: I2e75c99d913f6954290aa9d6aada8797bf931977
2019-02-04 10:31:32 -08:00
Tri Vo
2891ba09d5 libcutils: route to ashmemd
If libcutils is not a VNDK version and /dev/ashmem is not available,
then ask ashmemd for opened fd to /dev/ashmem.

We rely on SELinux policy to determine what's allowed to open
/dev/ashmem directly.

Bug: 113362644
Test: device boots (in selinux permissive mode)
Change-Id: I93c4fa6044b0bfa5282097c6c32139a8d8f67deb
2019-02-04 10:30:24 -08:00
Treehugger Robot
209070aecd Merge "libprocessgroup: Fix return values" 2019-02-04 18:27:32 +00:00