Commit Graph

20430 Commits

Author SHA1 Message Date
Treehugger Robot 58ea31cc90 Merge "fs_mgr: pass sehandle to ext4 format routine" 2016-06-01 17:30:09 +00:00
Daniel Micay 2b22a66382 add a property for controlling perf_event_paranoid
This adds a system property for controlling unprivileged access to
perf_event_paranoid. It depends on adding kernel support for
perf_event_paranoid=3 based on grsecurity's PERF_HARDEN feature to
completely disable unprivileged access to perf. A minimal port of this
feature is used in the vanilla Debian kernel by default.

It hides the non-hardened value as an implementation detail, since while
it is currently 1, it will probably become 2 in the future.

Bug: 29054680

Change-Id: I6e3ae3cf18d8c76df94f879c34fb6fde519b89a9
2016-05-31 17:45:05 -04:00
Treehugger Robot 0f3fde210d Merge "Kill adb's ScopedFd for unique_fd." 2016-05-28 02:06:18 +00:00
Elliott Hughes 2ce86e527b Kill adb's ScopedFd for unique_fd.
It's the adb unique_fd, but at least it's the same API...

Change-Id: If5d6642457e145c450374fde6f1358e5ac386a96
2016-05-27 17:51:24 -07:00
Treehugger Robot b42e4a6b63 Merge "Kill load_file." 2016-05-28 00:17:10 +00:00
Elliott Hughes e8b663fec3 Kill load_file.
Change-Id: I6c332f7d8e94d513605295b3d4d32c4e1cf878dc
2016-05-27 16:14:02 -07:00
Treehugger Robot 9c7f9215e4 Merge "[adb] Followup CL to clean up adb_auth_host.cpp" 2016-05-27 23:08:06 +00:00
Chih-hung Hsieh ac080d2128 Merge "Fix misc-macro-parentheses warnings in init and other core modules." 2016-05-27 22:44:15 +00:00
Yurii Zubrytskyi dace015269 [adb] Followup CL to clean up adb_auth_host.cpp
Get rid of unused includes + replace a fixed-size buffer with an
std::string

(cherry-pick of 049ebb810f466d916ec9e73cdf28624b57a8c25d.)

Change-Id: I4f9927b900a79a012b5d52908b9d22ac3d2a401c
2016-05-27 14:43:26 -07:00
Treehugger Robot 7c0835f66b Merge "[adb] Issue the "auth" emulator command before any other one" 2016-05-27 21:23:56 +00:00
Yurii Zubrytskyi 376b27532c [adb] Issue the "auth" emulator command before any other one
Emulator console now requires authentication; this means
'adb emu ...' commands silently fail because of it.
This CL adds an 'auth <token>' command to each user command,
making sure it won't be silently ignored.

(cherry-pick of a9e2b99a7fdd31bcd6d852c6db26fe592236a24f.)

Bug: https://code.google.com/p/android/issues/detail?id=211233
Change-Id: Id9ca4999fd2e6393cc88278eaf444243e13c0ec0
2016-05-27 13:34:40 -07:00
Colin Cross b50216ed86 Remove deprecated Android.mk files
These directories all have Android.bp files that are always used now,
delete the Android.mk files.

Change-Id: I8b0c89072a660c4a7a30fcefc76a7bbe247df977
2016-05-26 16:58:28 -07:00
Luis Hector Chavez 623ce74c83 core: Update libchrome APIs to r395517
The new libchrome has been ported from Chromium and some APIs have
changed. Make necessary changes at call sites.

Change-Id: I0a0e0441b6a7486ff0b42d11136254d8a536788f
2016-05-26 11:29:53 -07:00
Yabin Cui 50e91fec0e Merge "adb: retry connecting disconnected emulators instead of always looping." 2016-05-26 01:32:53 +00:00
Michael Ryleev ed01d17e1b Merge "trusty: storageproxyd: use upstream kernel headers" 2016-05-25 15:40:05 +00:00
Yabin Cui b74c6498aa adb: retry connecting disconnected emulators instead of always looping.
Previously we loop through local ports every second, this patch improves
the strategy by retrying only just disconnected emulators.

Bug: 26468076
Bug: 19974213
Bug: 22920867

Change-Id: I43ccb746922d104202b0f81a3d163d850bbc890e
2016-05-24 16:38:47 -07:00
Michael Ryleev 462461bd28 trusty: storageproxyd: use upstream kernel headers
Force usage of upstream kernel headers to pull in
definition of rpmb related structures.

This change is required until b/25567964 is resolved.

