Commit Graph

34015 Commits

Author SHA1 Message Date
Android Build Merger (Role) 3752ae8474 Merge "Merge "ueventd: don't double fork firmware handlers" am: 0f4fb5497a" into stage-aosp-master 2017-07-06 02:11:15 +00:00
Tom Cherry 1f30993247 Merge "ueventd: don't double fork firmware handlers"
am: 0f4fb5497a

Change-Id: I4a5957d18e3a934213170279f59b3ec8c0f85090
2017-07-06 02:11:03 +00:00
Tom Cherry e944b7e0a4 Merge "ueventd: don't double fork firmware handlers"
am: 0f4fb5497a

Change-Id: I2a40b76e937853fd2f1eed61cc0fe4f6fa465ba2
2017-07-06 02:10:57 +00:00
Tom Cherry 0f4fb5497a Merge "ueventd: don't double fork firmware handlers" 2017-07-06 02:02:33 +00:00
Keun-young Park a4ad5d0328 Merge "add "shutdown critical" to service"
am: b3915d113d

Change-Id: I25b6f42478efda7077e00141042a427245393d28
2017-07-06 00:46:31 +00:00
Bowgo Tsai 328b56585e Merge "fs_mgr: allow no verity metadata when the device is unlocked."
am: cd0c2d8962

Change-Id: Icebfb3c34b3c2878c4015f36dafe893c577b40c9
2017-07-06 00:46:09 +00:00
Treehugger Robot b3915d113d Merge "add "shutdown critical" to service" 2017-07-06 00:40:55 +00:00
Treehugger Robot cd0c2d8962 Merge "fs_mgr: allow no verity metadata when the device is unlocked." 2017-07-06 00:29:47 +00:00
Andreas Gampe 1030828a36 Merge "Backtrace: Add libziparchive dependency"
am: 69542edfbe

Change-Id: I4514fe90b92486b2730bc453b8f4badfc9466002
2017-07-05 23:58:51 +00:00
Treehugger Robot 69542edfbe Merge "Backtrace: Add libziparchive dependency" 2017-07-05 23:55:43 +00:00
Wei Wang 5b89535442 Merge "init: Support custom shutdown actions"
am: c1bc4241f8

Change-Id: I6bb1789dbc5edbb10f2f4d712e9ca83e6302fdf4
2017-07-05 23:54:56 +00:00
Treehugger Robot c1bc4241f8 Merge "init: Support custom shutdown actions" 2017-07-05 23:49:41 +00:00
Tom Cherry 0f296e06d6 ueventd: don't double fork firmware handlers
ueventd may be asked to handle firmware during the time critical
coldboot process.  If we double fork to avoid needing to reap the
firmware handler, then we may add significant delay to this process,
as the first child may not get scheduled quickly enough for waitpid()
to complete without delay.

Bug: 63081260
Test: boot bullhead and sailfish, check that firmwares are loaded,
      no zombie ueventd processes remain, and no new errors are shown
