Commit Graph

38217 Commits

Author SHA1 Message Date
Tom Cherry 2ae2f606f8 Reland "Have property_service create a serialized property_contexts file"
This reverts commit 9822f3c6cc.

Bug: 36001741
Change-Id: I27dd391fc06a3c78e88a65c7931c84de1699f157
2017-12-14 01:58:17 +00:00
Bowgo Tsai 8028189499 first stage mount: support mount points like /vendor/abc
Current syntax of the fstab in device tree (fstab_dt) assumes the
node name is the mount point, which doesn't allow subdir:

    vendor {   <== using "vendor/abc" leads to syntax error in device tree
        compatible = "android,vendor";
        dev = "/dev/block/platform/soc.0/f9824900.sdhci/by-name/vendor";
        type = "ext4";
        mnt_flags = "ro,barrier=1,inode_readahead_blks=8";
        fsmgr_flags = "wait";
    };

This CL adds a new field "mnt_point" in the fstab_dt configuration:

    vendor_abc {
        compatible = "android,vendor_abc";
        dev = "/dev/block/platform/soc.0/f9824900.sdhci/by-name/abc";
        type = "ext4";
        mnt_flags = "ro,barrier=1,inode_readahead_blks=8";
        mnt_point = "/vendor/abc";                          <== new field
        fsmgr_flags = "wait";
    };

The new field is optional and will fallback to using node name as mount
point if it is absent.

Note that this CL also sorts fstab_dt by mount point, because
/vendor needs to be mounted first, which contains a directory
/vendor/abc, before /vendor/abc can be mounted.

Bug: 69955336
Test: first stage mount /vendor/abc on a device
Change-Id: Ie2e519f9801f211a7a221622f32c82bedd00353f
2017-12-14 09:48:26 +08:00
Tom Cherry 26eba2879d Always check prefix matches array at each node
Currently, we only check if the name of a given node in the trie is a
prefix match and the prefix matches array of the final node.  This is
incorrect however, as the prefix matches array of intermediate nodes
may contain the prefix for a given property.  This change adds that
check and test cases for this case.

Bug: 36001741
Test: new unit tests
Change-Id: I9f58ebc559f2ac591aa44df9e71205704bf18f66
2017-12-13 16:58:33 -08:00
Tom Cherry 212257dbb9 Merge "Revert "Have property_service create a serialized property_contexts file"" 2017-12-13 22:48:59 +00:00
Robert Greenwalt 9822f3c6cc Revert "Have property_service create a serialized property_contexts file"
This reverts commit e8181c0f55.

Reason for revert: This is broken.

Bug: 36001741

Change-Id: I458abc23275ecdfadcabacd611b288449196efa0
2017-12-13 14:42:26 -08:00
Dan Albert 629c292dbb Include what we use.
Test: mma
Bug: None
Change-Id: Id8742db719906847bf40506ae8a79cea8bc092dc
Exempt-From-Owner-Approval: trivial cleanup
2017-12-13 13:41:14 -08:00
Treehugger Robot 69ee1c9418 Merge "Add an extra set of test cases for libpropertyinfoparser" 2017-12-13 16:55:24 +00:00
Logan Chien 97772e425b android.hardware.graphics.allocator@2.0 is no longer VNDK-SP
The interface lib has been in VNDK-SP because
android.hardware.graphics.mapper@1.0 was using it. However, since the
dependency has gone [1], there is no need keep it in VNDK-SP. The
VNDK-SP set should be kept as small as possible because libs in VNDK-SP
are subject to double-loading.

[1] 79d13ff0f5

Bug: 69480083
Test: /system/lib64/vndk-sp/android.hardware.graphics.allocator@2.0.so
disappears.
Test: sailfish boots

