Commit graph

28960 commits

Author SHA1 Message Date
Andrew Scull
31a515bdcd Merge "Add eSE AID." am: e323976e74
am: 4614ba5134

Change-Id: I0c01a20e15bda8979cda473ffe255aabf61c8483
2017-03-16 18:06:51 +00:00
Andrew Scull
4614ba5134 Merge "Add eSE AID."
am: e323976e74

Change-Id: I0ce8f821fa1e2028a1d7a1275773b54bd250a612
2017-03-16 18:03:21 +00:00
Treehugger Robot
e323976e74 Merge "Add eSE AID." 2017-03-16 17:58:48 +00:00
Josh Gao
e8a5c313b7 Merge "crash_dump: fetch process/thread names before dropping privileges." am: 7390d96ff2
am: d8e854fdf1

Change-Id: I5ae84b16287e9c88e73da1c250f574757e5ea635
2017-03-16 17:52:19 +00:00
Josh Gao
d8e854fdf1 Merge "crash_dump: fetch process/thread names before dropping privileges."
am: 7390d96ff2

Change-Id: If718a098680cf0fe6026ae1885f3a28363285ebc
2017-03-16 17:50:30 +00:00
Josh Gao
7390d96ff2 Merge "crash_dump: fetch process/thread names before dropping privileges." 2017-03-16 17:45:18 +00:00
Jeff Vander Stoep
038a906997 Merge "init-debug.rc: don't mount debugfs" am: 54e7365fee
am: 9a1ed6106d

Change-Id: Ie200a8068cbab8fc6c2e3cd8d620ea792aa681ea
2017-03-16 17:39:19 +00:00
Jeff Vander Stoep
9a1ed6106d Merge "init-debug.rc: don't mount debugfs"
am: 54e7365fee

Change-Id: Ie8e0c959e21129dc883c9f8659ef75f05d0b5f2a
2017-03-16 17:36:18 +00:00
Treehugger Robot
54e7365fee Merge "init-debug.rc: don't mount debugfs" 2017-03-16 17:32:47 +00:00
Mark Salyzyn
9f8a97ed0b Merge changes I2a073293,Ia55ef8b9,I79a385fc am: 82b5c619b8
am: 5a0afe7d27

Change-Id: I7dca568166725342be1f8a2fcf7db7fa250ab394
2017-03-16 17:16:47 +00:00
Mark Salyzyn
5a0afe7d27 Merge changes I2a073293,Ia55ef8b9,I79a385fc
am: 82b5c619b8

Change-Id: Iec41ebf6c7cd0ade134e622e9dfec483491f9e9c
2017-03-16 17:14:18 +00:00
Treehugger Robot
82b5c619b8 Merge changes I2a073293,Ia55ef8b9,I79a385fc
* changes:
  logd: continue search out-of-order entries timestamp tail
  logd: drop mSequence from LogBufferElement
  logd: ensure LogBufferElement mSequence is monotonic
2017-03-16 17:09:35 +00:00
Mark Salyzyn
3b941d457b logd: continue search out-of-order entries timestamp tail
Regression from commit 8e8e8db549

For liblogcat reader -t or -T <timestamp> tail requests, continue
search for pertinent out-of-order entries for an additional 30 seconds
back into logging history to find a more inclusive starting point.

For example, if you have an out of order landing like
[..., 3, 6, 1, 8, 2, 5] and ask for 3 you used to get only 5, and now
you get 3, 6, 8, 5 as 'expected'

Test: gTest liblog-unit-tests logd-unit-tests logcat-unit-tests
Bug: 35373582
Change-Id: I2a0732933fa371aed383d49c8d48d01f33db2a79
2017-03-16 16:57:53 +00:00
Mark Salyzyn
5a34d6ea43 logd: drop mSequence from LogBufferElement
Use getRealTime() instead and leverage private liblog log_time
comparison and math functions.  This saves 8 bytes off each
element in the logging database.

Test: gTest liblog-unit-tests logd-unit-tests logcat-unit-tests
Bug: 35373582
Change-Id: Ia55ef8b95cbb2a841ccb1dae9a24f314735b076a
2017-03-16 08:22:00 -07:00
Mark Salyzyn
1d84f0b2af logd: ensure LogBufferElement mSequence is monotonic
- Improves accuracy of -t/-T '<timestamp>' behavior when out of order
  arrival of entries messes with mSequence as the list will now have
  monotonic sequence numbers enforced.
