Commit graph

45154 commits

Author SHA1 Message Date
Nick Kralevich
73c91cbc1f Merge "relax /system/bin directory permissions" am: b5ab83903c
am: ee6c1be99d

Change-Id: Ifa5cb940d40586cf44446e95d580002fd94cc8c6
2018-12-13 15:31:39 -08:00
Nick Kralevich
ee6c1be99d Merge "relax /system/bin directory permissions"
am: b5ab83903c

Change-Id: I5595e331bf2f956694ee53bef183e64c33b98036
2018-12-13 14:51:46 -08:00
Tom Cherry
8cfa1877fb Merge "Allow specifying vbmeta/parts via fstab" am: 41216e591b
am: 3028c9f3f2

Change-Id: I5ef079d0cb35b79acccc469bf613cdf563b9b9b2
2018-12-13 14:16:02 -08:00
Mark Salyzyn
8437a7c5ad Merge changes Ic9957cb3,If7ae257c am: 8f3ed62422
am: 9529bbe0e7

Change-Id: I72bae66ae95b3afc8c2ba714382609b484f54517
2018-12-13 14:11:38 -08:00
Tom Cherry
3028c9f3f2 Merge "Allow specifying vbmeta/parts via fstab"
am: 41216e591b

Change-Id: I7459b96ff84e9cbff0ef76a2d10882aea4532c38
2018-12-13 13:56:42 -08:00
Mark Salyzyn
9529bbe0e7 Merge changes Ic9957cb3,If7ae257c
am: 8f3ed62422

Change-Id: I9653f1d2aed8cc652505d8ed582248cfe246d284
2018-12-13 13:52:59 -08:00
Xin Li
f9383ce857 [automerger skipped] Merge "DO NOT MERGE - Merge pie-platform-release (PPRL.181205.001) into master" am: 72335650ef -s ours
am: 77f2dbffe1  -s ours

Change-Id: I82cb4a43872bce49efafecb846321ff05dc4c6d9
2018-12-13 13:34:39 -08:00
Xin Li
77f2dbffe1 [automerger skipped] Merge "DO NOT MERGE - Merge pie-platform-release (PPRL.181205.001) into master"
am: 72335650ef  -s ours

Change-Id: I37442bf00664f54412453aec8c812213609f1c56
2018-12-13 13:30:27 -08:00
Treehugger Robot
b5ab83903c Merge "relax /system/bin directory permissions" 2018-12-13 20:54:25 +00:00
Xin Li
fc7913888a [automerger skipped] DO NOT MERGE - Merge pie-platform-release (PPRL.181205.001) into master am: 2f2f638fdf -s ours
am: 0acfc87001  -s ours

Change-Id: I71bc8d4951bfdbbac6647f875827b7e1c217106e
2018-12-13 12:21:31 -08:00
Xin Li
0acfc87001 [automerger skipped] DO NOT MERGE - Merge pie-platform-release (PPRL.181205.001) into master
am: 2f2f638fdf  -s ours

Change-Id: Ieb3bb5fae81eebeca7596ca4901c2dc77ec8733e
2018-12-13 11:26:27 -08:00
Christopher Ferris
dd81e8d29a Merge "Fix handling of ro segments for embedded libs." am: 583ce2deff
am: 1b080f4548

Change-Id: Id71f26babe8614a996d09e6af34df73ae85ac83d
2018-12-13 11:11:52 -08:00
Josh Gao
7cf23f663e Merge changes I042f25f8,I973f42c5,Icb4acea5 am: 78f94a39f2
am: 96cf6ece63

Change-Id: Ia672a2208917083908b6eaff18f582da1e360919
2018-12-13 11:11:11 -08:00
Tom Cherry
1a28bf2d81 Merge "fs_mgr: remove -Wno-unused-variable from cflags" am: fc216d664a
am: b65ce990fa

Change-Id: I3267bdb550fab611157f74c90b7ad926c56d10d2
2018-12-13 11:09:51 -08:00
Nick Kralevich
53842f8a90 relax /system/bin directory permissions
In commit f4fc922f0b, we tightened the
permissions on various bin directories. Please see
https://android-review.googlesource.com/c/platform/system/core/+/822955
for details.

This change causes the Chase banking app to crash. This is because
the Chase app is using inotify_add_watch() on the /system/bin directory
and not checking the return value.

The Android Security model guarantees the immutability of files in
/system/bin, so the inotify watch is unnecessary.