Change-Id: I2bac3b1fbc3a58557a00326e491c104656db27ae
2017-07-05 16:41:11 -07:00
Android Build Merger (Role) f038ee0d82 Merge "Merge "ueventd: remove character device symlinks (/dev/usb/*)" am: f3ae82f57f" into stage-aosp-master 2017-07-05 22:50:56 +00:00
Tom Cherry d74886ce10 Merge "ueventd: remove character device symlinks (/dev/usb/*)"
am: f3ae82f57f

Change-Id: I50d05fbf94c6b6c7868f349ab708cb51ae25f858
2017-07-05 22:50:46 +00:00
Tom Cherry 6e0b51825b Merge "ueventd: remove character device symlinks (/dev/usb/*)"
am: f3ae82f57f

Change-Id: Ib601af84ed3b186705caaed05706d6b1f3c5746c
2017-07-05 22:50:35 +00:00
Tom Cherry 0924b32c1f Merge "init: reap zombies only after kill(-pid, ...)"
am: a51c40ce35

Change-Id: I4f1b7a05cdff1fe7851b528d0bdeda354011b599
2017-07-05 22:50:17 +00:00
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
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
Mark Salyzyn eef732555d Merge "fs_mgr: report errno string for __mount errors"
am: 6333cd0938

Change-Id: Ic3c85f6ed01d5edd2bfd0a29063610b4d8159f31
2017-07-05 21:54:17 +00:00
Wei Wang eeab491efd init: Support custom shutdown actions
We have been seeing panics and errors during shutdown sequence in
some vendor's platform, and it is required to disable error handling
during shutdown.

This CL separates the shutdown request to execute another "shutdown"
trigger at the beginning of shutdown stage. And vendor can use this
trigger to add custom commands needed for shutting down gracefully.

Bug: 38203024
Bug: 62084631
Test: device reboot/shutdown
Change-Id: I3fac4ed59f06667d86e477ee55ed391cf113717f
2017-07-05 14:49:57 -07:00
Treehugger Robot 6333cd0938 Merge "fs_mgr: report errno string for __mount errors" 2017-07-05 21:41:51 +00:00
Bowgo Tsai d1fe3bdbd6 fs_mgr: allow no verity metadata when the device is unlocked.
To boot with generic system.img for project Treble, we should allow no verity
metadata when the device is unlocked. The previous fix checks system property
"ro.boot.flash.locked" but it's unavailable during first stage mount.
This CL checks "androidboot.verifiedbootstate" in kernel command line instead.

Bug: 63268209
Test: boot sailfish without metadata on /vendor

Change-Id: Ifd1dbeb2a2f09cd06903ecdd59bc94b3905a3fbd
2017-07-05 17:22:35 +08:00
Andreas Gampe 8f0947c11f Backtrace: Add libziparchive dependency
Bug: 37342627
Test: m
Change-Id: I2b4155bd11b315ff49eb9a69549e1ab3678d0b28
2017-07-04 12:03:52 -07:00
Jiyong Park d74d572f9d Merge "zlib is not exposed to libziparchive headers"
am: eb42bb8c8b

Change-Id: Iaa99279d773725ffb2000da4f1bb2f111bc23d82
2017-07-03 19:34:56 +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
Jiyong Park 4724e91dad Merge "libziparchive headers are moved to local directory"
am: 7b44858b91

Change-Id: I77e446012003528ae4180f8450bc96563259f34f
2017-07-03 08:12:51 +00:00
Treehugger Robot 7b44858b91 Merge "libziparchive headers are moved to local directory" 2017-07-03 08:06:40 +00:00
Jiyong Park 1fd5216370 Merge "Ran clang-format on libziparchive sources and headers"
am: aa82721894

Change-Id: I04d2e03437ea1ada667c9fcc7b6e633a0c13712f
2017-07-03 00:49:56 +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
Nick Kralevich e9b9b10c58 Merge "Remove unnecessary SELinux dependencies"
am: 22de50d351

Change-Id: Icbd6b0df4378980eb2a7878bab1896f6ecefb6a8
2017-07-01 16:39:37 +00: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
Luis Hector Chavez 19f32317b3 Merge "init: Read previous state of securebits before modifying"
am: c10e14110a

Change-Id: I0a9b2dc97ebbc449288de2ce3e2745a1f60a4372
2017-07-01 00:30:42 +00: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
Steven Moreland f7a68f02d5 Merge "logd + liblogd to Android.bp"
am: c997cd64dc

Change-Id: I3cdc65fec1cd8487da86621a3381692ccd641756
2017-06-30 19:40:45 +00:00
Treehugger Robot c997cd64dc Merge "logd + liblogd to Android.bp" 2017-06-30 19:32:41 +00:00
Tianjie Xu 14f913817f Merge changes Ie89f709b,Ibf543a7d,I1d8092a1
am: 67897d47ce  -s ours

Change-Id: I92f71f1f89759f5f670577b87650141ebf859efc
2017-06-30 15:46:13 +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
Colin Cross 1deafe164b Merge "Fix ScopedSignalHandler"
am: 7dbf1a187e

Change-Id: Ic85a20682ecaa109d03827a694efd751e0fb9418
2017-06-30 06:50:38 +00:00
Treehugger Robot 7dbf1a187e Merge "Fix ScopedSignalHandler" 2017-06-30 06:44:40 +00:00