Commit graph

30020 commits

Author SHA1 Message Date
Treehugger Robot
52998574d1 Merge "libmemunreachable: turn off MEM_ALOGV messages" 2017-06-22 22:53:50 +00:00
Treehugger Robot
ae38b373a5 Merge "Move libmemunreachable into namespace android" 2017-06-22 22:37:43 +00:00
Colin Cross
76464d958b Fix stack test on arm32
The stack test puts a pointer to an allocation on the stack, checks
that there are no leaks, then lets it go out of scope and checks
that libmemunreachable can find a leak.  This works on arm64, but
on arm32 the pointer on the stack doesn't get overwitten and the
leak is not detected.  Rewrite the pointer to be NULL instead.

Test: memunreachable_test
Change-Id: I5959a34cbb572a5d8670270077a85d247a3a4880
2017-06-22 14:21:52 -07:00
Colin Cross
75752c1911 Merge "libmemunreachable: clang-format everything" 2017-06-22 20:57:03 +00:00
Colin Cross
f3ce8bc8ae libmemunreachable: turn off MEM_ALOGV messages
The move to async safe logging in I3d3b2111f6f6bf8a0d7039295d34d5168c191651
caused MEM_ALOGV messages to print even when NDEBUG was set.

Test: builds
Change-Id: Ibebe69d8c96f8f2556991c1eb5446a77782d43c7
2017-06-22 13:46:56 -07:00
Colin Cross
a9939e9a23 Move libmemunreachable into namespace android
Putting libmemunreachable in the global C++ namespace was an oversight,
move it into namespace android.

Test: m -j checkbuild
Change-Id: I0799906f6463178cb04a719bb4054cad33a50dbe
2017-06-22 10:58:23 -07:00
Colin Cross
a83881e33c libmemunreachable: clang-format everything
clang-format -i --sort-includes $(find . -name "*.cpp" -o -name "*.h")

Test: builds
Change-Id: Ia8e0677fe7f3f26dddba3a851cd2dfab9f14e421
2017-06-22 10:58:05 -07:00
Narayan Kamath
79dd143e5f tombstoned: Improve message on java trace completion.
For java traces, log the kind of dump as well as the PID of the
completed dump. This makes it easier to correlate dump requests with the
actual file they're written to.

Sample log statement:
E /system/bin/tombstoned: Traces for pid 4737 written to: /data/anr/trace_00

The message for native traces / tombstones remains unchanged because
several tools parse it.

Test: manual
Bug: 32064548

Change-Id: I7b3792dd5ae312ee0bc055c22ec3f7c747152072
2017-06-22 11:04:33 +01:00
Narayan Kamath
07a57f0f28 Merge "tombstoned: change path for traces from "anr_" to "trace_"" 2017-06-22 08:30:42 +00:00
Treehugger Robot
b7e2f272ee Merge changes from topic 'eng_first_stage_mount'
* changes:
  Revert "Revert "init: poll in first stage mount if required devices are not found""
  Revert "Revert "ueventd: remove PlatformDeviceList""
  fs_mgr: differentiate if fs_mgr_set_verity() was skipped or disabled
2017-06-21 23:55:52 +00:00
Sandeep Patil
4cbedee541 Revert "Revert "init: poll in first stage mount if required devices are not found""
This reverts commit d6fccea093.

Bug: 62681642
Bug: 62682821
Bug: 62864413

Change-Id: Ic9c27552acbd2ae312e44ea2cdf060dcf493bfe6
Signed-off-by: Sandeep Patil <sspatil@google.com>
2017-06-21 15:04:57 -07:00
Sandeep Patil
cd2ba0d184 Revert "Revert "ueventd: remove PlatformDeviceList""
This reverts commit 516ff99711.

Bug: 62864413
Bug: 62864413

