Commit graph

30003 commits

Author SHA1 Message Date
Tom Cherry
f3ae82f57f Merge "ueventd: remove character device symlinks (/dev/usb/*)" 2017-07-05 22:41:55 +00:00
Tom Cherry
a51c40ce35 Merge "init: reap zombies only after kill(-pid, ...)" 2017-07-05 22:39:51 +00:00
Treehugger Robot
6333cd0938 Merge "fs_mgr: report errno string for __mount errors" 2017-07-05 21:41:51 +00: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
Tom Cherry
8d13d808a5 init: reap zombies only after kill(-pid, ...)
When init gets SIGCHLD, it uses waitpid() to get the pid of an exited
process.  It then calls kill(-pid, ...) to ensure that all processes
in the process group started by that process are killed as well.

There is a bug here however as waitpid() reaps the pid when it
returns, meaning that the call to kill(-pid, ...) may fail with ESRCH
as there are no remaining references to that pid.  Or worse, if the
pid is reused, the wrong processes may get the signal.

This fixes the bug by using waitid() with WNOWAIT to get the pid of an
exited process, which does not reap the pid.  It then uses waitpid()
with the returned pid to do the reap only after the above kill(-pid,
...) and other operations have completed.

Bug: 38164998
Test: kill surfaceflinger and see that processes exit and are reaped
      appropriately
Test: `adb reboot` and observe that the extraneous kill() failed
      messages do not appear

Change-Id: Ic0213e1c97e0141e6c13129dc2abbfed86de138b
2017-06-30 13:52:48 -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
Mark Salyzyn
69a5bd4357 fs_mgr: report errno string for __mount errors
Need to know why the mount failed.  clang_format adjustment.

Basically change LINFO to PINFO to cause the log message for the mount
report to be accompanied by a strerror(errno) message appended to the
end so that it is clear why the mount was rejected.

Test: manual
Bug: 63100799
Change-Id: Ic958299759befe5d5b11bdc95fea5d64cad86412
2017-06-28 21:52:34 +00: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