Commit Graph

35509 Commits

Author SHA1 Message Date
Josh Gao 3e76ecaf80 crash_dump: during early boot, output to kmsg on userdebug.
Crashes that happen before tombstoned is running are extremely hard to
diagnose, because tombstones aren't written to disk, and the window of
opportunity to get logs via `adb logcat` is small (potentially
nonexistent).

Solve this by adding a world-writable /dev/kmsg_debug on userdebug
builds, and writing to it in addition to logcat when tombstoned hasn't
started yet.

Bug: http://b/36574794
Test: stop tombstoned; crasher; dmesg
Change-Id: I46ba2dd67c188be74bd931f8a5536b6342d537f2
2017-08-11 13:29:38 -07:00
Christopher Ferris 6b6c2f1efb Merge "Fix another set of bugs." am: af6a262020 am: df04d3bc93
am: f49aa1323f

Change-Id: I68d58557f41792680a17bb50e07b71445fa9ba84
2017-08-11 14:43:24 +00:00
Christopher Ferris f49aa1323f Merge "Fix another set of bugs." am: af6a262020
am: df04d3bc93

Change-Id: I7aed878b670ef47f579057485217cb87187701cc
2017-08-11 14:38:22 +00:00
Christopher Ferris df04d3bc93 Merge "Fix another set of bugs."
am: af6a262020

Change-Id: Ie17cded589e0a930c6ae19b981f320a969a353aa
2017-08-11 14:33:52 +00:00
Christopher Ferris af6a262020 Merge "Fix another set of bugs." 2017-08-11 14:28:46 +00:00
Christopher Ferris 9e484bdb4a Fix another set of bugs.
- The pc read from the eh frame binary table of pc/fde offset is off by 4.
  I verified that on arm/arm64/x86/x86_64 the pc in this table matches
  the fde pc_start value. I did this by adding an error if this occurred
  and ran unwind_info over everything in system/lib, system/lib64, system/bin.
- Fixed unit tests for the above change.
- Fix a small bug in the processing encoded values. The high
  bit of the encoding should be masked off, but I wasn't doing that. That
  meant during processing of the fde, I was incorrectly returning
  an error because the encoded value was unknown.
- Added a new test for this encoding change.

Bug: 23762183

Test: Build and all unit tests pass. Also, see above comments.
Change-Id: If074a410a1726392274cd72c64470ca0be48e0db
2017-08-10 17:37:32 -07:00
Andrew Scull e05c35a10b Merge "Add HSM AID." am: 4723d7c66d am: ef1dd0d279
am: a3f425950c

Change-Id: Iabda5247da9a91648772165eb24b5df5bf7e553d
2017-08-10 21:43:47 +00:00
Andrew Scull a3f425950c Merge "Add HSM AID." am: 4723d7c66d
am: ef1dd0d279

Change-Id: I3b00e1fd0761e9d9daa439cf1ca5eedc0eab84fb
2017-08-10 21:39:47 +00:00
Andrew Scull ef1dd0d279 Merge "Add HSM AID."
am: 4723d7c66d

Change-Id: If7075378ac5a13bbe79a02843d13d34c5f128d2a
2017-08-10 21:35:47 +00:00
Treehugger Robot 4723d7c66d Merge "Add HSM AID." 2017-08-10 21:28:30 +00:00
Andrew Scull f73c5e1f84 Add HSM AID.
This is used by resources related to a hardware security module (HSM).

Bug: 64569509
Change-Id: I30d47e1b275e3c4ae0a00f7ceb286a1096d84273
2017-08-10 20:25:11 +01:00
Mark Salyzyn 70132e8f57 Merge "bootstat: switch from root.root to system.log" am: de6b44aa0e am: 67ad31b21f
am: 81d0f72d41

Change-Id: I09303439b9ea9c1ae059c7c80d447af46ccf596d
2017-08-10 15:12:20 +00:00
Mark Salyzyn 81d0f72d41 Merge "bootstat: switch from root.root to system.log" am: de6b44aa0e
am: 67ad31b21f

Change-Id: I609a77a3eb6d61e60bea63d8e87eab1ab042eaf9
2017-08-10 15:07:48 +00:00
Mark Salyzyn 67ad31b21f Merge "bootstat: switch from root.root to system.log"
am: de6b44aa0e

Change-Id: Ia69fd5a537f7e4b9ee2a6867ccc182b44c09b6df
2017-08-10 15:04:12 +00:00
Treehugger Robot de6b44aa0e Merge "bootstat: switch from root.root to system.log" 2017-08-10 14:56:37 +00:00
Dan Willemsen 51b4962c43 Merge "Don't try to strip a shell script" am: ff7e13c260 am: 3efedfae39
am: 94e8bf2da0