Change-Id: Ie3980cd536c2c83adace063f0950128f68561105
Signed-off-by: Sandeep Patil <sspatil@google.com>
2017-06-21 15:04:57 -07:00
Sandeep Patil
95366e97dd fs_mgr: differentiate if fs_mgr_set_verity() was skipped or disabled
In case of non-secure builds (eng variant) fs_mgr_setup_verity() skips
verity checks regardless of fstab options. This is slightly different
than 'adb disable-verity' where it would first read the verity metadata
to check if verity is disabled.

So, this change adds a new return value of FS_MGR_SETUP_VERITY_SKIPPED
instead of piggy backing on the FS_MGR_SETUP_VERITY_DISABLED.

Bug: 62864413
Test: Boot sailfish

Change-Id: I42bf2bdce0ecb18b4c3b568e2bc96bf1590dfb35
Signed-off-by: Sandeep Patil <sspatil@google.com>
2017-06-21 15:04:46 -07:00
Treehugger Robot
293936e41c Merge "Decode ptrace-induced SIGTRAP si_code values." 2017-06-21 21:59:25 +00:00
Treehugger Robot
5dd87c4ef6 Merge "healthd: add battery health status values from JEITA spec" 2017-06-21 19:11:45 +00:00
Tom Cherry
9c5f614945 Merge "Revert "ueventd: remove PlatformDeviceList"" 2017-06-21 18:42:22 +00:00
Tom Cherry
516ff99711 Revert "ueventd: remove PlatformDeviceList"
Bug: 62864413

This reverts commit c94ce7b130.

Change-Id: I014360251e5cda89c87adfec46d8b1e5000f3a9c
2017-06-21 18:42:07 +00:00
Tom Cherry
c9a27f79ad Merge "Revert "init: poll in first stage mount if required devices are not found"" 2017-06-21 18:41:57 +00:00
Tom Cherry
d6fccea093 Revert "init: poll in first stage mount if required devices are not found"
Bug: 62864413

This reverts commit ccf0d39316.

Change-Id: I343e304db4c0e7af2402397ef468cc743a3f08a9
2017-06-21 18:40:58 +00:00
Narayan Kamath
b123220dd6 tombstoned: change path for traces from "anr_" to "trace_"
The only case where tombstoned creates files for java traces is
when the process is signalled "by hand" using "shell kill -3", or
by the program itself. Such traces do not correspond to an ANR, so
name those files "trace_XX".

When dumpstate / system_server want to dump java traces, they set up
a tombstoned intercept and manage the lifetime of any associated file
that themselves.

Bug: 32064548
Test: manual, debuggerd_test
Change-Id: I97006ec7c0cd35de4b9564f535e77af846cc3891
2017-06-21 18:00:09 +01:00
Elliott Hughes
336a52e00c Decode ptrace-induced SIGTRAP si_code values.
Example:

  signal 5 (SIGTRAP), code -32763 (PTRACE_EVENT_STOP), fault addr 0x274e00005fb3

I'm tempted to say that %d isn't the best choice for si_code, but as long as
we're fully decoding all the values, I don't think it matters.

Bug: http://b/62856172
Test: manual debuggerd run
Change-Id: Ieeca690828e1e12f4162bbadece53f4aa7b9537a
2017-06-21 08:45:33 -07:00
Elliott Hughes
199c27734f Merge "Shave a stack frame off asserts." 2017-06-21 15:09:55 +00:00
Yueyao Zhu
9bbfbf7ffe healthd: add battery health status values from JEITA spec
Some vendors implement JEITA battery health spec.

Bug: 35780570
Test: build and boot
Change-Id: I532cd0fbdbcae0a32879de7d7930f3ccb8605ffd
2017-06-20 18:08:51 -07:00
Treehugger Robot
b6d3f28287 Merge "Give a clear error message if we can't start the server." 2017-06-21 00:48:30 +00:00
Elliott Hughes
56731b4e2f Shave a stack frame off asserts.
We can't implement MEM_LOG_ALWAYS_FATAL_IF any more, but it wasn't really
useful anyway.