Change-Id: I0e6518f169dd620d6b1a9ada47754e371ef4a739
Merged-In: I0e6518f169dd620d6b1a9ada47754e371ef4a739
(cherry picked from commit 9d898f3678)
2017-12-13 17:05:14 +09:00
Treehugger Robot 5dde5e38d2 Merge "/vendor/priv-app is added to the permitted paths for the default ns" 2017-12-13 02:34:19 +00:00
Vishwath Mohan 32c03800c0 Merge "Fix asan permitted paths in the default namespace." 2017-12-13 02:08:30 +00:00
Treehugger Robot a6e6780418 Merge "Add VNDK version for namespace configuration files" 2017-12-13 01:49:41 +00:00
Tom Cherry 8cc596208c Add an extra set of test cases for libpropertyinfoparser
Test to ensure that exact matches and prefix matches at the root level
work.

Test: these test cases
Change-Id: Idb296329c4c4f1bb1ba336b5cb12d5761239fbf8
2017-12-12 17:33:55 -08:00
Justin Yun 210ff9485d Add VNDK version for namespace configuration files
If PLATFORM_VNDK_VERSION is set to a version other than "current",
add the version to the file names of the namespace configuration
files.

Bug: 69883025
Test: device boot
Change-Id: I27377549581125b6c750c1422d0ee4a607dda5e8
2017-12-13 10:31:04 +09:00
Tom Cherry c47dd6b5c0 Merge changes from topic "property-trie"
* changes:
  Have property_service create a serialized property_contexts file
  Parse property contexts via a serialized trie
2017-12-13 01:28:36 +00:00
Treehugger Robot 43e063f027 Merge "Load versioned llndk.libraries.txt and vndksp.libraries.txt" 2017-12-13 01:28:31 +00:00
Justin Yun 4a1d11038f Load versioned llndk.libraries.txt and vndksp.libraries.txt
When ro.vndk.version has a specific VNDK version in it, use the
llndk.libraries.txt and vndksp.libraries.txt files with the version
suffix in the file names.
If ro.vndk.version is "current" or not set, the version suffix will
not be added.
This is to use a proper VNDK snapshot version configuration for a
vendor patition.

Bug: 69531793
Test: In system/etc directory of a Pixel2 device,
  Change llndk.libraries.txt to llndk.libraries.27.txt
  Change vndksp.libraries.txt to vndksp.libraries.27.txt
  Set ro.vndk.version to 27 in vendor/default.prop
  reboot and check if vendor apks work.

Change-Id: I82d83b6805799ea71cc88d1e0297d265a40c0061
2017-12-13 10:27:28 +09:00
Vishwath Mohan cede134907 Fix asan permitted paths in the default namespace.
This CL fixes an error with the asan permitted paths in
ld.config.txt.in.

Bug: 63927538
Test: lunch walleye_asan-userdebug && m -j40
Change-Id: Ica0504cb52ef6e6b3e4ce2deae3ce5984e38cc93
2017-12-12 16:17:41 -08:00
Treehugger Robot c034cd5d04 Merge "Use normalize-path-list" 2017-12-12 08:03:53 +00:00
Jiyong Park b52ff3e247 Use normalize-path-list
Let's use the existing macro.

Test: build walleye, boots to the UI.
Change-Id: Ic23d3454c629a02bfd96d0ca19c0c5c068ae7a03
2017-12-12 12:13:38 +09:00
Elliott Hughes bf2062f800 Merge "Set $TMPDIR for `adb shell`." 2017-12-12 00:29:50 +00:00
Treehugger Robot e78accb103 Merge "ASAN: Remove old list of services" 2017-12-12 00:15:31 +00:00
Tom Cherry e8181c0f55 Have property_service create a serialized property_contexts file
Instead of requiring each process to parse the property contexts files
in libc initialization, this change has property_service parse these
files one into a serialized trie, which the property code in libc can
then directly interpret for mapping property names to their associated
SELinux context.

Bug: 36001741
Test: boot bullhead, walleye, run unit tests

Change-Id: If67073d56e800b3ca667fb5322e6b993e7d810f6
2017-12-11 16:12:13 -08:00
Tom Cherry d853f77ed3 Parse property contexts via a serialized trie
Currently, whenever a new program starts, libc initializes two data
structures related to properties from the raw property_context files.
There are two problems here,
1) This takes roughly 1.2ms on a trivial program to generate contents
   that could otherwise be cached.