Until the Chase app fixes their bug, we need to relax the permissions on
the /system/bin directory. Conceptually, this is a partial revert of
f4fc922f0b.

Bug: 119605322
Test: compiles
Change-Id: Ic72dd24cb27cff677093963bdfd0ae09bf132e08
2018-12-13 10:56:33 -08:00
Christopher Ferris
1b080f4548 Merge "Fix handling of ro segments for embedded libs."
am: 583ce2deff

Change-Id: I525d51e3f5aab094f4ce374d7eca27d02bf444ca
2018-12-13 10:51:00 -08:00
Josh Gao
96cf6ece63 Merge changes I042f25f8,I973f42c5,Icb4acea5
am: 78f94a39f2

Change-Id: I5d42e99e6b518c6379c242df51089fc3dd5e526f
2018-12-13 10:50:25 -08:00
Tom Cherry
b65ce990fa Merge "fs_mgr: remove -Wno-unused-variable from cflags"
am: fc216d664a

Change-Id: Ia378eb64aa3df5564d7bd5aa4c1fc8160174b9af
2018-12-13 10:49:33 -08:00
Tom Cherry
41216e591b Merge "Allow specifying vbmeta/parts via fstab" 2018-12-13 18:24:34 +00:00
Treehugger Robot
8f3ed62422 Merge changes Ic9957cb3,If7ae257c
* changes:
  fs_mgr: adb-remount-test in non overlayfs world
  fs_mgr: errno handling in fs_mgr_overlayfs_setup()
2018-12-13 15:32:14 +00:00
Treehugger Robot
72335650ef Merge "DO NOT MERGE - Merge pie-platform-release (PPRL.181205.001) into master" 2018-12-13 05:45:20 +00:00
Christopher Ferris
583ce2deff Merge "Fix handling of ro segments for embedded libs." 2018-12-13 03:18:58 +00:00
Josh Gao
78f94a39f2 Merge changes I042f25f8,I973f42c5,Icb4acea5
* changes:
  adbd: add source/sink services.
  adb: make `adb raw` bidirectional.
  adb: remove incorrect use of RTTI.
2018-12-13 01:26:49 +00:00
Treehugger Robot
fc216d664a Merge "fs_mgr: remove -Wno-unused-variable from cflags" 2018-12-12 22:27:46 +00:00
Mark Salyzyn
da27fa0b53 fs_mgr: adb-remount-test in non overlayfs world
Extend test script to check non overlayfs case too.  Establish
whether overlayfs is supported, or needed, and adjust expectations.
For the flash vendor code, make sure it is the _right_ vendor,
skip instead of fail.

Improve quality of the testing and handle more cases.

Test: adb-remount-test.sh
Bug: 109821005
Change-Id: Ic9957cb378d8e7737ffc4ba04078c1cb6bbd1bbd
2018-12-12 14:21:42 -08:00
Mark Salyzyn
d202c55453 fs_mgr: errno handling in fs_mgr_overlayfs_setup()
Do not report errno if ENOENT or ENXIO as it is expected when verity
is in fact disabled or not setup on platform.

Reading the default fstab can also result in ENOENT if fstab or dt
are missing on purpose, but if we get an fstab then restore the
errno as we move on.

fs_mgr_has_shared_blocks sets errno, when all we care about is yes
or no answer (EPERM notwithstanding, which indicates do not know).

If no candidates are found to override, and not caused by EPERM,
then suppress errno.

Test: adb-remount-test.sh
Bug: 109821005
Change-Id: If7ae257cb6b738a64ba43d32805760cc292b2fae
2018-12-12 14:21:10 -08:00
Tom Cherry
de545a4bb3 Allow specifying vbmeta/parts via fstab
We want to move all information required for first stage mount into
the first stage ramdisk instead of using device tree.  A previous
change allowed reading the fstab from the first stage ramdisk, but
'vbmeta/parts' was still in device tree.  This change allows
specifying the required vbmeta/parts information in the fstab.

The new syntax is that instead of simply specifying 'avb' as an fs_mgr
option, a partition may specify 'avb=<vbmeta partition name>' and that
vbmeta partition will also be initialized by first stage init before
attempting to mount any devices.

Bug: 117933812
Test: boot crosshatch without device tree fstab
Change-Id: Ida1a6da988c10d364b3ccdaa6c5d63e5264d1b27
2018-12-12 13:58:44 -08:00
Josh Gao
6eb788298b adbd: add source/sink services.
Add some services that skip the service fd to see how much of a benefit
it'll be to eliminate it.