- Out of order time entries still remain because of reader requiring
  the ability to receive newly arrived old entries.
- -t/-T '<timestamp>' can still quit backward search prematurely
  because an old entry lands later in the list.
- Adjust insert in place algorithm from two loops of scan placement
  and then limit against watermark, into one that does all of that
  plus iteratively swap update the sequence numbers to set
  monotonicity.  Side effect will be that the read lock (which is
  actually the LogTimes lock) will be held longer while we search
  for a placement above the youngest LogTimes watermark.  We need
  to hold the read (LogTimes) lock because we may be altering the
  sequence numbers affecting -t/-T '<timestamp>' search.

Test: gTest logd-unit-tests liblog-unit-tests logcat-unit-tests
Bug: 35373582
Change-Id: I79a385fc149bac2179128b53d4c8f71e429181ae
2017-03-16 08:13:43 -07:00
Andrew Scull
b364328a59 Add eSE AID.
This is used by components that communicate with the embedded secure
element.

Test: Boot system with a daemon and device using this AID.
Bug: 35628284
Change-Id: I1fd1a300c69fefbd19fda69add5d3b098be873c2
2017-03-16 15:05:19 +00:00
Dimitry Ivanov
0c856b8a04 Merge "Add android::base::Realpath." am: b3fde950f2
am: 424bdf9ca1

Change-Id: Icccf533964855a9df160b0562ae41d1a896f828a
2017-03-16 06:59:37 +00:00
Dimitry Ivanov
424bdf9ca1 Merge "Add android::base::Realpath."
am: b3fde950f2

Change-Id: If241249cb24ce43aa91e91008090700b14f3064d
2017-03-16 06:57:07 +00:00
Treehugger Robot
b3fde950f2 Merge "Add android::base::Realpath." 2017-03-16 06:53:00 +00:00
Josh Gao
57f58f8e4a crash_dump: fetch process/thread names before dropping privileges.
Processes that don't have dumpable set to 1 cannot have their
process/thread names read by processes that don't have all of their
capabilities. Fetch these names in crash_dump before dropping
privileges.

Bug: http://b/36237221
Test: debuggerd_test
Test: debuggerd -b `pidof android.hardware.bluetooth@1.0-service`
Change-Id: I174769e7b3c1ea9f11f9c8cbdff83028a4225783
2017-03-15 23:30:14 -07:00
Dimitry Ivanov
840b6019c0 Add android::base::Realpath.
Bug: http://b/31396973
Test: libbase_test on host and device
Change-Id: I1e5f15c76227ec1c2128baa38eb454d347987703
2017-03-15 22:20:50 -07:00
Dan Willemsen
5e30ce0ca0 Merge "Enable more modules on linux_bionic builds" am: 75c414d1a3
am: 5bb9220b75

Change-Id: I3dffb3e3ac95f8116321f165035a666645df34d0
2017-03-16 02:35:49 +00:00
Dan Willemsen
5bb9220b75 Merge "Enable more modules on linux_bionic builds"
am: 75c414d1a3

Change-Id: If8a08b3f080344e61ebf5a0555354edb95cfb92e
2017-03-16 02:33:19 +00:00
Treehugger Robot
75c414d1a3 Merge "Enable more modules on linux_bionic builds" 2017-03-16 02:27:54 +00:00
Dan Willemsen
e0cd1e043d Enable more modules on linux_bionic builds
Bug: 31559095
Test: Enable host bionic, run soong
Change-Id: Ib4ebd909322cf464b6a40040e4b60ece7d905b6f
2017-03-15 15:44:00 -07:00
Mark Salyzyn
e8b5dca8c2 Merge "logcat: test: tail_# occasional failures" am: e7b335b471
am: a1f43ebf89

Change-Id: I9da3e1580387ec4636a65540ffe415c3537ff1ff
2017-03-15 19:09:26 +00:00
Mark Salyzyn
a1f43ebf89 Merge "logcat: test: tail_# occasional failures"
am: e7b335b471

