Commit Graph

37961 Commits

Author SHA1 Message Date
Treehugger Robot b6e957a6e7 Merge "Don't shared oem-defined libs to vendor apks" 2018-01-26 03:23:40 +00:00
Christopher Ferris d42e093793 Merge "Remove DwarfError.h that moved." 2018-01-26 01:55:08 +00:00
Christopher Ferris c85935de54 Remove DwarfError.h that moved.
I think a rebase recreated this file, so deleting this now.

Bug: 65682279

Test: Compiles.
Change-Id: I1f885ed6254089ef50f293b4c407b110f8c878da
2018-01-25 16:02:20 -08:00
Treehugger Robot dc0edb586d Merge "Fix wrong mov instruction size." 2018-01-25 23:34:56 +00:00
David Srbecky 4a2178836e Merge "Emit the frame for DEX PC before the frame for native PC." 2018-01-25 22:27:37 +00:00
Chih-Hung Hsieh 09f88076c8 Fix wrong mov instruction size.
* New clang 7.0 assembler rejects mov with wrong length.

Bug: 72412103
Test: build and boot in emulator
Change-Id: If1a1affaa4a149265f8cc2b8bf463e58e71cc47a
2018-01-25 11:44:19 -08:00
Christopher Ferris 19ab4580be Merge "Add error propagation into Unwinder/Elf objects." 2018-01-25 15:00:32 +00:00
David Srbecky 645f8bbc6f Emit the frame for DEX PC before the frame for native PC.
This results in more natural backtrace.

Test: ART's 137-cfi test

Change-Id: Ic472db2733a330f8dbc722887809273b77d9dfb5
2018-01-25 14:09:43 +00:00
Treehugger Robot 4d182ff205 Merge "libutilscallstack is private VNDK-SP" 2018-01-25 07:27:49 +00:00
Jiyong Park a32678df55 libutilscallstack is private VNDK-SP
The library isn't intented to be exposed to vendors. It is a platform
private library.

Bug: 72471487
Test: Pixel 2016/2017 boots to the UI. Photo editing works.
Change-Id: Ib0479a43d66d988c2f882688240746bed3213dad
2018-01-25 14:02:08 +09:00
Jaekyun Seok 8f324542a2 Merge "Support /product partition" 2018-01-25 03:53:37 +00:00
Christopher Ferris 2fcf4cf13e Add error propagation into Unwinder/Elf objects.
The backtrace offline code uses these error codes to diagnose errors.
In addtion, I've had cases where seeing these errors would help diagnose
failures.

This also allows us to add a few features to indicate why an unwind
terminated (such as max frames exceeded).

Bug: 65682279

Test: Updated unit tests pass.
Change-Id: If82b5092698e8a194016d670efff1320f9b44d50
2018-01-24 17:50:46 -08:00
Jaekyun Seok dff165d3a2 Support /product partition
This CL will enable reading /product/build.prop and add product paths
into ld.config.txt.in.

Bug: 64195575
Test: tested with 'PRODUCT_PRODUCT_PROPERTIES := ro.product.abc=abc' on
sailfish

Change-Id: Ie996def20e25dc1afe0c74af2096af844934b2dc
2018-01-25 09:37:20 +09:00
Treehugger Robot 3303c5d520 Merge "Add a graphics owner for graphics.h." 2018-01-25 00:25:35 +00:00
Christopher Ferris 335675c2fd Merge "Small behavioral changes to the unwinder." 2018-01-25 00:03:12 +00:00
Christopher Ferris 1a141a0925 Small behavioral changes to the unwinder.
- Be a little more lenient when reading the cies/fdes. If next entry data
  winds up incorrect, don't fail, simply stop processing the entries. This
  only applies when reading all of the cies/fdes at once.
- Fail to init an eh_frame with no entries and fallback to assuming the
  eh_frame has no header instead.
- Change the step to always try debug_frame first which has the most
  accurate information.
- Add small unit tests and a couple of offline unit tests to verify
  this behavior.

These changes are needed to support offline unwinding since it depends
on this new behavior.

Bug: 65682279

Test: Ran new unit tests.
Change-Id: I3529f1b0c8e14cd7409494e5de2f3c9e78d0855e
2018-01-24 13:20:03 -08:00
Elliott Hughes f2f049f27a Add a graphics owner for graphics.h.
Bug: N/A
Test: N/A
Change-Id: I91c07531ba8a2da0187b7411b9c11dc3191dcede
2018-01-24 11:08:54 -08:00
Daniel Colascione ccb9960beb Merge "Add MCL_ONFAULT to mlockall" 2018-01-24 06:10:17 +00:00
Christopher Ferris 0ad424358c Merge "Add extra frame when dex_pc is non-zero." 2018-01-24 02:44:21 +00:00
Treehugger Robot 23e60de4ff Merge "Fix selinux denials for usbd" 2018-01-24 02:17:43 +00:00
Daniel Colascione d39adf2a4a Add MCL_ONFAULT to mlockall
This way, we don't fault in the entirety of our DSOs immediately;
instead, used pages are "sticky" in memory. Works only on kernel 4.4
and up: downlevel, we ignore the mlockall failure.

