Commit graph

29854 commits

Author SHA1 Message Date
Treehugger Robot
46bb1ffa8a Merge "Fix uninitialized member variable" 2017-05-11 19:17:21 +00:00
Mark Salyzyn
24b79ce2bc logcat: test: inject for *.event_tag_filter
Inject a message for event_tag_filter and bucket tests. The former
registered an occasional failure.

Switch order of EXPECT checks so that constant is on the right so
that error reports make more sense.

Test: gTest logcat-unit-tests --gtest_filter=*.event_tag_filter
Test: gTest logcat-unit-tests
Bug: 37791296
Change-Id: Ic2536e6e4c95e3a913ad0ea4c22219aa3c5c01eb
2017-05-11 12:16:06 -07:00
Treehugger Robot
5a40c42877 Merge "logd: test: check sepolicy background rate before testing" 2017-05-11 19:13:52 +00:00
Siarhei Vishniakou
cecbc9993d Merge "Adding 'uhid' permission for access to /dev/uhid." 2017-05-11 19:02:32 +00:00
Renaud Paquay
b7a4f0b9e2 Fix uninitialized member variable
The default constructor of FileMap was missing an initializer for the
mFileMapping variables. This results in CloseHandle being called with
a "random" value, which can cause havoc in Win32 process over time (e.g.
in the case of libaapt2_jni.dll, which is loaded in a JVM process).

Also, update the code to use "NULL" for invalid file map handle
and "INVALID_HANDLE_VALUE" for invalid file handle.

Bug: 38197857
Test: Stress testing on (Windows) machine
Change-Id: Ibd769219d601fbafcfcee89e848b31cc5137826c
2017-05-11 10:30:52 -07:00
Mark Salyzyn
c51ecf9238 logd: test: check sepolicy background rate before testing
logd.sepolicy_rate_limiter_* tests can fail individually so join them
together into one test.  The new test logd.sepolicy_rate_limiter
fails as a group if the background sepolicy activity is too high, so
check it and report a warning that the test can fail as a result so it
can be forgiven during unit testing.  The failure remains as a VTS
performance threshold that requires investigation.

The test takes a total of 45 seconds to run, it was split up as this
approaches the 60 second test timeout on go/apct.

Test: gTest logd-unit-tests --gtest_filter=logd.sepolicy_rate_limiter
      (run in loop ensuring passes do not interfere with eachother)
Bug: 37791296
Change-Id: Ia865241f684c6b0de428702cbd5110dc17927c66
2017-05-11 17:16:30 +00:00
Siarhei Vishniakou
0729dd1edb Adding 'uhid' permission for access to /dev/uhid.
This CL is in support of another CL c/2048848, topic
'Refactor hid command in /frameworks/base/cmds' in
internal master. Adding the permissions for
shell here to access uhid_node as part of the
new 'uhid' group.

Bug: 34052337
Test: Tested on angler, bluetooth mouse works OK.

Change-Id: If9e100aa1262d689fb8adc5c0ce93f157c96399e
2017-05-11 01:28:53 +00:00
Josh Gao
7d199de8e2 Merge changes I0ff1fc5c,I7a23d3bf
* changes:
  libdebuggerd: print the build fingerprint in fallback.
  libdebuggerd: implement fallback register dumping on arm/aarch64.