Change-Id: I4176e5e0ef3f0e2b8bc0edc9c49410f516f371f6
2017-03-15 19:04:19 +00:00
Treehugger Robot
e7b335b471 Merge "logcat: test: tail_# occasional failures" 2017-03-15 18:55:26 +00:00
Elliott Hughes
a251228645 Merge "Move "fastboot oem" to std::string." am: 54182110ae
am: 3547ba5e3f

Change-Id: I72c9ebde8b45df2e1fc9a3d303c0ab6547c6834b
2017-03-15 18:40:36 +00:00
Elliott Hughes
3547ba5e3f Merge "Move "fastboot oem" to std::string."
am: 54182110ae

Change-Id: I82a7eb3ab983989a3fbd9829abd28e866c816846
2017-03-15 18:36:04 +00:00
Treehugger Robot
54182110ae Merge "Move "fastboot oem" to std::string." 2017-03-15 18:28:12 +00:00
Elliott Hughes
4a66730d6a Move "fastboot oem" to std::string.
Not sure how this code got missed when we moved everything else off
C string handling...

  $ adb reboot bootloader
  $ fastboot oem `perl -e 'print "x"x1024;'`

Before:
  <crashes>

After:
  error: Command length (1028) exceeds maximum size (64)

(The error says 1028 instead of 1024 because it includes the "oem ".)

Bug: http://b/36232671
Test: fastboot oem `perl -e 'print "x"x1024;'`
Change-Id: Ib4664e49222bd2b71be5aa3fe81f386d6073414f
2017-03-15 09:40:28 -07:00
Andreas Gampe
a8fbb17d2d Merge "Logd: Fix wrong parameters" am: 913ad12543
am: 0daaa5aec8

Change-Id: I3bc438c69f6f3b10d86d42625b655636a7605ced
2017-03-15 15:46:57 +00:00
Andreas Gampe
0daaa5aec8 Merge "Logd: Fix wrong parameters"
am: 913ad12543

Change-Id: I4046e79b452c4be8dc75e774aa7bb9264c602b10
2017-03-15 15:41:56 +00:00
Treehugger Robot
913ad12543 Merge "Logd: Fix wrong parameters" 2017-03-15 15:38:14 +00:00
Evgenii Stepanov
99bd60a9eb Merge "Fix heap-buffer-overflow detected by ASAN." am: 3d028f14c8
am: 591b09650b

Change-Id: I2791a1110afb102dd796fb1aa91068620884c860
2017-03-15 06:57:58 +00:00
Evgenii Stepanov
591b09650b Merge "Fix heap-buffer-overflow detected by ASAN."
am: 3d028f14c8

Change-Id: Ia3c137490fae9da00f73dedd414ba2b8cd04a975
2017-03-15 06:52:56 +00:00
Treehugger Robot
3d028f14c8 Merge "Fix heap-buffer-overflow detected by ASAN." 2017-03-15 06:46:28 +00:00
Jeff Vander Stoep
082807f3b4 init-debug.rc: don't mount debugfs
Motivation:
1. Reduce skew between userdebug and user builds.
2. Make the decision to mount debugfs on debug builds on a
   per-device basis.
3. Prepare to not mount it at all to reduce the attack surface
   of the kernel, reduce boot time, and free up memory.
4. Remove the selinux denial on devices that mount twice, i.e.
   unconditionally in the device specific .rc file and in the
   init-debug.rc file.
   avc: denied { mounton } for path="/sys/kernel/debug" dev="debugfs"
   ino=1 scontext=u:r:init:s0 tcontext=u:object_r:debugfs:s0
   tclass=dir permissive=0

If desired, debugfs may be mounted in device specific rc files
instead.

Bug: 31856701
Bug: 35197529
Test: Build and boot Marlin. Selinux denial no longer observed.
Change-Id: Ie0d954f77f7cf70ed2b94f67a57a6c9eba45ba8e
2017-03-14 21:56:24 -07:00
Andreas Gampe
34450d70c5 Logd: Fix wrong parameters
Better keep the right order, or ASAN will complain when you read
out of bounds.

Bug: 36234128
Test: m
Test: m && m SANITIZE_TARGET=address
Test: Sanitized device boots without ASAN crashes
Change-Id: Ifc09cb0ece6835d2b636a3ad2128e09ca9aa45c9
2017-03-14 20:43:43 -07:00
Todd Poynor
91db71d2a0 Merge "libcutils: android_reboot: add thermal shutdown command" am: 97a2c49a58
am: 938f80838c