2) One of the data structures is a descending list of prefixes, each
   of which needs to be checked, whereas a trie would be more
   efficient.

This change introduces two libraries,
1) libpropertycontextserializer meant to be used by property_service
   to create a serialized trie containing all of the property
   contexts.
2) libpropertycontextparser meant to be used by libc's property
   functions to parse this serialized trie during property lookup.

This new trie also contains the ability to have exact matches instead
of prefix matches for properties, which was not possible before.

Bug: 36001741
Change-Id: I42324f04c4d995a0e055e9685d79f40393dfca51
2017-12-11 16:11:42 -08:00
Christopher Ferris 515bff81fe Merge "Add libunwindstack support for Mips and Mips64" 2017-12-11 21:06:26 +00:00
Yabin Cui 80bfeeef88 Merge "libBacktraceOffline: try both .debug_frame and .ARM.exidx on arm." 2017-12-11 20:37:26 +00:00
Andreas Gampe 27b8fcdfcf ASAN: Remove old list of services
Remove list of services and support for asan.options. This has not
been used in a while, and there is contention about listing names
of device-specific services.

Bug: 70387666
Test: m
Change-Id: I766c6b3a0c44b6b992a3259a3c4215a688452907
2017-12-11 11:36:17 -08:00
Treehugger Robot 6f29887c71 Merge "adb: get libusb compiling on Windows." 2017-12-11 19:24:41 +00:00
Elliott Hughes d42df42f30 Set $TMPDIR for `adb shell`.
Bug: http://b/19635681
Test: printenv
Change-Id: I21e89b9d7cccad23f32a3062a9e04e59b8278104
2017-12-11 10:40:57 -08:00
Douglas Leung 61b1a1ae77 Add libunwindstack support for Mips and Mips64
This patch requires v3.18 kernel or above, because v3.10 kernel
has a bug (as of 8/1/2017) in the ptrace(GETREGSET) function for mips
and mips64.

Change-Id: I004c1fa190193eebe1c84440b366289122a6bd8a
Signed-off-by: Douglas Leung <douglas.leung@mips.com>
Signed-off-by: Dejan Jovicevic <dejan.jovicevic@mips.com>
2017-12-11 15:44:40 +01:00
Treehugger Robot 84de4c0a89 Merge "Use versioned VNDK directories in ld.config.txt" 2017-12-11 02:16:43 +00:00
Yabin Cui 0ca49b09ad libBacktraceOffline: try both .debug_frame and .ARM.exidx on arm.
Currently, libBacktraceOffline doesn't try .ARM.exidx if a function
appears in .debug_frame. This make it can't unwind through functions
appear in both .debug_frame and .ARM.exidx, but having dwarf instructions
not accepted by libunwind.
This patch fixes this by trying first .debug_frame then .ARM.exidx on arm.

Bug: http://b/69383534
Test: run libbacktrace_test on arm.

Change-Id: Ib95dd56d5cc123a20948e880b51b28ddc04b4a6e
2017-12-10 18:00:35 -08:00
Justin Yun 44bb46f604 Use versioned VNDK directories in ld.config.txt
All vndk/vndk-sp directories will have version suffix if
"ro.vndk.version" is set.

Bug: 69984421
Bug: 66074376
Test: Build with BOARD_VNDK_VERSION=current and
      BOARD_VNDK_RUNTIME_DISABLE=true. Check boot.

Change-Id: I03849f9f96bc6c7880aa70c517e963aab4e033b8
2017-12-11 10:58:51 +09:00
Elliott Hughes d65c6ba955 Merge "Add lmkd/OWNERS." 2017-12-09 18:47:57 +00:00
Christopher Ferris 70a454e25b Merge "Do not check arch for format check." 2017-12-09 03:23:18 +00:00
Christopher Ferris 4dac55d5fd Merge "Make sure at least XX maps are created." 2017-12-09 03:22:41 +00:00
Treehugger Robot fd3225492b Merge "Fix media on W/T" 2017-12-09 00:48:52 +00:00
Elliott Hughes ad4e3e2f54 Add lmkd/OWNERS.
Bug: N/A
Test: N/A
Change-Id: Ic4970a95d799c16ffe06bc94a85adabc18d6cc0b
2017-12-08 16:12:58 -08:00
Christopher Ferris 02fdb569f6 Do not check arch for format check.
Use a generic check if the address is 32 bits when using the default
formating of a backtrace line instead of an arch check.