2017-05-10 23:24:38 +00:00
Treehugger Robot
d761dd747e Merge "Work around clang-tidy segmentation fault." 2017-05-10 23:11:19 +00:00
Josh Gao
a0661237e1 Merge "adb: fix darwin build break." 2017-05-10 21:58:10 +00:00
Josh Gao
362b4041f3 adb: fix darwin build break.
Fix the following build breakage:

    system/core/adb/client/usb_osx.cpp:433:13: error: static declaration of 'usb_cleanup' follows non-static declaration
    static void usb_cleanup() NO_THREAD_SAFETY_ANALYSIS {
                ^
    system/core/adb/usb.h:48:5: note: previous declaration is here
        ADB_USB_INTERFACE(native::usb_handle*);

Bug: http://b/38203892
Test: mma on linux, darwin
Change-Id: I1c042e4d64ddcc0713f329202bc2037e590a9b4f
2017-05-10 13:58:51 -07:00
David Zeuthen
7ea2c2814d fs_mgr: Update for new libavb API.
In https://android-review.googlesource.com/#/c/392873/ we slightly
changed the libavb API. This CL updates fs_mgr to use the new API.

Bug: 38157502
Test: Manually tested.
Change-Id: Ia3371e11fcd81fcc1d147f030cd62af67943aad5
2017-05-10 15:45:12 -04:00
Josh Gao
44f6592b0d Merge changes I394f5782,I9475f5d0,I59707186
* changes:
  adb: move all cleanup to a function with defined ordering.
  adb: make `adb kill-server` wait for the server to die.
  adb: libusb: replace sleep with timed CV wait.
2017-05-10 18:42:14 +00:00
Elliott Hughes
30b7f59efc Merge "Fix style nits in adb's Android.mk." 2017-05-10 17:43:54 +00:00
Elliott Hughes
f8627cea7f Add libkeyutils.
Also move init over to it.

Bug: http://b/37991155
Test: builds+boots
Change-Id: I5113a9d96a5ce0a0f3bad71134d6cc4f7b41a57e
2017-05-10 10:40:11 -07:00
Elliott Hughes
8964fbfa5f Fix style nits in adb's Android.mk.
We [try to] always use trailing \s in lists.

Bug: N/A
Test: builds
Change-Id: Ibc1ccacbe8a31f784f206d29a8c4f0f4650f7bde
2017-05-10 08:41:50 -07:00
Elliott Hughes
3d29736d6b Merge "Fix build error when (ADB|FASTBOOT)_VERSION has space" 2017-05-10 15:11:28 +00:00
SzuWei Lin
b3526e1ee8 Fix build error when (ADB|FASTBOOT)_VERSION has space
Test: make, and build pass
Change-Id: I8fc608a5b8bccb43b8af72978ce16a945147f62d
2017-05-10 18:52:02 +08:00
Treehugger Robot
01e7990a10 Merge "fix static-analyzer logging/CHECK macros" 2017-05-10 03:05:40 +00:00
Treehugger Robot
2f2cd76d4d Merge "Explicitly enable greylist for classloader-namespaces" 2017-05-10 02:53:32 +00:00
Treehugger Robot
6f4d47438d Merge "Show the "platform tools" version in adb/fastboot --version." 2017-05-10 01:41:41 +00:00
Treehugger Robot
cdad92fdad Merge "first stage mount: removing the requirement of by-name prefix for AVB" 2017-05-10 01:37:28 +00:00
Dimitry Ivanov
9e253ce6b7 Explicitly enable greylist for classloader-namespaces
The linker no longer enables greylist by default, it
needs to be explicitly enabled by specifying corresponding
flag.

Bug: https://issuetracker.google.com/38146125
Test: builds
Change-Id: Ib593f2d9a35dbadffb436f5fbc9a2a7a8f64ada0
(cherry picked from commit 058b2ea8c5)
2017-05-09 18:00:38 -07:00
Treehugger Robot
e732d15337 Merge "trusty*: Android.mk -> Android.bp" 2017-05-09 22:32:49 +00:00
Elliott Hughes
0a253390d1 Merge "Make fastboot command-line parsing a bit more like adb." 2017-05-09 22:15:24 +00:00
Josh Gao
01b7bc43e9 adb: move all cleanup to a function with defined ordering.
We want to explicitly define the order in which we teardown adb, so
move all of the at_quick_exits sprinkled throughout into one function
containing all of the cleanup functions.

Bug: http://b/37104408
Test: adb kill-server; adb start-server
Change-Id: I394f5782eb147e394d4b87df1ba364c061de4b90
2017-05-09 14:32:47 -07:00
Josh Gao
b3c14ec693 adb: make adb kill-server wait for the server to die.
Make the host:kill service shutdown its socket on process exit, instead
of immediately. Also, unify the two 'kill-server' implementations and
hide _adb_connect.

Bug: http://b/37104408
Test: adb kill-server; adb start-server
Change-Id: I9475f5d084d5fb91d33e393f2fd4e34056613384
2017-05-09 14:31:15 -07:00
Josh Gao
707a6e469f adb: libusb: replace sleep with timed CV wait.
Instead of sleeping for 500ms at the end of every device poll loop, use
a timed condition variable wait so that we can tell the device poll
thread to immediately commit suicide.

Bug: http://b/37869663
Test: adb kill-server; adb start-server
Change-Id: I597071866f7d9ef91900411727345d32c1a97556
2017-05-09 14:30:13 -07:00
Tom Cherry
4963b42d7b Merge changes I172acf0f,I97b6e17a
* changes:
  init: change kill order and fix error reporting in KillProcessGroup()
  Better logging in libprocessgroup and make resources clean up themselves
2017-05-09 17:45:48 +00:00
Treehugger Robot
035b0c26e6 Merge "init: remove restorecon() from util.cpp" 2017-05-09 16:35:41 +00:00
Elliott Hughes
4d4f64ff94 Show the "platform tools" version in adb/fastboot --version.
Annoyingly folks parse the "adb --version" output so we have the
less-interesting protocol version first. But at least now we'll
have the "real" version somewhere...

Bug: N/A
Test: "adb --version"/"fastboot --version"
Change-Id: Ia85b561bd8d84c6fd6995923730d36f53b2f800b
2017-05-09 08:21:54 -07:00
Elliott Hughes
d6365a7052 Make fastboot command-line parsing a bit more like adb.
Only show all the help if asked to, and have a few more descriptive
syntax errors.

Also show the help on stdout rather than stderr.

Bug: N/A
Test: manually ran "fastboot flash"/"fastboot update"/"fastboot flashall"
Change-Id: I59abd60e58a56fe7e44da5116a702087c36e14ce
2017-05-09 08:16:23 -07:00
Chenjie Luo
6f3f7dc838 Merge "Remove not-used dependency in crash_dump" 2017-05-09 04:33:45 +00:00
Bowgo Tsai
20651f62d0 first stage mount: removing the requirement of by-name prefix for AVB
Current first stage mount for AVB requires specifying a common prefix of
by-name symlink for all AVB partitions. It limits all AVB partitions to be on
the same block device.

firmware {
    android {
        compatible = "android,firmware";
        vbmeta {
            compatible = "android,vbmeta";
            parts = "vbmeta,boot,system,vendor";
            by_name_prefix="/dev/block/platform/soc.0/f9824900.sdhci/by-name"  <-- *removing this*
        };
        fstab {
            compatible = "android,fstab";
            vendor {
                compatible = "android,vendor";
                dev = "/dev/block/platform/soc.0/f9824900.sdhci/by-name/vendor";
                type = "ext4";
                mnt_flags = "ro,barrier=1,inode_readahead_blks=8";
                fsmgr_flags = "wait,avb";
            };
        };
    };
};

For normal mount with AVB, it extracts the by-name prefix of /misc
partition and use it as the prefix for all other partitions:
    - /dev/block/platform/soc.0/f9824900.sdhci/by-name/misc ->
    - /dev/block/platform/soc.0/f9824900.sdhci/by-name/vendor_a

Fix this by adding an internal map in FsManagerAvbOps to record the mapping
from partition name to its by-name symlink:

    ByNameSymlinkMap["vendor_a"] = "/dev/block/platform/soc.0/f9824900.sdhci/by-name/vendor_a"

Two overloaded factory methods are then provided for FsManagerAvbUniquePtr:
    - FsManagerAvbUniquePtr Open(ByNameSymlinkMap&& by_name_symlink_map):
      for first stage mount, where the by-name symlink map will be
      constructed externally, from the uevents processed by init, before
      invoking this factory method.

    - FsManagerAvbUniquePtr Open(const fstab& fstab): for normal mount,
      where the by-name symlink map will be constructed from the input fstab
      internally.

Bug: 37552224
Test: first stage mount /vendor with vboot 1.0
Test: first stage mount /vendor with vboot 2.0 (AVB)
Test: normal mount /vendor with vboot 2.0 (AVB)
Change-Id: Id17e8566da87ea22b8923fcd6e47db8d45bc7d6a
2017-05-09 11:03:49 +08:00
Tom Cherry
482f36cf74 init: remove restorecon() from util.cpp
restorecon() has become nothing more than a small wrapper around
selinux_android_restore().  This itself isn't super problematic, but
it is an obstacle for compiling util.cpp on the host as that function
is not available on the host.

Bug: 36970783
Test: Boot bullhead
Merged-In: I7e209ece6898f9a0d5eb9e5d5d8155c2f1ba9faf
Change-Id: I7e209ece6898f9a0d5eb9e5d5d8155c2f1ba9faf
2017-05-09 02:25:32 +00:00
Treehugger Robot
cc22a8e5a2 Merge "logd: add "+passcred" for logdw socket" 2017-05-09 00:59:07 +00:00
Treehugger Robot
84606f8686 Merge "Convert libnativebridge[23]?-dummy to soong." 2017-05-08 23:53:54 +00:00
Mark Salyzyn
54d8ff1121 logd: add "+passcred" for logdw socket
Tell init to set SO_PASSCRED on the socket before bind() and handoff.

Test: gtest logd-unit-test --gtest_filter=logd.statistics right after boot
Bug: 37985222
Change-Id: I318969ee3241834e5326233aabd97e52ef505969
2017-05-08 16:19:48 -07:00
Mark Salyzyn
9811cd33ac Merge "init: add "+passcred" for socket to set SO_PASSCRED" 2017-05-08 23:19:33 +00:00
Treehugger Robot
761ae04777 Merge "adb: properly handle libusb_clear_halt failure." 2017-05-08 22:44:34 +00:00
Tomasz Wasilczyk
e38d3a60bc Convert libnativebridge[23]?-dummy to soong.
Bug: 37512442
Test: mmm system/core/libnativebridge/tests
Change-Id: Ib1ca9ef830f58041095226c2ba18d1302c7833b4
2017-05-08 15:29:10 -07:00
Chenjie Luo
68c24eff77 Remove not-used dependency in crash_dump
Test: Build crash_dump.
Change-Id: I053cf53196b3e438545138ca8401a0ad01006a8c
2017-05-08 15:18:40 -07:00
Mark Salyzyn
b066fccc5c init: add "+passcred" for socket to set SO_PASSCRED
In the init scripts for socket, the type can have a suffix of
"+passcred" to request that the socket be bound to report SO_PASSCRED
credentials as part of socket transactions.

Test: gTest logd-unit-tests --gtest_filter=logd.statistics right after boot
      (fails without logd.rc change)
Bug: 37985222
Change-Id: Ie5b50e99fb92fa9bec9a32463a0e6df26a968bfd
2017-05-08 14:04:13 -07:00
Josh Gao
8bf37d7a4d adb: properly handle libusb_clear_halt failure.
The original code used continue to attempt to try to skip the current
device, but there was an loop between the outside one and the continue.
Move the device handling logic into a function and replace continue
with return.

Test: mma
Change-Id: Iaa7f4b5ddc26d2ce03f1172d37d6307190b44412
2017-05-08 13:50:58 -07:00
Treehugger Robot
823816ee9f Merge "Revert "Make /data/data a symlink to /data/user/0"" 2017-05-08 20:46:41 +00:00
Josh Gao
2bc6196faa Merge "debuggerd_handler: use syscall(__NR_get[pt]id) instead of get[pt]id." 2017-05-08 20:18:34 +00:00
Josh Gao
62f5977d4a libdebuggerd: print the build fingerprint in fallback.
Bug: http://b/37798209
Test: killall -ABRT media.codec on internal
Change-Id: I0ff1fc5ca1e0bcec2c1b2553d6af7099deebfeda
2017-05-08 13:15:19 -07:00
Josh Gao
77b00ed429 libdebuggerd: implement fallback register dumping on arm/aarch64.
Bug: http://b/35439781
Test: killall -ABRT media.codec on internal
Change-Id: I7a23d3bfcf07ad584e677b2ef5fff28436ef0972
2017-05-08 13:15:19 -07:00
Dan Willemsen
ee9e5d0981 Merge changes Ie0b30417,I8b6e802e
* changes:
  Turn off debuggerd for host bionic
  Remove old simulator support from liblog
2017-05-08 18:01:27 +00:00
Steven Moreland
8bb85bd07c trusty*: Android.mk -> Android.bp
Test: links
Bug: 37512442
Merged-In: I86bcdcfffbbd81dedb921612bd2d21ea4aabaeb1
Change-Id: I86bcdcfffbbd81dedb921612bd2d21ea4aabaeb1
2017-05-08 16:54:04 +00:00