Change-Id: Ic710d32281dcdd093f6308b82ee937143b692613
Bug: 25567964
2016-05-24 14:52:38 -07:00
Michael Ryleev c7878469be Merge changes I40c9ea47,I593aeed5
* changes:
  trusty: storage: add tests
  trusty: storage: add client lib for testing
2016-05-24 19:23:50 +00:00
Treehugger Robot 18013f2083 Merge "adb: close ep0 on disconnection." 2016-05-24 02:32:57 +00:00
Yabin Cui 638420ef31 adb: close ep0 on disconnection.
adbd on device kicks the usb connection when usb IO fails. But to notify
adb on host to reconnect it, adbd needs to close ep0 to reset the usb
connection. Otherwise, adb on host cann't connect the device unless the
usb cable is reconnected or adb host server is restarted.

This can be tested by using `adb reconnect device` command.

Bug: 25935458

Change-Id: I80979d6029e60b9cfd218f7b9b5201810238ec07
(cherry picked from commit 69e97e4bee)
2016-05-23 17:17:46 -07:00
Hans Boehm 069517574e Merge "Fix SharedBuffer. Remove aref." 2016-05-23 22:11:02 +00:00
Hans Boehm 3e4c076ef2 Fix SharedBuffer. Remove aref.
Add comment that SharedBuffer is deprecated.

Both aref and SharedBuffer had memory ordering bugs.  Aref has no
clients.

SharedBuffer had several bugs, which are fixed here:

mRefs was declared neither volatile, not atomic, allowing the
compiler to, for example, reuse a stale previously loaded value.

It used the default android_atomic release memory ordering, which
is insufficient for reference count decrements.

It used an ordinary memory read in onlyOwner() to check whether
an object is safe to deallocate, without any attempt to ensure
memory ordering.

Comments claimed that SharedBuffer was exactly 16 bytes, but
this was neither checked, nor correct on 64-bit platforms.

This turns mRef into a std::atomic and removes the android_atomic
dependency.

Bug: 28826227
Change-Id: I39fa0b4f70ac0471b14ad274806fc4e0c0802e78
2016-05-23 17:28:52 +00:00
Yabin Cui 3d981c87c9 Merge "adb: check return value of register_socket_transport." 2016-05-21 01:12:35 +00:00
Treehugger Robot 86ed22cf27 Merge "Fix misc-macro-parentheses warnings in lmkd." 2016-05-19 22:42:26 +00:00
Hans Boehm 62212954ef Merge "Fix memory order and race bugs in Refbase.h & RefBase.cpp" 2016-05-19 22:01:41 +00:00
Chih-Hung Hsieh c713bce901 Fix misc-macro-parentheses warnings in init and other core modules.
Bug: 28705665
Change-Id: Ice67cebb8c42538f8fb9cf1756678f41a9d68a31
2016-05-18 18:11:49 -07:00
Treehugger Robot 97da9225d9 Merge "HACK: libnetutils: Remove parameters from dhcpcd service call" 2016-05-19 01:02:40 +00:00
Chih-hung Hsieh 2bd428e1f9 Merge "Fix misc-macro-parentheses warnings in liblog." 2016-05-19 00:48:44 +00:00
Chih-hung Hsieh 3e3741aa7f Merge "Fix misc-macro-parentheses warnings in libion, libsparse, libmem*" 2016-05-19 00:48:32 +00:00
Treehugger Robot 684d543922 Merge "adb: use asocket's close function when closing." 2016-05-19 00:11:03 +00:00
Treehugger Robot dab7d9de03 Merge "Fix misc-macro-parentheses warnings in adb, debuggerd, libbacktrace." 2016-05-18 23:54:40 +00:00
Treehugger Robot cea14958d2 Merge changes I5e56f17f,Ie3748b6c,I4e1d56a8
* changes:
  adb: switch the socket list mutex to a recursive_mutex.
  adb: clang-format sockets.cpp.
  adb: add implementations of mutex, recursive_mutex.
2016-05-18 23:14:42 +00:00
Dmitry Shmidt 1288f65b3b HACK: libnetutils: Remove parameters from dhcpcd service call
init is not accepting parameters, therefore adding them
will cause to serivce failure. This is a temporary solution.