Once we get statically-linked lmkd in better shape, we'll just switch
to that.

Change-Id: I07a75ee3bc1264a1db41635c2acf611fede99b91
2018-01-24 01:53:52 +00:00
Tom Cherry a0e50d0b56 Merge "Label /vendor_file_contexts as file_contexts_file" 2018-01-24 00:59:11 +00:00
Badhri Jagan Sridharan d5db344807 Fix selinux denials for usbd
auditd  : type=1400 audit(0.0:9): avc: denied { dac_override } for comm="usbd" capability=1 scontext=u:r:usbd:s0 tcontext=u:r:usbd:s0 tclass=capability permissive=
auditd  : type=1400 audit(0.0:9): avc: denied { dac_override } for comm="usbd" capability=1 scontext=u:r:usbd:s0 tcontext=u:r:usbd:s0 tclass=capability permissive=0

Bug: 72397740
Test: booted the device to make sure that the denials are no longer
seen.
Change-Id: Ie276103ba261fd762fb8c24234904e3f3ce3d2f1
2018-01-24 00:24:49 +00:00
Christopher Ferris 0b06a590d9 Add extra frame when dex_pc is non-zero.
Use the art dex file library to read the dex data.

Add unit tests for the UnwindDexFile code.

Bug: 72070049

Test: All unit tests continue to pass.
Test: Dumped the backtrace of the 137-cfi test while running in interpreter
Test: mode and verified that the stack trace is correct. Did this on host
Test: and for arm/arm64.

Change-Id: Ia6f343318c5dd6968a954015a7d59fdf101575b0
2018-01-23 13:17:48 -08:00
Tom Cherry af0a1f87b9 Label /vendor_file_contexts as file_contexts_file
vendor_init doesn't have permissions to read rootfs labeled files, but
needs to read /vendor_file_contexts to do restorecon correctly.  This
file is a file_contexts file, so labeling it as such seems appropriate.

Test: bullhead + vendor_init doesn't hit this audit
Change-Id: I475e9735616c2426b9c7073700272f878ced2135
2018-01-23 12:40:31 -08:00
Elliott Hughes 98aad49d58 Merge "Build toolbox with _FILE_OFFSET_BITS=64." 2018-01-23 19:15:39 +00:00
Tom Cherry f09649c231 Merge "Make vendor_init check SELinux before setting properties" 2018-01-23 18:34:34 +00:00
Christopher Ferris b04bbccbb6 Merge "Fix null ptr dereference if jit debug not enabled." 2018-01-23 14:58:09 +00:00
Badhri Jagan Sridharan b9b54e7b7a Merge "Initial commit for usb daemon" 2018-01-23 03:09:27 +00:00
Logan Chien c6805c3e9c Merge "ld.config.txt: Move vendor vndk to vndk namespace" 2018-01-23 02:02:21 +00:00
Christopher Ferris 2486d5a10d Fix null ptr dereference if jit debug not enabled.
Test: No crash when a jit debug object is not instantiated.
Change-Id: Ic4350a10258459ead7c5679ceb84372f1084f0ad
2018-01-22 17:37:59 -08:00
Elliott Hughes 16b82b7e24 Build toolbox with _FILE_OFFSET_BITS=64.
32-bit devices still exist...

Bug: http://b/72335947
Test: builds
Change-Id: Ia644640f19ad9d9160554e3fe329b3ce8e585c66
2018-01-22 16:15:55 -08:00
Treehugger Robot daac5aafa7 Merge "Add force_suspend function" 2018-01-22 23:32:55 +00:00
Treehugger Robot 17b959c9ed Merge "Init remove direct calls to light sys nodes." 2018-01-22 20:27:17 +00:00
Tom Cherry 32228485ff Make vendor_init check SELinux before setting properties
Finishing a TODO from vendor_init, check SELinux permissions before
setting properties in vendor_init.

Bug: 62875318
Test: N/A
Change-Id: I3cb6abadd2613ae083705cc6b9c970587b6c6b19
2018-01-22 18:20:56 +00:00
Tom Cherry ad939afaf4 Merge "Move all of init to libinit" 2018-01-22 17:50:56 +00:00
Logan Chien 91b3fb4f3f ld.config.txt: Move vendor vndk to vndk namespace
This commit moves /{odm,vendor}/lib[64]/vndk[-sp] to vndk namespace so
that vndk extension can override vndk libs from
/system/lib[64]/vndk[-sp].