Test: New unit tests pass.
Change-Id: Id609abc037d7b437a02d52763aa91fbefe5f4d5b
2017-12-08 15:44:14 -08:00
Josh Gao 9425996b45 adb: get libusb compiling on Windows.
This still doesn't work yet because libusb doesn't support hotplug on
Windows yet, but it's in the milestones for the next libusb release,
and this is enough to start poking around with the WinUSB device-side
stuff, so leave it broken for now.

Bug: http://b/68993980
Test: set ADB_LIBUSB=1; adb.exe server nodaemon aborts in the expected place
Change-Id: Icef7d46e31c847d6a8e724c6f58ae5db43673c16
2017-12-08 13:11:15 -08:00
Christopher Ferris 88b48f7b18 Make sure at least XX maps are created.
Rather than expect exactly one set of maps, make sure there are at
least XX number of maps.

Test: Ran the 32 bit and 64 bit variants of the benchmarks.
Change-Id: I34184eab3810e92e7f246aa810ddb18fab443c9a
2017-12-08 12:48:46 -08:00
Treehugger Robot a4a9a81d38 Merge "adb: disable USB packet overflow checking on OS X." 2017-12-08 20:31:51 +00:00
Christopher Ferris 70f7d47f3c Merge "Add method to detect remote read function to use." 2017-12-08 20:09:34 +00:00
Christopher Ferris e328673a30 Add method to detect remote read function to use.
The process_vm_read function is much faster than ptrace, but sometimes
that will not work on a remote process. Modify the libunwindstack
MemoryRemote object to figure out which one it can use.

Wrote new unit test to verify this checking behavior.

Modify libbacktrace so that the read from libunwind is used instead of
using the default ptrace calls.

Add some benchmarks to libbacktrace to compare the two different methods.

Test: Ran unit tests libbacktrace/libunwindstack/debuggerd.
Test: Ran debuggerd -b <SYSTEM_SERVER_PID>
Test: Ran debuggerd -b <MEDIACODEC PID>
Test: Ran debuggerd -b <RANDOM_PID>
Test: Used crasher to create tombstones and verified stack data is
Test: dumped properly.
Change-Id: If75ca238289532dd8e1de430d569cabb2523380a
2017-12-07 19:00:00 -08:00
Jaegeuk Kim cf27dbacaf Merge "fastboot: support make_f2fs and sload_f2fs for win32" 2017-12-08 00:58:05 +00:00
Jaegeuk Kim ec87074542 Merge changes from topic "sload_f2fs"
* changes:
  fastboot/fs_mgr/init: add sload_f2fs
  fs_mgr: format f2fs with length=xx fstab
2017-12-08 00:57:42 +00:00
Treehugger Robot b07cc5e0c0 Merge changes I3978cbe2,I7b8e1232
* changes:
  Reland "Prevent vendors from accessing private VNDK libs"
  Permitted and search path change
2017-12-08 00:50:34 +00:00
Elliott Hughes 3289b9c928 Merge "Add OWNERS." 2017-12-07 23:21:26 +00:00
Elliott Hughes 693d63f9cf Add OWNERS.
Bug: N/A
Test: N/A
Change-Id: Ie785058c0f5eb9b4086c98ccba6e63e3ed411b65
2017-12-07 13:30:03 -08:00
Andrew Chant 255c43cd05 Merge "usblib: fix race & delay waiting for perms on open" 2017-12-07 18:49:40 +00:00
Elliott Hughes dcc0f8f76b Merge "Add a /bin symlink for convenience." 2017-12-07 16:55:25 +00:00