Bug: N/A
Test: ran `crasher assert` and `crasher64 assert`
Change-Id: I4ae2d82fdfdd58cf8ef1dfb6c401cef4ba9d3e88
2017-06-20 17:31:29 -07:00
Martijn Coenen
e264c7bf4f Merge "Remove libmemunreachable from the VNDK." 2017-06-20 23:58:15 +00:00
Tom Cherry
20e9312344 Merge "init: poll in first stage mount if required devices are not found" 2017-06-20 21:24:23 +00:00
Tom Cherry
ccf0d39316 init: poll in first stage mount if required devices are not found
First stage mount in init currently attempts to regenerate uevents for
specific devices to create the corresponding dev nodes.  However, this
is racy as first stage mount happens early in the boot process and
it's possible that some of these devices have not yet been created by
the kernel.

To fix this issue, init will poll on the uevent socket for up to 10
seconds waiting for the kernel to create the required device.  It will
return false and panic if this 10 second timeout passes.

Note that the same uevent socket is used in the uevent regeneration
and the polling code, so there is no race if the device is created
after the uevent regeneration and before polling starts; the first
poll will pick up the device.

Bug: 62681642
Bug: 62682821
Test: Boot bullhead
Test: Boot sailfish
Test: Boot hikey + hotplug/unplug sdcard
Change-Id: I4a6ff043eb7115b729ca4954ebc6c9e000132993
2017-06-20 21:23:42 +00:00
Tom Cherry
137ee511bd Merge "ueventd: remove PlatformDeviceList" 2017-06-20 21:23:17 +00:00
Elliott Hughes
6eadee8607 Give a clear error message if we can't start the server.
Bug: http://b/35218713
Test: adb kill-server ; export HOME=/ ; adb devices
Change-Id: I53cc30213be0eab84e42b09c7b501362d6e44b05
2017-06-20 14:21:41 -07:00
Tom Cherry
c94ce7b130 ueventd: remove PlatformDeviceList
In order to create symlinks for USB and block devices, the path for
their parent platform device must be known.

Previously, ueventd would save each platform device that it encounters
to a list and query this list when creating the symlinks.  That,
however, is racy because the uevent socket does not differentiate
uevents from RegenerateUevents() and uevents sent by the kernel when
probing a device first the first time.  The below scenario is the
faulty  case:

1) Kernel probes parent platform device for a block device
2) ueventd calls RegenerateUevents() and starts processing uevents
3) Kernel probes block device and sends its uevents
4) ueventd picks up the block device uevent during its uevent processing,
   without yet regenerating the platform device uevent, causing improper
   symlinks to be created.

This change stops storing the platform devices in a list, and instead
traverses up the directory structure for each USB or block device
until it reaches a platform device, defined as one whose subsystem is
the platform bus.  This fixes the race and simplifies the ueventd
code.

Bug: 62436493
Bug: 62681642
Test: Boot bullhead
Test: Boot sailfish
Test: Init unit tests
Test: Boot hikey + hotplug/unplug sdcard
Change-Id: I21636355d8e434f30e0cba568598a6cf139e67f9
2017-06-20 21:21:14 +00:00
Christopher Ferris
9d239ec6a5 Merge "Fix some memory leaks, potential errors." 2017-06-20 18:29:24 +00:00
Treehugger Robot
643b4776b5 Merge "libcutils: Clarify schedboost_enabled()" 2017-06-20 18:10:15 +00:00
Martijn Coenen
ce102dd74f Remove libmemunreachable from the VNDK.
It depends on functionality in the bionic
allocator, which may get updated independently
of the vendor partition (as libc is in the LL-NDK).

Bug: 33241851
Test: builds
Change-Id: I435679843229d0d4d2e2be7bfe8c27f558a016dd
2017-06-20 10:11:55 -07:00
Narayan Kamath
d1e9e7bc06 Merge "zip_archive_test: compare error codes directly." 2017-06-20 10:50:27 +00:00
NIEJuhu
d3c86412ad libsysutils: Fix vold vulnerability in FrameworkListener
Don't release the sender socket when FrameworkListener receives
a command that exceed the maximum buffer length