Bug: 69824336

Test: Create libutils_ext locally and it can be called from
android.hardware.nfc@1.0-service.

Change-Id: Id63e58d665fa41eda85950ee1d16fe06c35cd7d3
2018-01-22 11:30:56 +08:00
Christopher Ferris 0ba2c9f4a2 Merge "Fix regression caused by libbacktrace API change." 2018-01-20 18:18:43 +00:00
Christopher Ferris e36afb0429 Fix regression caused by libbacktrace API change.
The stack dump was not printing leading zeros for data after the
change to remove uintptr_t types from the libbacktrace API.

Bug: 65682279

Test: Created an arm tombstone and an arm64 tombstone and verified
Test: that the stack data has leading zeros.
Change-Id: I1fbec2c4fa7c8b0fab18894c5628d18c5a580299
2018-01-20 00:59:11 -08:00
Josh Gao fd0e0db391 Merge "debuggerd: add seccomp policies and tests." 2018-01-20 02:45:37 +00:00
Treehugger Robot 658e4ddd03 Merge "Adding /data/local/traces for traceur app" 2018-01-20 00:51:30 +00:00
Christopher Ferris e20b4a48fe Merge "Change all uintptr_t to uint64_t in API." 2018-01-19 23:30:33 +00:00
Steven Moreland d5eccfd417 Init remove direct calls to light sys nodes.
These are halified. Instead launch blank_screen which
does the same task w/o init itself having binder
dependencies.

Bug: 70846424
Test: manual + reboot appears similar
Change-Id: If8b2a56cbc31077122ea81406721b06034e4498f
2018-01-19 14:45:10 -08:00
Treehugger Robot b6d7f2655d Merge "Fix fastboot memory corruption." 2018-01-19 22:39:14 +00:00
Tom Cherry 618d3102c9 Move all of init to libinit
I'd be not doing this for a while since some of this code doesn't
compile on host and libinit previously did.  But after realizing
the property_service.cpp (libinit) references symbols in init.cpp
(init) and seeing a new linker error crop up due to that, it's time to
make the fix.

My only hold out previously was that libinit compiled on host bionic
and some of init (builtins.cpp, etc) do not, however given that we
don't actually have host bionic support or host bionic init tests,
that isn't a good reason.  We can and should mock out the libraries
that aren't available with host bionic when ready.

Test: build, unit tests, boot
Change-Id: Ie49362ddb637924efc272540a4f32b693643fcdc
2018-01-19 14:25:48 -08:00
Steve Paik 10b149f18f Add force_suspend function
This CL implements a simple force_suspend().  This function takes a
timeoutMs argument that is currently ignored.  It also uses a two-stage
init process that spawns the suspend_thread when autosuspend is in use.

Follow-up CLs will:
- Implement file locking to prevent multiple libsuspend instances from
starting multiple suspend threads in the system.
- Fully implement timout for force_suspend.
- Integrate force_suspend with suspend_thred.

Bug: 70669809
Test:  autosuspend still works
Change-Id: I6b2c72d0c61d1bec6db0f0b28481ffe0e20ec615
2018-01-19 12:30:39 -08:00
Max Bires 181d11c5cb Adding /data/local/traces for traceur app
Traceur app is being split out of shell user. Previously it logged to
shell's bugreports directory. It no longer has access, so it needs a
new, user-friendly file location to store trace data.

Bug:68126425
Test: Traceur can write and shell can read from this directory
Change-Id: I9e344973fd43eb5699f7a848524e20b06458fb77
2018-01-19 09:37:44 -08:00
Treehugger Robot 0f2ed7d398 Merge "Fixing app compat issue b/72143978" 2018-01-19 02:38:33 +00:00
Christopher Ferris 7937a36c8e Change all uintptr_t to uint64_t in API.
In order to support the offline unwinding properly, get rid of the
usage of non-fixed type uintptr_t from all API calls.

In addition, completely remove the old local and remote unwinding code
that used libunwind.

The next step will be to move the offline unwinding to the new unwinder.

Bug: 65682279

Test: Ran unit tests for libbacktrace/debuggerd.
Test: Ran debuggerd -b on a few arm and arm64 processes.
Test: Ran crasher and crasher64 and verified tombstones look correct.
Change-Id: Ib0c6cee3ad6785a102b74908a3d8e5e93e5c6b33
2018-01-18 17:26:20 -08:00
Elliott Hughes aaa3b6bbf2 Fix fastboot memory corruption.
Bug: http://b/68664649
Test: echo 'ANDROID!' > fake.img ; fastboot -c `python -c "print 'A'*4000"` boot fake.img
Change-Id: I3299e0fba24a6c1f6178c994731a94cea68f7254
2018-01-18 16:50:14 -08:00