Commit Graph

26910 Commits

Author SHA1 Message Date
Josh Gao c2e984eec8 adb: remove win32 dependency on libwinpthread-1.dll.
Explicitly link against the static libwinpthread.a to avoid a
dependency on the dll.

Also, make the tests link against libbase statically.

Bug: http://b/31665213
Test: wine adb.exe
Test: wine adb_test.exe
Change-Id: Ifd41afcb1756a4b9b6db12e102b4db502e73d846
2017-02-21 15:30:11 -08:00
Josh Gao 892b158af8 Merge changes I29c45a8b,I807439d8
* changes:
  crash_dump: fix overflow.
  crash_dump: remove unneeded/faulty checks.
2017-02-17 08:21:14 +00:00
Josh Gao 5ad965bf41 crash_dump: fix overflow.
`1 << 32` overflows, resulting in bogus PR_CAP_AMBIENT_RAISE attempts,
and breaking dumping for processes with capabilities in the top 32 bits.

Bug: http://b/35241370
Test: debuggerd -b `pidof com.android.bluetooth`
Change-Id: I29c45a8bd36bdeb3492c9f74599993c139821088
2017-02-16 20:16:58 -08:00
Josh Gao 2a18b822d5 crash_dump: remove unneeded/faulty checks.
We already check our /proc/`getppid()` fd every time we attach a thread, so
these were unneeded at best. The one that happened after dropping
capabilities was actively wrong, though, because /proc/pid access
checks happen on every operation. (only on some kernels?)

Also, add a check that getppid() doesn't change after opening
/proc/getppid().

Bug: http://b/35241370
Test: debuggerd -b `pidof com.android.bluetooth`
Change-Id: I807439d8c2afd027f3c382face50167a8a7946c4
2017-02-16 19:26:09 -08:00
Treehugger Robot 325eeebc47 Merge "Remove unused primes.py python file." 2017-02-17 01:09:03 +00:00
Josh Gao c7cd48af58 Merge "libdebuggerd_handler: in-process crash dumping for seccomped processes." 2017-02-16 23:11:52 +00:00
Josh Gao a70f11331f Merge "crash_dump: make output fd O_APPEND." 2017-02-16 22:43:59 +00:00
Steven Moreland 16afa6a0f0 Remove unused primes.py python file.
primes.py was used to calculate primes for BasicHashTable which no
longer exists.

Change-Id: I8c6e9b7882bcb8a3832c55249be6db9421d1f771
2017-02-16 14:30:44 -08:00
Treehugger Robot c724fac054 Merge "bootstat: Report the total bootloader time." 2017-02-16 22:29:22 +00:00
James Hawkins 6b5c5aa067 bootstat: Report the total bootloader time.
Bug: 35207415
Test: none
Change-Id: Id948a3b35bb3d96dc875d0a4eea869c86a71a657
2017-02-16 11:53:03 -08:00
Jerry Zhang 7cd8349198 Merge "adb: Lower EP_ALLOC retry count" 2017-02-16 19:27:18 +00:00
Jerry Zhang 05fe272a87 adb: Lower EP_ALLOC retry count
Retries were causing timeouts on some devices.

Bug: 35418581
Test: Change usb config
Change-Id: Ie80d9eba1cb9af0acee49bd7312842533a94a87b
2017-02-16 10:56:05 -08:00
Treehugger Robot b47a22337b Merge "Set libavb version into system property for Treble OTA" 2017-02-16 10:14:28 +00:00
bowgotsai 763512795d Set libavb version into system property for Treble OTA
Treble allows framework-only (system.img) OTA. To libavb statically
linked in init/fs_mgr cannot parse the AVB metadata of system.img, add
this property for the Treble OTA match process.

Bug: 35236019
Test: Normal boots, use 'adb shell getprop' to check the property is set.
Test: Recovery boots, press 'Mount system' and use 'adb shell getprop'
      to check the property is set

Change-Id: I552be229c4efd45088d93252ac67176606f75d4d
2017-02-16 05:18:12 +00:00
Treehugger Robot 141e98474e Merge "RefBase.cpp remove unused include typeinfo" 2017-02-16 05:17:43 +00:00
Josh Gao fefda6b508 Merge changes from topic 'debuggerd_snprintf'
* changes:
  crash_dump: fix typos in error messages.
  debuggerd_handler: don't use snprintf in handler.
2017-02-16 03:42:53 +00:00
Steven Moreland 1a055a8957 RefBase.cpp remove unused include typeinfo
Test: pass
Change-Id: Iec9b9e1e9b6c974124b2043f550fb110cc22846d
2017-02-15 19:04:40 -08:00
Treehugger Robot 5a306ec6ab Merge "fs_mgr: remove code that gets slot_suffix from misc partition" 2017-02-16 02:32:33 +00:00
Josh Gao e73c932373 libdebuggerd_handler: in-process crash dumping for seccomped processes.
Do an in-process unwind for processes that have PR_SET_NO_NEW_PRIVS
enabled.

