Commit graph

29998 commits

Author SHA1 Message Date
Keun-young Park
cccb34fce8 add "shutdown critical" to service
- "shutdown critical" prevents killing the service during
  shutdown. And the service will be started if not running.
- Without it, services will be killed by SIGTERM / SIGKILL during shutdown.
- Even services with "shutdown critical" will be killed if shutdown
  times out.
- Removes ueventd and vold from hard coded list. Each service's rc will
  be updated to add "shutdown critical". watchdogd is still kept in the list.

bug: 37626581
Test: reboot and check last kmsg

Change-Id: Ie8cc699d1efbc59b9a2561bdd40fec64aed5a4bb
2017-07-05 14:55:22 -07:00
Treehugger Robot
eb42bb8c8b Merge "zlib is not exposed to libziparchive headers" 2017-07-03 19:30:45 +00:00
Jiyong Park
e7cf680ccc zlib is not exposed to libziparchive headers
By forward-declaring zstream, we don't need to re-export zlib headers.

Bug: 37342627
Test: build
Test: BOARD_VNDK_VERSION=current m -j dumpstate (or any other module
using libziparchive)

Change-Id: Ia69e5d459c79878d491cfe4ca21a7cc8fed4a5d8
2017-07-03 17:44:07 +00:00
Treehugger Robot
7b44858b91 Merge "libziparchive headers are moved to local directory" 2017-07-03 08:06:40 +00:00
Treehugger Robot
aa82721894 Merge "Ran clang-format on libziparchive sources and headers" 2017-07-03 00:45:16 +00:00
Jiyong Park
cdf7ff8e20 libziparchive headers are moved to local directory
libziparchive headers are moved from the global include directory
(/system/core/include) to the local directory inside libziparchive.

Note: /system/core/include/ziparchive still exists as a symlink to
libarchive/include/ziparchive. This will be removed when there is no
header-only dependency to libziparchive.

Bug: 37342627
Test: build
Change-Id: I3631ffc2df7be8a064d64a625d10436090c3bb0f
2017-07-02 04:33:34 +00:00
Jiyong Park
cd997e6094 Ran clang-format on libziparchive sources and headers
Test: build aosp_arm
Change-Id: I469b82b68f2c457f480fb9cd9da2026672985ce3
2017-07-02 11:46:53 +09:00
Treehugger Robot
22de50d351 Merge "Remove unnecessary SELinux dependencies" 2017-07-01 16:35:17 +00:00
Nick Kralevich
33391dad15 Remove unnecessary SELinux dependencies
These are unused.

Test: code compiles.
Change-Id: Idd707dfcc8f6daac3a489c791ecc364841cf31f9
2017-07-01 07:41:48 -07:00
Treehugger Robot
c10e14110a Merge "init: Read previous state of securebits before modifying" 2017-07-01 00:20:50 +00:00
Luis Hector Chavez
f5965519d1 init: Read previous state of securebits before modifying
When Android is running in a container, some of the securebits might be
locked, which makes prctl(PR_SET_SECUREBITS) fail.

This change gets the previous state of the process' securebits and adds
the desired bits.

Bug: 62388055
Test: aosp_bullhead-eng boots
Test: If init has non-zero securebits, it can also boot
Change-Id: Ie03bf2538f9dca40955bc58314d269246f5731bd
2017-06-30 14:42:46 -07:00
Treehugger Robot
c997cd64dc Merge "logd + liblogd to Android.bp" 2017-06-30 19:32:41 +00:00
Treehugger Robot
67897d47ce Merge changes Ie89f709b,Ibf543a7d,I1d8092a1
* changes:
  Fix out of bound read in libziparchive
  Check filename memory bound when parsing ziparchive
  Fix out of bound access in libziparchive
2017-06-30 15:38:13 +00:00
Tianjie Xu
0fda1cf633 Fix out of bound read in libziparchive
We should check the boundary of central directory before checking its
signature. Swap the order of these two checks.

Bug: 36392138
Test: libziparchive doesn't read the signature after boundary check fails.
Merged-In: Ie89f709bb2d1ccb647116fb7ccb1e23c943e5ab8
Change-Id: Ie89f709bb2d1ccb647116fb7ccb1e23c943e5ab8
(cherry picked from commit 74464a1361)
2017-06-30 17:19:56 +09:00
Tianjie Xu
9e020e2d11 Check filename memory bound when parsing ziparchive
Add a check to ensure the filename boundary doesn't exceed the mapped
memory region. Also add the corresponding unit test.

Bug: 28802225
Test: New unit test passes.
Merged-In: Ibf543a7da3d7898952e9eb332c84cdfc67cf5aa4
Change-Id: Ibf543a7da3d7898952e9eb332c84cdfc67cf5aa4
(cherry picked from commit bcc4431f24)
2017-06-30 17:19:28 +09:00
Tianjie Xu
fba1a36fd9 Fix out of bound access in libziparchive
The boundary check of an invalid EOCD record may succeed due to the
overflow of uint32_t. Fix the check and add a unit test.