Test: adb raw source:$((300 * 1024 * 1024)) | pv > /dev/null
Test: dd if=/dev/zero bs=1M count=100 | pv | adb raw sink:$((100 * 1024 * 1024))
Change-Id: I042f25f85b16ae9869cb1f1e306d8671b024ed97
2018-12-12 12:54:28 -08:00
Josh Gao
e89a55dd41 adb: make adb raw bidirectional.
Test: adb raw shell:
Change-Id: I973f42c55c71ffd125e58f76d29100a2d5b0c308
2018-12-12 12:54:28 -08:00
Josh Gao
ce5ce87a66 adb: remove incorrect use of RTTI.
We were dynamic_casting to UsbConnection to check for USB connections,
but the actual type was a BlockingConnectionAdapter wrapping a
UsbConnection, with the result that unplugging an inaccessible (due to
permissions) device on Linux wouldn't make the device go away.

Test: manual
Change-Id: Icb4acea5fd3c3baa9691698686213e122e898e4a
2018-12-12 12:54:03 -08:00
Tom Cherry
898b642d8a fs_mgr: remove -Wno-unused-variable from cflags
Don't know why this was ever specified, but seems reasonable to remove
it now that we're so close.

Test: build
Change-Id: Ia8d056cd1c9660b3c22531317098ace78e661d6a
2018-12-12 10:30:10 -08:00
Yi Kong
1618aef64f Merge "Ignore null-pointer-arithmetic warning from dlmalloc include" am: 25a83f0176
am: 78f6832bd1

Change-Id: I9caa896da8ccfee1071eff2daacbe4ab89c1f2eb
2018-12-12 10:27:37 -08:00
Yi Kong
78f6832bd1 Merge "Ignore null-pointer-arithmetic warning from dlmalloc include"
am: 25a83f0176

Change-Id: I28e8d63ea5df8f10d3a75c51a490c62d812b9c9a
2018-12-12 10:22:32 -08:00
Chih-Hung Hsieh
9ba56aa686 Merge "Fix performance-for-range-copy warnings" am: fe3becb56b
am: e3092f6eea

Change-Id: I8675876b6b3c54c4fe02506feaea7aeb862eacd2
2018-12-12 10:10:13 -08:00
Tom Cherry
86c33b9d16 Merge "Start using new C++ Fstab class widely" am: 07eea062d5
am: 7481fe9316

Change-Id: I3b201cd80e90efc9f355673a2ed2a68979fb5fd1
2018-12-12 10:09:30 -08:00
Treehugger Robot
25a83f0176 Merge "Ignore null-pointer-arithmetic warning from dlmalloc include" 2018-12-12 18:08:01 +00:00
Chih-Hung Hsieh
e3092f6eea Merge "Fix performance-for-range-copy warnings"
am: fe3becb56b

Change-Id: I143ea8b6ad519e2ce3e404cf7a8a95fb3eb4d08f
2018-12-12 10:05:37 -08:00
Tom Cherry
7481fe9316 Merge "Start using new C++ Fstab class widely"
am: 07eea062d5

Change-Id: I9b362037be9e4a105e2386cbd8e513e324550a04
2018-12-12 10:04:13 -08:00
Treehugger Robot
fe3becb56b Merge "Fix performance-for-range-copy warnings" 2018-12-12 17:46:46 +00:00
Tom Cherry
07eea062d5 Merge "Start using new C++ Fstab class widely" 2018-12-12 17:42:45 +00:00
Tom Cherry
23319ebebf Start using new C++ Fstab class widely
Bug: 62292478
Test: boot
Test: adb-remount-test.sh

Change-Id: Id4715af4c1f03e2cfc67de92d3ea58e933685e51
2018-12-12 17:08:09 +00:00
Martin Stjernholm
ecc3a35e04 Merge "Linker namespace configuration for the Runtime APEX." am: bd660496c8
am: 49b81b9332

Change-Id: Id42fab1c040b8619896e446d9814fe3c8ed3a55d
2018-12-12 07:55:11 -08:00
Martin Stjernholm
49b81b9332 Merge "Linker namespace configuration for the Runtime APEX."
am: bd660496c8

