Commit Graph

35779 Commits

Author SHA1 Message Date
George Burgess IV 12f6c4809e Merge "libsync: Fix a double-free."
am: 16dd491aac

Change-Id: I3df91f1d203423dd5f0ca6335812630c25d8bc01
2017-09-07 21:48:36 +00:00
Treehugger Robot 16dd491aac Merge "libsync: Fix a double-free." 2017-09-07 21:39:53 +00:00
Luis Hector Chavez 721b2d6035 Merge "init: Allow clean system shutdown upon SIGTERM"
am: 61cb88add2

Change-Id: If0a495fa067440f0b59969ac0dbc010b4687b52f
2017-09-07 20:06:58 +00:00
Treehugger Robot 61cb88add2 Merge "init: Allow clean system shutdown upon SIGTERM" 2017-09-07 19:59:29 +00:00
Luis Hector Chavez 9f97f47940 init: Allow clean system shutdown upon SIGTERM
This allows Android to cleanly shutdown when running in a PID namespace
in a way that does not rely on adbd running. This is useful to allow
Android to be running in a container and its lifetime managed by an
OCI-compliant tool.

Bug: 65415372
Test: `kill -TERM 1` as root is correctly dropped.
Test: `kill -TERM 1` from the init PID namespace causes init to cleanly shutdown.
Change-Id: Ia66ebdb436221919081bc4723337c0c7f1e53b09
2017-09-07 10:47:04 -07:00
Christopher Ferris 4044c9ad9f Merge "Add a method to share the process memory object."
am: 18149b6764

Change-Id: I28ca654337aea1549f9d8e7f9f700b90ec01d2f7
2017-09-07 00:16:42 +00:00
Christopher Ferris 18149b6764 Merge "Add a method to share the process memory object." 2017-09-07 00:01:10 +00:00
Tom Cherry c1968fb0c9 Merge "Log pid for writes to sys.powerctl"
am: 2827106d7d

Change-Id: I2fb780c5809d4c18950c114c07a7363723aa121a
2017-09-06 17:09:08 +00:00
Tom Cherry 2827106d7d Merge "Log pid for writes to sys.powerctl" 2017-09-06 16:58:23 +00:00
Jiyong Park bc3ae0aaea Merge "Mark libgrallocusage as vendor_available"
am: 9c8781f479  -s ours

Change-Id: I448037b8c228190df54d7e39b2ad05fc7511302e
2017-09-06 15:59:02 +00:00
Jiyong Park 18e92a5495 Merge "Don't rely on transitively included headers"
am: 45eeea2dcd

Change-Id: I1d822d54a1da50b99c1153335b03d68c331b8d4d
2017-09-06 15:56:53 +00:00
Treehugger Robot 9c8781f479 Merge "Mark libgrallocusage as vendor_available" 2017-09-06 15:52:22 +00:00
Treehugger Robot 45eeea2dcd Merge "Don't rely on transitively included headers" 2017-09-06 15:51:46 +00:00
Ting-Yuan Huang 2ee27bfd0d Merge "Suppress false-positive static analyzer warnings"
am: 0c89aaec1f

Change-Id: Ifa3e4010ee1ce152f17bdc14f4e73d647c05a76a
2017-09-06 05:09:15 +00:00
Treehugger Robot 0c89aaec1f Merge "Suppress false-positive static analyzer warnings" 2017-09-06 05:04:29 +00:00
Jiyong Park bab16584ce Don't rely on transitively included headers
One must explicitly include what it need.
time.h for clock_gettime

Bug: 37629934
Test: build
Change-Id: I992eac637f373b204aa161b0b26f5563e952c27e
2017-09-06 13:04:57 +09:00
Ting-Yuan Huang 249bd05038 Suppress false-positive static analyzer warnings
by hinting the analyzer with assertions.

Test: built without seeing warnings.
Change-Id: I0d43d4ceafd7f68be89cad6c930c85ee7b6d5165
2017-09-05 16:46:40 -07:00
George Burgess IV 4ff5ff29d2 libsync: Fix a double-free.
sync_file_info, the only caller of legacy_fence_info_to_sync_file_info,
unconditionally frees legacy_info after
legacy_fence_info_to_sync_file_info is called. So, if this calloc
fails, we'll end up freeing legacy_info twice.

Bug: 27101951
Test: mma. Static analyzer complaint about double-free is gone.
Change-Id: I43bf820af9aadf30cb8eabce57416f69a8fccf89
2017-09-05 16:26:36 -07:00
Jiyong Park e2bd601fd2 Mark libgrallocusage as vendor_available
libgrallocusage is used by libui which will be vendor_available: true.

Test: BOARD_VNDK_VERSION=current m libgrallocusage is successful
Change-Id: I476768d8b103033f3b8e5b09f53f4ac422ae377c
Merged-In: I476768d8b103033f3b8e5b09f53f4ac422ae377c
2017-09-05 14:49:53 -07:00
Christopher Ferris 5f118519fd Add a method to share the process memory object.
New function to create the process memory object. This allows for
a future where different remote process memory objects could be created
depending on the way remote memory can be created. Even different local
memory objects that access memory without doing any checks.