Change-Id: I914a88c318acd71e039b8afbab1fa5fcb4189361
2017-08-10 05:52:01 +00:00
Dan Willemsen 94e8bf2da0 Merge "Don't try to strip a shell script" am: ff7e13c260
am: 3efedfae39

Change-Id: I5c9d7dee5c04eb1c7b564707d97338a04b6f03a0
2017-08-10 05:49:22 +00:00
Dan Willemsen 3efedfae39 Merge "Don't try to strip a shell script"
am: ff7e13c260

Change-Id: I187a638711076f9c04b84980b74cebccc259aa51
2017-08-10 05:46:55 +00:00
Treehugger Robot ff7e13c260 Merge "Don't try to strip a shell script" 2017-08-10 05:42:46 +00:00
Tom Cherry 3e5fd2e9df Merge changes If1cffa85,I9011a959 am: 30bd51c61f am: fb9deac35c
am: cd9b0c16bc

Change-Id: I330fc192cd46173408e1ed416f281c1648d4d977
2017-08-10 04:43:09 +00:00
Tom Cherry cd9b0c16bc Merge changes If1cffa85,I9011a959 am: 30bd51c61f
am: fb9deac35c

Change-Id: I6957a7320f43fd377267259feb42ea932cbf9ada
2017-08-10 04:39:38 +00:00
Tom Cherry fb9deac35c Merge changes If1cffa85,I9011a959
am: 30bd51c61f

Change-Id: Ib59f5e16d656185bba05ad5dcec1425f2ce72b1b
2017-08-10 04:36:11 +00:00
Tom Cherry 30bd51c61f Merge changes If1cffa85,I9011a959
* changes:
  init: move property_service.cpp to libinit
  init: statically link libselinux to init_tests
2017-08-10 04:31:54 +00:00
Dan Willemsen e1cf0f5f73 Don't try to strip a shell script
Test: lunch aosp_mips-eng; mmma system/core/logcat
Change-Id: I4e641701522fb5b042d52e460d40b42ed12f22c8
2017-08-09 20:20:48 -07:00
Ryan Campbell 2c2595bfef Merge "Include asan options from data partition." am: 5d89e6c7fe am: 725fa57109
am: e817549d2a

Change-Id: Id77b2dd5847e391ef9db0a092ee9d4c4ecd09a2f
2017-08-10 01:19:30 +00:00
Ryan Campbell e817549d2a Merge "Include asan options from data partition." am: 5d89e6c7fe
am: 725fa57109

Change-Id: I57eddf490a619c843770ed8ae278afdc81ab7d9d
2017-08-10 01:15:23 +00:00
Ryan Campbell 725fa57109 Merge "Include asan options from data partition."
am: 5d89e6c7fe

Change-Id: I22bfd9e46cd377b4532e1726522b8c9fdcdfeb04
2017-08-10 01:11:22 +00:00
Treehugger Robot 5d89e6c7fe Merge "Include asan options from data partition." 2017-08-10 01:05:44 +00:00
Tom Cherry 2a978d32d2 init: move property_service.cpp to libinit
service.cpp, which is part of libinit, references symbols in
property_service.cpp, which causes the linker to complain when linking
libinit.a in some situations.

Therefore, we move property_service.cpp to libinit.

Separately, this will make it easier to write tests for
property_service.cpp, which we will want to do in the future.

Test: build, init unit tests
Change-Id: If1cffa8510b97e9436efed3c8ea0724272383eba
2017-08-09 17:13:21 -07:00
Tom Cherry 45a9d67cec init: statically link libselinux to init_tests
The shared libselinux library does not export all of the symbols that
we use in init and the linker is now complaining about this, so let's
use the static libselinux library in init_tests to match init itself.

Test: build, init unit tests
Change-Id: I9011a959a7c49446b3529740e606140a4ee8c32d
2017-08-09 17:09:04 -07:00
Christopher Ferris c68f5b7004 Merge "Small clean ups" am: 5cd87d39d7 am: 188072f6a4
am: 22ea80bdcd

Change-Id: Ie85f29b7d807f2078cff7e5e2a14ce5d7dc64983
2017-08-09 23:32:44 +00:00
Mark Salyzyn 2dbdb62d09 Merge "logcat: transition to Android.bp" am: ad7f1bc0b3 am: b5a69e8e70
am: d544b318fb

Change-Id: I93f6add52dd6bdff30e8bc5709deded1b6e1ef14
2017-08-09 23:32:16 +00:00
Christopher Ferris 22ea80bdcd Merge "Small clean ups" am: 5cd87d39d7
am: 188072f6a4

Change-Id: Ifb47bd38f254e25820bf1bfb62a158ac7631b434
2017-08-09 23:29:08 +00:00
Mark Salyzyn d544b318fb Merge "logcat: transition to Android.bp" am: ad7f1bc0b3
am: b5a69e8e70