Change-Id: I11c1dc89f75a53623b7936eccf23ccb0859f2102
2017-03-15 02:24:01 +00:00
Todd Poynor
938f80838c Merge "libcutils: android_reboot: add thermal shutdown command"
am: 97a2c49a58

Change-Id: Id7d1731304324df4c6b770949b18aec5fc5f5aa4
2017-03-15 02:18:59 +00:00
Treehugger Robot
97a2c49a58 Merge "libcutils: android_reboot: add thermal shutdown command" 2017-03-15 02:11:40 +00:00
Tom Cherry
a6df649958 Merge "Remove extraneous .clang-format files" am: 41c7bb5055
am: ef3017bdbd

Change-Id: Idef0e5af5935cc5fe73540d4c1a3ff20af1ab428
2017-03-15 01:00:34 +00:00
Todd Poynor
37bba3b88a libcutils: android_reboot: add thermal shutdown command
Add ANDROID_RB_THERMOFF command to android_reboot(), denoting a power
off due to thermal limits exceeded.  When this command is used, Android
may provide notification to the user about the potentially unexpected
power off at next boot.

Bug: 30994946
Test: Manual: setprop sys.powerctl thermal-shutdown
Change-Id: If2cde1b6a3c281a5750b50295412a4801ed5b2f2
2017-03-14 17:58:25 -07:00
Tom Cherry
ef3017bdbd Merge "Remove extraneous .clang-format files"
am: 41c7bb5055

Change-Id: I5062d81a01cde71a9bbe7549f9e3c9198af955ae
2017-03-15 00:55:35 +00:00
Tom Cherry
41c7bb5055 Merge "Remove extraneous .clang-format files" 2017-03-15 00:46:44 +00:00
Mark Salyzyn
d70f246f8a logcat: test: tail_# occasional failures
When PID becomes 5 digits, fgetLongTime fails

Test: gTest logcat-unit-tests --gtest_filter=*.tail_*
Bug: 27319267
Change-Id: I9cc636ed9955a317eb3b0ff0a820a50b800b7e0d
2017-03-14 15:35:15 -07:00
Evgenii Stepanov
03fc2fedd7 Fix heap-buffer-overflow detected by ASAN.
Bug: 34949125
Bug: 34606909
Test: Make sure Android boots when built with SANITIZE_TARGET='address'
Change-Id: I9c004e806f2025098aa72228284b05affd2c2802
2017-03-14 14:47:25 -07:00
Tom Cherry
5b4eb23cfd Remove extraneous .clang-format files
The .clang-format files in the base, debuggerd, adb, libprocinfo, and
fastboot subdirectories each differ slightly from the top level
.clang-format-2 and .clang-format-4, but not in a substantially
meaningful way, as the source files in those directories have not been
re-formatted with clang-format.  Therefore, let's reduce the
differences and use only the two top level clang-format files.

Secondly perform some small clean-up of the top level .clang-format
files.  AllowShortBlocksOnASingleLine is already false in the Google
style, so it can be removed.  AllowShortFunctionsOnASingleLine should
not change between the -2 and -4 versions, so leave it at the Google
default style in both, which is 'All'.

The diff stats for these changes are:

./base/
Old:
640 insertions(+), 531 deletions(-)
New:
563 insertions(+), 808 deletions(-)

./debuggerd/
Old:
910 insertions(+), 886 deletions(-)
New:
991 insertions(+), 1023 deletions(-)

./adb/
Old:
2623 insertions(+), 2886 deletions(-)
New:
2655 insertions(+), 3103 deletions(-)

./libprocinfo/
Old:
2 insertions(+), 1 deletion(-)
New:
4 insertions(+), 18 deletions(-)

./fastboot/
Old:
618 insertions(+), 743 deletions(-)
New:
726 insertions(+), 882 deletions(-)

./init/
Old:
1755 insertions(+), 1866 deletions(-)
New:
1715 insertions(+), 1952 deletions(-)

Test: Above clang-format stats
Change-Id: I3f7b8ab0660c8394c5008ba95ea15e70dd22b55b
2017-03-14 14:06:31 -07:00