Test: Open the crash.apk and libziparchive reports the offset error as expected.

Bug: 31251826
Merged-In: I1d8092a19b73886a671bc9d291cfc27d65e3d236
Change-Id: I1d8092a19b73886a671bc9d291cfc27d65e3d236
(cherry picked from commit ae8180c06d)
2017-06-30 17:18:31 +09:00
Treehugger Robot
7dbf1a187e Merge "Fix ScopedSignalHandler" 2017-06-30 06:44:40 +00:00
Treehugger Robot
a703202093 Merge changes I0a95f87a,I36b22986
* changes:
  init: Use ScopedCaps for cap_init()
  init: Reland "Terminate gracefully when CAP_SYS_BOOT is absent"
2017-06-30 04:19:09 +00:00
Robert Benea
d3afc124b6 Merge "Use mem cgroups in libprocessgroup if they're available" 2017-06-30 02:26:30 +00:00
Colin Cross
eac4ecc34f Fix ScopedSignalHandler
I4ae2d82fdfdd58cf8ef1dfb6c401cef4ba9d3e88 broke memunreachable_test
by replacing signal_ with signal.

Test: memunreachable_test
Change-Id: I8148321e3a94530867106708a33b5b63ed867380
2017-06-29 17:13:35 -07:00
Elliott Hughes
73a6512bab Merge "Remove more documentation for obsolete board configuration." 2017-06-29 23:50:37 +00:00
Robert Benea
32375c2328 Use mem cgroups in libprocessgroup if they're available
Use mem cgroups if the kernel is built with CONFIG_MEMCG=y,
additionally add system group.

test: verified on both kernel with/without memcg enabled
Change-Id: Ib9d1c8e3c797e75f160e0e92edf3f11c9d8e9f17
2017-06-29 23:49:00 +00:00
Christopher Ferris
5d6d932a60 Merge "Remove assert, use CHECK instead." 2017-06-29 22:49:38 +00:00
Treehugger Robot
e29a6cda31 Merge "healthd: notify listeners using local copy of list, drop lock" 2017-06-29 22:26:01 +00:00
Todd Poynor
8bd30b3cf3 healthd: notify listeners using local copy of list, drop lock
Binder currently may service an incoming oneway transaction whenever
an outbound oneway call is made (if there is already a pending
incoming oneway call waiting).  The unexpected nested method call
blocks forever on a recursive mutex acquire because healthd is single-
threaded.  The binder behavior is considered a bug and may change in
the future.  For now, work around this in healthd.

Make a local copy of the listeners list, then drop the lock and
perform the outbound calls on the local copy of the list.

Bug: 38201220
Test: Marlin with modified client calling scheduleUpdate() repeatedly
Change-Id: If35c2847556245921e2aff808ff747bb60356811
2017-06-29 22:25:40 +00:00
Luis Hector Chavez
7bb360230d init: Use ScopedCaps for cap_init()
This change homogenizes the use of std::unique_ptr for storing
capabilities in system/core/.

Bug: None
Test: m
Change-Id: I0a95f87a27b0261e9d321841d5140fc000473293
2017-06-29 14:41:23 -07:00
Luis Hector Chavez
519e5f0592 init: Reland "Terminate gracefully when CAP_SYS_BOOT is absent"
This change makes it possible for Android running in a container to
terminate cleanly instead of calling abort() when requested to shut
down.

Bug: 62388055
Test: `adb reboot` on bullhead causes no kernel panics
Test: `adb reboot` on a system without CAP_SYS_BOOT makes init terminate
       nicely

Change-Id: I36b2298610f5b4a2bf8b05103d04804883df2c88
2017-06-29 14:41:23 -07:00
Christopher Ferris
9416703f5b Remove assert, use CHECK instead.
- Use the CHECK macro everywhere that assert was used.
- Remove the _debug version of the tests and leave the CHECK macro so
  it's always checking in the code.

Bug: 23762183

Test: Ran unit tests.
Change-Id: Ie705eedae393d0e95bb9d99f852687a11881aef1
2017-06-29 10:29:43 -07:00
Steven Moreland
fca20d8aa1 logd + liblogd to Android.bp
Test: boot, adb logcat produces output
Change-Id: I89e7f9a19e139d3f5a71040b1555d01913946b85
2017-06-29 09:29:36 -07:00
Elliott Hughes
5dc7736f60 Remove more documentation for obsolete board configuration.
Bug: N/A
Test: builds
Change-Id: I0a4ea974a81aadba1a554072ceff9f243a70be0d
2017-06-29 08:52:49 -07:00
Christopher Ferris
51b4f48280 Merge "Fix mac build." 2017-06-29 07:02:08 +00:00
Treehugger Robot
6afbd476ab Merge "Allow SLOG* to vendors" 2017-06-29 03:53:38 +00:00
Christopher Ferris
bfd6292db6 Fix mac build.
Test: Built.
Change-Id: I455381d29045dc6dddfb2b77dcde312722c06ebf
2017-06-28 20:44:48 -07:00
Jiyong Park
9ffeab85bf Allow SLOG* to vendors
Not only vendor libs, but also Android libs that are marked as
vendor_available are using SLOG*. Since both pure vendor libs and
Android libs available to vendors are using the same liblog headers for
VNDK, SLOG* needs to be visible via the headers.