Bug: http://b/34684590
Test: debuggerd_test, killall -ABRT media.codec
Change-Id: I62562ec2c419d6643970100ab1cc0288982a1eed
2017-02-15 17:03:44 -08:00
Josh Gao f6ad5851e6 crash_dump: fix typos in error messages.
Bug: http://b/34760032
Bug: http://b/35367169
Test: mm
Change-Id: I45fa002d4ca616a41524583228987ab1197a125e
2017-02-15 17:03:30 -08:00
Josh Gao 8a7e703912 crash_dump: make output fd O_APPEND.
Bug: http://b/35209835
Test: mma
Change-Id: I447e3cfa3361f9c8b4b3335d0abccd1fe4c98e0f
2017-02-15 16:25:27 -08:00
Sandeep Patil d529d9d358 fs_mgr: remove code that gets slot_suffix from misc partition
'slot_suffix' for A/B devices *must* be provided in kernel command line
or in device tree. The removed code was unnecessarily looking it up in
the 'misc' partition.

b/33254008

Test: Boot sailfish

Change-Id: I329af2d9a98c34a941596779eb78d14337b864e5
Signed-off-by: Sandeep Patil <sspatil@google.com>
2017-02-15 16:00:03 -08:00
Treehugger Robot 64fc7442db Merge "libadf: support ADF_{POST,SIMPLE_POST}_CONFIG_V2 ioctls" 2017-02-15 21:42:48 +00:00
Treehugger Robot cbb91a538f Merge "Revert "e2fsck: drop -f when TARGET_USES_MKE2FS is enabled"" 2017-02-15 21:00:58 +00:00
Josh Gao 60515bf9f1 debuggerd_handler: don't use snprintf in handler.
snprintf isn't safe to call in the linker after initialization, because
it uses MB_CUR_MAX which is implemented via pthread_getspecific, which
uses TLS slots shared with libc. If the TLS slots are assigned in a
different order between libc.so and the linker, MB_CUR_MAX will
evaluate to an incorrect value, and lead to snprintf doing bad things.

Switch to __libc_format_buffer.

Bug: http://b/35367169
Test: debuggerd -b `pidof zygote`
Change-Id: I9d315cf63e5f3fd2f4545d6e3f707cdbe94ec606
2017-02-15 12:24:09 -08:00
Keun-young Park 2517da9f97 Revert "e2fsck: drop -f when TARGET_USES_MKE2FS is enabled"
This reverts commit 22e8199175.

- revert for now. will collect more data to check safety.

bug: 32246772
Test: reboots

Change-Id: Ibbb39005c64b26e9990c271b0b949feafae17773
2017-02-15 11:02:59 -08:00
Treehugger Robot af776fd518 Merge "debuggerd_handler: set PR_SET_DUMPABLE before running crash_dump." 2017-02-15 07:24:11 +00:00
Josh Gao 2f11a25a48 debuggerd_handler: set PR_SET_DUMPABLE before running crash_dump.
Set and restore PR_SET_DUMPABLE when performing a dump, so that
processes that have it implicitly cleared (e.g. services that acquire
filesystem capabilities) still get crash dumps.

Bug: http://b/35174939
Test: debuggerd -b `pidof surfaceflinger`
Change-Id: Ife933c10086e546726dec12a7efa3f9cedfeea60
2017-02-14 21:19:38 -08:00
Josh Gao 1d26b40ed5 Merge changes I32567010,I400d5991
* changes:
  debuggerd_handler: raise capabilities before running crash_dump.
  crasher: add a case that uses PR_SET_NO_NEW_PRIVS.
2017-02-15 05:19:01 +00:00
Treehugger Robot a22ce825e6 Merge "Only sanitize Android." 2017-02-15 01:32:11 +00:00
Greg Hackmann 095da6fb73 libadf: support ADF_{POST,SIMPLE_POST}_CONFIG_V2 ioctls
adf_{device,interface_simple}_post_v2 let the client choose what kind of
fence is returned from the kernel:

* ADF_COMPLETE_FENCE_NONE: no fence is returned
* ADF_COMPLETE_FENCE_PRESENT: the returned fence fires when the
  specified configuration appears on the screen
* ADF_COMPLETE_FENCE_RELEASE: the returned fence fires when the
  specified configuration is removed from the screen

The "V2" calls with fence type ADF_COMPLETE_FENCE_RELEASE are functionally
equivalent to "V1" calls.