It also allows MemoryRange objects to share one single process memory object
and could help if the process memory object caches data.

Small changes to MapInfo::CreateMemory to when some errors are detected.
- Always check if the map is a device map, instead of only if the name
  is not empty.
- Check if a memory map is readable before creating the memory from process
  memory.

Bug: 23762183

Test: Ran unit tests, unwound on device using the new code.
Change-Id: I12a93c2dc19639689a528ec41c67bfac74d431b3
2017-09-05 14:30:22 -07:00
Tom Cherry a84e14da1e Log pid for writes to sys.powerctl
Unless a process logs that it is requesting a device to reboot, there
are no logs to show which process triggered a reboot.  This change
introduces such a log in property service such that system initiated
reboots can be clearly blamed back to a calling process.

Bug: 64214361
Test: reboot and check kernel log for reboot string
Change-Id: I18de33d2a0933d20bdb581025b78020c88c5c6eb
2017-09-05 12:47:08 -07:00
Justin Yun 221d3b4c75 Merge "Add vndk tag for libunwindstack which must be a vndk-sp"
am: 6139592321

Change-Id: Ibb4bec5fd4060ac6050beac1fd97cc9497df4ee6
2017-09-05 18:24:51 +00:00
Treehugger Robot 6139592321 Merge "Add vndk tag for libunwindstack which must be a vndk-sp" 2017-09-05 18:19:30 +00:00
kaichieh 1aecf73b43 Merge "Add odm sepolicy support to selinux.cpp"
am: f899548cdb

Change-Id: I33f7ded656fa2e61e130f158a2d8915f68524b91
2017-09-04 04:55:58 +00:00
Treehugger Robot f899548cdb Merge "Add odm sepolicy support to selinux.cpp" 2017-09-04 04:45:33 +00:00
Wei Wang df9ac65c75 Merge "init: add option to read file fully on readahead"
am: d97a1710b8

Change-Id: I2a49bd384b1fe621314916c1f325c03b7fa43162
2017-09-02 03:01:14 +00:00
Treehugger Robot d97a1710b8 Merge "init: add option to read file fully on readahead" 2017-09-02 02:53:53 +00:00
Wei Wang 02628f3b23 init: add option to read file fully on readahead
Bug: 62413151
Test: boottime, dumpcache
Change-Id: I1a7b69f0619428e4db31c5a7639c5d895c89ecdb
2017-09-01 15:15:51 -07:00
Josh Gao 8577f499b6 Merge "libdebuggerd: cleanup."
am: 2b8a95a2a7

Change-Id: Icf6a347c23771894af164265538d3f90e3ecd940
2017-09-01 19:56:17 +00:00
Treehugger Robot 2b8a95a2a7 Merge "libdebuggerd: cleanup." 2017-09-01 19:45:31 +00:00
kaichieh eef4cd7d08 Add odm sepolicy support to selinux.cpp
init: support loading odm sepolicy

Currently init merges two sepolicy cil files:
    - /system/etc/selinux/plat_sepolicy.cil
    - /vendor/etc/selinux/nonplat_sepolicy.cil

This change replaces nonplat_sepolicy.cil with the following two files:
    - /vendor/etc/selinux/declaration/nonplat_declaration.cil
    - /vendor/etc/selinux/vender_sepolicy.cil

And support merging another default (but optional):
    - /odm/etc/selinux/odm_sepolicy.cil.

Bug: 64240127
Test: boot sailfish normally without odm.cil
Test: boot another device having odm.cil
Change-Id: I0b7f8c656c73ddb0fd46f2af3c625d7c81566f2f
2017-09-01 18:13:29 +08:00
Justin Yun 73bd4f05bf Add vndk tag for libunwindstack which must be a vndk-sp
As a VNDK-SP module, Android.bp must have 'vndk' tag as well as
'vendor_available: true'.

The 'vndk' tag for VNDK-SP module is formated as below:
vndk: {
    enabled: true,
    support_system_process: true,
},

VNDK-SP modules will be installed both in system/lib(64) as normal and
in system/lib(64)/vndk-sp as a vendor variant.

Bug: 64395154
Bug: 63866913
Test: build with BOARD_VNDK_VERSION=current
Merged-In: Idb4757988d1799ffcd3341343fcc4dac34bf7ef3
Change-Id: Idb4757988d1799ffcd3341343fcc4dac34bf7ef3
(cherry picked from commit 14d540a156)
2017-09-01 13:40:23 +09:00
Bowgo Tsai 08a8c4209f Merge "Revert "adbd: lessen security constraints when the device is unlocked""
am: 9638729a9d