Bug: https://issuetracker.google.com/issues/62812018
Test: manual

Change-Id: I160f504f3fb902ba25fc79deb8ae7d78d811a807
2017-06-20 06:32:11 +00:00
Tom Cherry
2787894768 Merge "Move restorecon() of /sys from init to ueventd." 2017-06-20 01:13:37 +00:00
Tom Cherry
d2fd54e0ff Move restorecon() of /sys from init to ueventd.
ueventd already does restorecon() for /sys/{block,class,devices}, so
instead of duplicating this effort with init, move the restorecon()
that init does for all of /sys to ueventd.

Bug: 62420036
Change-Id: I6125f8ff5316a0cf45872d1100d089d71802958f
Merged-In: I6125f8ff5316a0cf45872d1100d089d71802958f
Test: Boot sailfish, bullhead
2017-06-20 00:02:05 +00:00
Christopher Ferris
051792fed4 Fix some memory leaks, potential errors.
Fix a couple of memory leaks in tests.

Fix a potential case that length could be zero.

Bug: 23762183

Test: Ran unit tests, then ran valgrind on unit tests and verified no leaks.
Change-Id: I5f7602aa0204db0488a8e305250658cdb6e977d0
2017-06-19 16:20:33 -07:00
Christopher Ferris
27fea2c295 Merge "Add EH frame and debug frame support." 2017-06-19 21:37:26 +00:00
Treehugger Robot
ad4aa9e169 Merge "init: Run restorecon_recursive asynchronously" 2017-06-19 17:52:02 +00:00
Neil Fuller
acb6473793 Merge "Move system/core/tzdatacheck to system/timezone" 2017-06-19 13:54:38 +00:00
Narayan Kamath
1ef9d2dfbe zip_archive_test: compare error codes directly.
Make them available to tests so that they can compare values
directly instead of comparing error code strings.

Test: zip_archive_test
Change-Id: I1c78c24651ff7549b5125a49a4e67bbd8295c617
2017-06-19 13:03:41 +01:00
Treehugger Robot
dd622c5c34 Merge "Mark libdemangle as vendor_available" 2017-06-19 03:24:09 +00:00
Jaesung Chung
fae8ec2556 Merge "debuggerd_test: find backtrace frame in all lines in CrasherTest" 2017-06-19 00:11:51 +00:00
Jaesung Chung
31f2c81755 Merge "logd-unit-tests: make sure use unsigned types when reading le" 2017-06-19 00:10:52 +00:00
Treehugger Robot
9d2e688b9a Merge "adb: increase the shell command length limit." 2017-06-17 21:57:12 +00:00
Josh Gao
a019f78141 adb: increase the shell command length limit.
Relax the shell command length limits when talking to an adbd with the
shell protocol.

shell is pretty much the only service that takes an arbitrarily long
string, so this is somewhat safe.

Bug: http://b/37716055
Test: `adb shell $(python -c 'print "echo " + "f" * (32*1024)') | wc` on L and master
Change-Id: I0737fd2244530ef8080f300cd3a3549a1ab93465
2017-06-16 18:01:11 -07:00
Tom Marshall
62696908ff init: Run restorecon_recursive asynchronously
restorecon_recursive may take a long time if there are a lot of files on
the volume.  This can trigger a watchdog timeout in any process that
tries to set a property while it is running.  Fix this by running
restorecon_recursive in its own process.

See https://jira.lineageos.org/browse/BUGBASH-555

Change-Id: I2ce26ff2b5bfc9a133ea42f4dbac50a3ac289c04
2017-06-16 18:00:08 -07:00
Treehugger Robot
23bcbf040d Merge "Add building and installing of grep for vendor." 2017-06-16 23:24:32 +00:00