Bug: 63088165
Test: BOARD_VNDK_VERSION=current m -j ATFWD-daemon
(or any other vendor modules using SLOG*)

Change-Id: Idfb74887a42d2418d3896bfdf5be3b4fc8e4c27f
2017-06-29 10:25:25 +09:00
Christopher Ferris
9302daeb1d Merge "Add .gnu_debugdata support." 2017-06-29 01:15:21 +00:00
Christopher Ferris
bae69f1892 Add .gnu_debugdata support.
Update the unwind_info tool to dump all of the sections.

Bug: 23762183

Test: Passes new unit tests.
Change-Id: I8b223bc208a1a2ef06ed333e6d96943c8f273681
2017-06-28 15:23:10 -07:00
Treehugger Robot
9ed76f0acc Merge "Add (partial) support for Windows long paths" 2017-06-28 19:15:38 +00:00
Renaud Paquay
e3e7813e5f Add (partial) support for Windows long paths
* Update android::base::utf8::open/unlink to support Windows long
  paths

* Add android::base::utf8::fopen, also with support for Windows long
  paths

* Upcoming CLs will add additional APIs to support additional use cases

Test: Added tests to utf8_test
Bug: 38268753
Change-Id: If72af327f3487766f5370a2f43ee9cabd4a8a810
2017-06-28 17:12:37 +00:00
Treehugger Robot
3f4cea940d Merge "Remove documentation for obsolete board configuration." 2017-06-28 16:36:52 +00:00
Elliott Hughes
76a934a459 Remove documentation for obsolete board configuration.
Bug: N/A
Test: builds
Change-Id: I5afbf2da35a7defb12b98bb5387ab7d3eee6f15a
2017-06-28 07:50:00 -07:00
Treehugger Robot
20d9cf2ee7 Merge "fs_mgr: add libfstab for vendor" 2017-06-28 04:57:48 +00:00
Jiyong Park
e7df1f7623 fs_mgr: add libfstab for vendor
libfstab is a subset of libfs_mgr, intended for vendors to use. It
exposes APIs for reading fstab. Note this 'visible to vendor' does not
mean that the API should be stable forever. The API can be changed in
later releases of Android, ,but the newer Android must not cause
run-time error when there is an older version of this static library
being used somewhere.

Bug: 62990533
Test: BOARD_VNDK_VERSION=current m -j libfstab.vendor
Change-Id: I371174fa1f6b4de6d6dd437b84ce4ed1e8740672
Merged-In: If8fc73e4ae4c2f8281c41a12f1c18079aab8baa2
2017-06-28 11:24:25 +09:00
Guang Zhu
b5b4136ac4 Merge "Revert "init: Terminate gracefully when CAP_SYS_BOOT is absent"" 2017-06-28 02:15:43 +00:00
Guang Zhu
c22f93856f Revert "init: Terminate gracefully when CAP_SYS_BOOT is absent"
Bug: 63080844

This reverts commit 683ebc8059.

Change-Id: I6074ff09300fd30bfc66881ded1c4f868a845a91
2017-06-28 02:10:33 +00:00
Treehugger Robot
7f81b2af61 Merge changes I5c6bf2a5,I20a337bb
* changes:
  debuggerd: diagnostics for dumps that are guaranteed to fail.
  libprocinfo: add support for parsing process state.
2017-06-27 23:54:36 +00:00
Treehugger Robot
fbb482f499 Merge "init: Terminate gracefully when CAP_SYS_BOOT is absent" 2017-06-27 22:55:48 +00:00
Treehugger Robot
046160959c Merge "Indicate that a packet was truncated." 2017-06-27 22:50:48 +00:00
Josh Gao
0915f23d5f debuggerd: diagnostics for dumps that are guaranteed to fail.
Print diagnostics when the user requests a dump that is guaranteed to
fail, such as trying to dump a process you can't send a signal to.

Bug: http://b/63008395
Change-Id: I5c6bf2a5751f858e0534990b8d2ab6932eb9f11d
Test: manually tested
2017-06-27 15:06:57 -07:00
Josh Gao
9cb2e2eb8c libprocinfo: add support for parsing process state.
Bug: http://b/63008395
Test: libprocinfo_test32
Change-Id: I20a337bb5075bcdb325d2b48e174b0b5ef896261
2017-06-27 15:06:27 -07:00
Treehugger Robot
a4f086ab20 Merge changes Ibe1feb39,I05be83e4,If1422e4d
* changes:
  init.rc: setup console-ramoops-0
  healthd: check console-ramoops-0
  fs_mgr: check console-ramoops-0
2017-06-27 21:46:30 +00:00