Change-Id: I25eab992b0a4c2f144454cd5865fad1a762cfc61
2017-08-31 08:27:33 +00:00
Treehugger Robot 9638729a9d Merge "Revert "adbd: lessen security constraints when the device is unlocked"" 2017-08-31 08:21:08 +00:00
Bowgo Tsai 0603ec4294 Revert "adbd: lessen security constraints when the device is unlocked"
This reverts commit f1d3dbc32f.

With the following changes to move /sbin/adbd to /system/bin/adbd,
we don't need this workaround anymore.

  https://android-review.googlesource.com/#/q/topic:move-adbd-to-system+(status:open+OR+status:merged)

Bug: 63313955
Bug: 63381692
Bug: 64822208
Test: 'adb root' works in VTS for a non-A/B device (userdebug GSI + user boot.img)

Change-Id: Ic1249d6abd7d6e6e7380a661df16d25447853a48
2017-08-31 14:30:51 +08:00
Bowgo Tsai f390f04381 Merge "Move adbd from root to system"
am: 3d6f85167e

Change-Id: I3b89a7a8e98252319f850a225ef7ba2080e54879
2017-08-31 06:30:48 +00:00
Treehugger Robot 3d6f85167e Merge "Move adbd from root to system" 2017-08-31 06:22:16 +00:00
Christopher Ferris 863fcdb0ca Merge "Add proper support for embedded elf files."
am: 537c68c8ed

Change-Id: Ia28dbb1bbd02d54602a6256295cccf2def9caf04
2017-08-31 02:25:05 +00:00
Christopher Ferris 537c68c8ed Merge "Add proper support for embedded elf files." 2017-08-31 02:17:41 +00:00
Christopher Ferris 3f805ac3f8 Add proper support for embedded elf files.
- Add a method to get the max size of an elf file by reading the
  section header offset + size. This will properly map an elf
  file embedded into an apk, instead of just mapping in what is done
  by the dynamic linker. It does assume that the section headers are
  at the end of the elf file.
- Add new tests for the above functionality.
- Update the unwind_symbols tool to take an address for finding a
  function instead of dumping the entire symbol table.

Bug: 23762183

Test: Unit tests pass, unwind through the camera process and verify
Test: the GoogleCamera.apk shows some function names.
Change-Id: I00c021680fe1d43b60d652bf91bbf6667d9617be
2017-08-30 15:50:11 -07:00
Tom Cherry 39088d35ee Merge "use a single file for storing persistent properties"
am: e1f9a58c86

Change-Id: Iea9d022eee79e3a4ccf9f5ebc6739d565b6e51b1
2017-08-30 19:42:08 +00:00
Tom Cherry e1f9a58c86 Merge "use a single file for storing persistent properties" 2017-08-30 19:30:18 +00:00
Josh Gao 8949a0255e Merge "base: hopefully fix the mac build."
am: 815f74a759

Change-Id: I335e774a3c6e1ed1fd662552ae158bd232ae6c78
2017-08-30 08:07:27 +00:00
Treehugger Robot 815f74a759 Merge "base: hopefully fix the mac build." 2017-08-30 08:03:32 +00:00
Josh Gao 4221e2cc03 base: hopefully fix the mac build.
Test: none
Change-Id: Idd4f353a158a0c096d16ecf87e239c50aba79cf7
2017-08-29 21:28:32 -07:00
Ting-Yuan Huang 124294a348 Merge "sdcard: mute false compiler alarm"
am: cb4e164562

Change-Id: Iefc21ac2b479095e50a764495843db28bebdffa5
2017-08-30 02:43:07 +00:00
Treehugger Robot cb4e164562 Merge "sdcard: mute false compiler alarm" 2017-08-30 02:31:54 +00:00
Tom Cherry 16fad42007 use a single file for storing persistent properties
We have seen that storing persistent properties in separate files
causes increased boot latency compared to if they were stored in a
single contiguous file.

This change creates a simple format for a contiguously stored property
file, and adds the support for arbitrary characters in the names of
persistent properties, which previously had been restricted.  It has a
mechanism for converting older devices to the new format as well.

Bug: 64392887
Test: boot bullhead with new properties
Test: boot bullhead and verify old properties are converted to the new
      property file
Test: corrupt property file and ensure that it gets recovered from memory
Test: new unit tests
Change-Id: I60d8201d655ce5c97b33faae81d5ca8dbbb21a14
2017-08-29 17:45:06 -07:00
Ting-Yuan Huang 1991ae9459 sdcard: mute false compiler alarm
Clang static analyzer worries that strcpy to a field may overwrites
other fields.  Use snprintf() instead.

Test: built without seeing the warning.

Change-Id: I75d8edf1353b5d052fd14a954362bd0632c258fa
2017-08-29 17:21:13 -07:00
Josh Gao c3706668c6 libdebuggerd: cleanup.
Move libdebuggerd headers into their own directory for namespacing,
move some includes to the top of their implementing files, delete some
dead code.

Test: mma, treehugger
Change-Id: Ie4c44e32e2ab3bc678092899d257fd4ed634aa34
2017-08-29 15:18:46 -07:00