Change-Id: I0faa482f76b5af5f91723b0d4ef348aafd5694df
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2016-05-18 16:01:15 -07:00
Chih-Hung Hsieh 67867dbd79 Fix misc-macro-parentheses warnings in adb, debuggerd, libbacktrace.
Bug: 28705665
Change-Id: I469b2a882f6d1f399bfc22c75a26da245991fc33
2016-05-18 15:53:15 -07:00
Chih-Hung Hsieh f0f94fe49b Fix misc-macro-parentheses warnings in liblog.
Bug: 28705665
Change-Id: Ib272a83cb93b09d986c19a40e23a2679b9e17558
2016-05-18 15:48:50 -07:00
Chih-Hung Hsieh eabd5108b3 Fix misc-macro-parentheses warnings in libion, libsparse, libmem*
Bug: 28705665
Change-Id: I3dd5c086787f5e48ab100a71a42109ea0e417bf9
2016-05-18 15:41:16 -07:00
Chih-Hung Hsieh 2b82e918d8 Fix misc-macro-parentheses warnings in lmkd.
Bug: 28705665
Change-Id: I43388c0f9fdc8c2a0c0f4495f96bbc27e3de8a1d
2016-05-18 15:37:20 -07:00
Josh Gao 53eb31d87c adb: use asocket's close function when closing.
close_all_sockets was assuming that all registered local sockets used
local_socket_close as their close function. However, this is not true
for JDWP sockets.

Bug: http://b/28347842
Change-Id: I40a1174845cd33f15f30ce70828a7081cd5a087e
2016-05-18 14:21:53 -07:00
Josh Gao 9b587dec6d adb: switch the socket list mutex to a recursive_mutex.
sockets.cpp was branching on whether a socket close function was
local_socket_close in order to avoid a potential deadlock if the socket
list lock was held while closing a peer socket.

Bug: http://b/28347842
Change-Id: I5e56f17fa54275284787f0f1dc150d1960256ab3
2016-05-18 14:21:53 -07:00
Josh Gao 52bd8526aa adb: clang-format sockets.cpp.
Bug: http://b/28347842
Change-Id: Ie3748b6c803d4e8056e9d7abd065a8b99d945a5b
2016-05-18 14:21:53 -07:00
Josh Gao 903b749f78 adb: add implementations of mutex, recursive_mutex.
Our version of mingw doesn't support std::mutex or
std::recursive_mutex, so implement our own using the Windows primitives.

Bug: http://b/28347842
Change-Id: I4e1d56a89bc5fcb5f859bf5014343697a4a85b77
2016-05-18 14:21:53 -07:00
Michael Ryleev e2d6564818 trusty: storage: add tests
Change-Id: I40c9ea47e1304ef35db3d5936b001b63f3a9795e
2016-05-18 13:31:36 -07:00
Michael Ryleev abebb89359 trusty: storage: add client lib for testing
Change-Id: I593aeed5f657b5de1fce47264ae31aa6e79f2a63
2016-05-18 13:31:36 -07:00
Mark Salyzyn 0321476fe2 Merge "liblog: log reader validate headers" 2016-05-18 14:19:04 +00:00
Hans Boehm e263e6c633 Fix memory order and race bugs in Refbase.h & RefBase.cpp
Convert to use std::atomic directly.

Consistently use relaxed ordering for increments, release ordering
for decrements, and an added acquire fence when the count goes to
zero.

Fix what looks like another race in attemptIncStrong:
It seems entirely possible that the final adjustment for
INITIAL_STRONG_VALUE would see e.g. INITIAL_STRONG_VALUE + 1,
since we could be running in the middle of another initial
increment.

Attempt to somewhat document what this actually does, and
what's expected from the client. Hide the documentation in
the .cpp file for now.

Remove a confusing redundant test in decWeak. OBJECT_LIFETIME_STRONG
and OBJECT_LIFETIME_WEAK are the only options, in spite of some
of the original comments.

It's conceivable that either of these issues has resulted in
actual crashes, though I would guess the probability is small.
It's hard enough to reason about this code without the bugs.

Bug: 28705989
Change-Id: I4107a56c3fc0fdb7ee17fc8a8f0dd7fb128af9d8
2016-05-17 16:11:11 -07:00
Treehugger Robot ac50d0cc57 Merge "Set parent namespace for linker-namespaces" 2016-05-17 22:43:01 +00:00
Josh Gao eb62619ff9 Merge "adb: replace failing exits in adbd with abort()." 2016-05-17 22:33:44 +00:00
Josh Gao f8f40a1e2e Merge "adb: add track-jdwp and track-devices commands." 2016-05-17 22:33:30 +00:00
Yabin Cui 01401823fb adb: check return value of register_socket_transport.
Change-Id: I45e30861cf292323e3264a815e4ffd23d6610c52
2016-05-17 15:15:43 -07:00
Mark Salyzyn 8fd1faa596 liblog: log reader validate headers
Ensure len and hdr_size fields are valid and match the return value.
Truncate or zero content as necessary, but do not drop the message.

Bug: 28610769
Change-Id: I10785fa5b03aa3da7d07b368188e3f7c36a84b4f
2016-05-17 13:54:42 -07:00