Test: included gtest (on Nexus 9)
Change-Id: I36190d1b6cea0fbaed2af3ad64fa4729200c5520
Signed-off-by: Greg Hackmann <ghackmann@google.com>
2017-02-14 16:06:05 -08:00
Elliott Hughes ec46f4ed28 Only sanitize Android.
Bug: N/A
Test: didn't
Change-Id: I9b9bc04112501eaa9f9ccf23152fc5d118b03000
2017-02-14 15:46:33 -08:00
Treehugger Robot 2bc8e32242 Merge "Revert "Check against LOG_ID_MAX instead of LOG_ID_KERNEL"" 2017-02-14 23:08:16 +00:00
Josh Gao d2069632bd debuggerd_handler: raise capabilities before running crash_dump.
Raise CapInh and CapAmb after forking to exec crash_dump, so that it
can ptrace us.

Bug: http://b/35174939
Test: debuggerd -b `pidof surfaceflinger`
Change-Id: I32567010a3603cfa494aae9dc0e3ce73fb86b590
2017-02-14 14:40:47 -08:00
Josh Gao 91ad653c82 crasher: add a case that uses PR_SET_NO_NEW_PRIVS.
Bug: http://b/34684590
Test: crasher no_new_privs
Change-Id: I400d599116e3f3c27f5ea46d260e288cf900e156
2017-02-14 14:40:47 -08:00
Jerry Zhang 42aa9a1415 Merge changes from topic 'adb_perf'
* changes:
  adb: Add bMaxBurst to superspeed descriptors
  adb: Set max socket sizes to larger values.
  adb: Pre allocate kernel memory
2017-02-14 21:46:27 +00:00
Mark Salyzyn f8fc6f1870 Revert "Check against LOG_ID_MAX instead of LOG_ID_KERNEL"
causes a regression, logcat -b kernel does not work.

Check should have landed in logd_writer.c

This reverts commit 2c2337a293.

Change-Id: I1004b44ecc87f5d83d1c4463dd8b1ac16499706d
2017-02-14 21:00:57 +00:00
Treehugger Robot 1549257ff5 Merge changes from topic 'pre-early-mount'
* changes:
  init: fstab: add support to read fstab entries from device tree
  init: early_mount: add support to mount non-verity partitions early
  init: remove the existing early_mount code
  init: refactor: add support for doing early coldboot
  ueventd: make selinux labeling optional for device creation
2017-02-14 20:34:35 +00:00
James Hawkins 91cf0bd5c0 Merge "Revert "bootstat: Refactor init/utils/boot_clock into base/chrono_utils."" 2017-02-14 19:24:36 +00:00
James Hawkins c8ac067773 Revert "bootstat: Refactor init/utils/boot_clock into base/chrono_utils."
This reverts commit 7c92e48450.

Mac sdk still broken (despite testing locally).

Change-Id: I7d9206e15997cd0efe081bd3fa17d53d2b20ec32
2017-02-14 19:20:20 +00:00
Treehugger Robot aa9548dbb4 Merge "Fix ubsan failure in android::base::Split." 2017-02-14 18:43:17 +00:00
Treehugger Robot e968b73e19 Merge "bootstat: Refactor init/utils/boot_clock into base/chrono_utils." 2017-02-14 18:35:54 +00:00
Narayan Kamath dce4b65fe0 Merge "Reapply 13398711387e9ce1: Only apply schedTune boost to top-app tasks" 2017-02-14 09:05:29 +00:00
Treehugger Robot 01003d40fc Merge "Implement android::base::WaitForProperty." 2017-02-14 03:48:26 +00:00
Treehugger Robot 11d3d4d22a Merge "fs_config: wifi is now on vendor partition" 2017-02-14 03:05:03 +00:00
Josh Gao c2467e03ce Merge "debuggerd_handler: don't use waitpid(..., __WCLONE)." 2017-02-14 03:00:37 +00:00
Jerry Zhang b5a34a2bce adb: Add bMaxBurst to superspeed descriptors
This gives a large boost to speed on usb 3.0.

Test: adb pull/push multi GB files
Bug: 31722483
Change-Id: Iea039f1aba8b2e4d7e4a2ecb504cccb5dd1e4629
2017-02-13 18:19:41 -08:00
Jerry Zhang 2f8c60b1cc adb: Set max socket sizes to larger values.
This improves performance of push/pull.

Test: adb push/pull multi GB files.
Bug: 31722483
Change-Id: Ia01574c3db6a740d7a7e64ba1f5bc1fc279fb3f6
2017-02-13 18:19:36 -08:00
Treehugger Robot 07e57b4b25 Merge "libmetricslogger: Use libBionicGtestMain instead of a custom test runner." 2017-02-14 02:07:30 +00:00
Steven Moreland b7ca92349e fs_config: wifi is now on vendor partition
Bug: 34135607
Test: pass
Change-Id: I0c9dd9642e780a0303e6aaa6d80e443c59cc0c28
2017-02-13 17:21:17 -08:00