Change-Id: I5233cbc177818fe91624867e7c84188356b85a73
2018-12-12 07:44:47 -08:00
Martin Stjernholm
bd660496c8 Merge "Linker namespace configuration for the Runtime APEX." 2018-12-12 15:36:35 +00:00
Martin Stjernholm
f1038896ad Linker namespace configuration for the Runtime APEX.
Needs to support e.g. app_process in "default" -> libnativehelper in
"runtime" -> platform libs in "default" -> libc etc in "runtime".

Always make sure to switch namespaces when switching library paths between
/system and the APEX, so that internal library dependencies in both
locations are loaded from their own directory. E.g. libc++ and libbase live
in both places, and their dependents must always load the version they were
compiled with.

Bug: 119867084,113373927
Test: Flash and reboot device
Test: Remount / read-write, then on device: rm -f system/lib{,64}/lib{c,m,dl}.so; system/bin/dex2oat -h; stop && start
Test: mmma bionic/tests/ && adb root && adb shell rm -rf /data/nativetest\* && adb push out/target/product/taimen/data/nativetest* /data/ && adb shell /data/nativetest64/bionic-unit-tests/bionic-unit-tests && adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests
Test: cts-tradefed run commandAndExit cts -m CtsJniTestCases
Change-Id: I6c4fc2f1abea1fb8851546e258ffaaa4ef6fe7d0
2018-12-12 11:44:07 +00:00
Yi Kong
e9ce7aa8ab Ignore null-pointer-arithmetic warning from dlmalloc include
system/core/libpixelflinger/codeflinger/../../../../external/dlmalloc/malloc.c:4286:61: error: arithmetic on a null pointer treated as a cast from integer to pointer is a GNU extension [-Werror,-Wnull-pointer-arithmetic]
        if (!is_inuse(p) && (char*)p + psize >= base + size - TOP_FOOT_SIZE) {
                                                            ^~~~~~~~~~~~~
  system/core/libpixelflinger/codeflinger/../../../../external/dlmalloc/malloc.c:2731:17: note: expanded from macro 'TOP_FOOT_SIZE'
    (align_offset(chunk2mem(0))+pad_request(sizeof(struct malloc_segment))+MIN_CHUNK_SIZE)
     ~~~~~~~~~~~~~^~~~~~~~~~~~~
  system/core/libpixelflinger/codeflinger/../../../../external/dlmalloc/malloc.c:2218:55: note: expanded from macro 'chunk2mem'
  #define chunk2mem(p)        ((void*)((char*)(p)       + TWO_SIZE_T_SIZES))
                                                      ^
  system/core/libpixelflinger/codeflinger/../../../../external/dlmalloc/malloc.c:1622:14: note: expanded from macro 'align_offset'
   ((((size_t)(A) & CHUNK_ALIGN_MASK) == 0)? 0 :\

Test: m checkbuild
Bug: 72331524
Change-Id: Iefc3b4ae6b36ba9f6cb908c03301cbe429ade320
2018-12-11 23:08:32 -08:00
Greg Kaiser
af2f0afbbd Merge "fs_mgr_fstab: Add Adiantum support" am: bb81135fda
am: 27740d4d3e

Change-Id: I0d94691d4badc1814fd1993484e5ddefb223442c
2018-12-11 21:24:09 -08:00
Greg Kaiser
27740d4d3e Merge "fs_mgr_fstab: Add Adiantum support"
am: bb81135fda

Change-Id: Ic5f90dbd5301e46a2f96d706f21f51e7ba5951dc
2018-12-11 21:15:15 -08:00
Greg Kaiser
bb81135fda Merge "fs_mgr_fstab: Add Adiantum support" 2018-12-12 04:59:25 +00:00
Christopher Ferris
01040b10b2 Fix handling of ro segments for embedded libs.
When a shared library is loaded directly from an apk, the new way the
linker splits a shared library into a read-only and execute segment
broke unwinding. Modify the code to handle this case.

Other changes:
- Modify the algorithm for finding read-only map entries. Before, the code
  would search the entire map for the closest offset. Now it simply looks
  at the previous map. I did this because the old code was too lenient and
  might still work even if the linker changes. I want this to break if the
  linker behavior changes so that I can analyze the change.
- Update the tools to use PTRACE_SEIZE instead of PTRACE_ATTACH since
  PTRACE_ATTACH doesn't work in all cases.
- Small refactor of the GetFileMemory function.
- Add new unit test cases and new offline unwind test cases.

Bug: 120618231

Test: Ran new unit tests, ran original failing test.
Change-Id: I4bade55cf33220d52f1d5e9b0cbbbcc8419669d4
2018-12-11 19:16:29 -08:00