Change-Id: Id11adfa25f4dd6d00c92bd411451b2d4cef3ca87
2017-08-09 23:28:44 +00:00
Christopher Ferris 188072f6a4 Merge "Small clean ups"
am: 5cd87d39d7

Change-Id: I4eea11359afef8c377c646e613733ddb4cc02776
2017-08-09 23:26:44 +00:00
Mark Salyzyn b5a69e8e70 Merge "logcat: transition to Android.bp"
am: ad7f1bc0b3

Change-Id: I689b94aad609a4fd9734b159f305868eae5764ea
2017-08-09 23:26:24 +00:00
Christopher Ferris 5cd87d39d7 Merge "Small clean ups" 2017-08-09 23:22:22 +00:00
Mark Salyzyn ad7f1bc0b3 Merge "logcat: transition to Android.bp" 2017-08-09 23:18:00 +00:00
Ryan Campbell ce30d07b11 Include asan options from data partition.
Look for asan options under /data/asan so that multi-process coverage
can be enabled on a newly-started remote process without disabling
verity and without forcing it to be always-on.

Test: adb shell echo "include_if_exists=/data/asan/asan.options.%b" >>
/system/asan.options && adb shell echo
"coverage=1\ncoverage_dir=/data/misc/trace" >
/data/asan/asan.options.android.hardware.light@2.0-service && adb shell killall
android.hardware.light@2.0-service
Bug: 64019182

Change-Id: I241ad8478439323681dc1cfde2fa0770f030ae75
2017-08-09 15:32:23 -07:00
Mark Salyzyn c3ad75be84 bootstat: switch from root.root to system.log
bootstat does not need root uid and root gid permissions to perform
its tasks.  It appears that system uid and log gid are adequate and
appropriate.

Test: manual
Bug: 63736262
Change-Id: I094c2cb054e441562fa8717a4d3dc0086fb70a7a
2017-08-09 15:08:21 -07:00
Christopher Ferris 3b4b075fea Small clean ups
- Remove redundant map_info checks.
- Initialize fde_count_ to zero.

Bug: 23762183

Contributed-By: Ivan Maidanski <i.maidanski@samsung.com>

Test: Builds, run backtrace_test modifying CreateNew to Create and vice-versa.
Change-Id: I6e9cdfa99734f8cc2d9915cc32c66a1455e79f1b
2017-08-09 14:22:12 -07:00
Mark Salyzyn 507f69f80e logcat: transition to Android.bp
Switch logcat, logcatd and liblogcat to use Android.bp.

Test: compile
Change-Id: I01c0d8cbc6a713ad5b4b413677574e3c6463afcb
2017-08-09 13:30:03 -07:00
Mark Salyzyn d8dc9b66b9 Merge "logcat: fix error propagation." am: 2d1d8812cc am: 94984cf4bd
am: 8c05cd743e

Change-Id: I7d5e1a44c479f01f249398e1b44644edc4d64080
2017-08-09 01:09:02 +00:00
Mark Salyzyn 8c05cd743e Merge "logcat: fix error propagation." am: 2d1d8812cc
am: 94984cf4bd

Change-Id: I3e792200935470b0c75e70b9d0aa339ce8eb967d
2017-08-09 01:04:30 +00:00
Mark Salyzyn 94984cf4bd Merge "logcat: fix error propagation."
am: 2d1d8812cc

Change-Id: I0676572a6ff6e9591afb7f4e99cc64b92147dfef
2017-08-09 00:59:33 +00:00
Treehugger Robot 2d1d8812cc Merge "logcat: fix error propagation." 2017-08-09 00:45:20 +00:00
Tom Cherry 5cd97dcd2f Merge "ueventd: add test to ensure selabel_lookup() is thread safe" am: 2c3a2a8c5c am: 3df3ec34e4
am: 7fd1bc8fc3

Change-Id: Id053ade023074737b2096bb5061f2ad7798e40d6
2017-08-08 23:27:17 +00:00
Tom Cherry 7fd1bc8fc3 Merge "ueventd: add test to ensure selabel_lookup() is thread safe" am: 2c3a2a8c5c
am: 3df3ec34e4

Change-Id: I3c260731c56e903f53c20a0c52920f3ecfe3fe00
2017-08-08 23:04:04 +00:00
Mark Salyzyn 210e43c354 logcat: fix error propagation.
Fix some _serious_ error propagation issues discovered with
additional warning flags (-Wextra).

Test: compile
Change-Id: I5148550092e4ecb6cafba91229c350c516e7e244
2017-08-08 15:49:21 -07:00
Tom Cherry 3df3ec34e4 Merge "ueventd: add test to ensure selabel_lookup() is thread safe"
am: 2c3a2a8c5c

Change-Id: I57b1fb1906671950a4374f515438349f368f7cad
2017-08-08 22:48:04 +00:00