Commit Graph

21864 Commits

Author SHA1 Message Date
Jeffrey Vander Stoep 34ae543dc3 Merge \\\\"add a property for controlling perf_event_paranoid\\\\" into mnc-dev am: 050243df76 am: f11efb251d am: 2a311a9b38
am: 2d48c395cc

Change-Id: I678c109987a60bfc97b44ef4a48a4d658283ca66
2016-06-24 03:41:19 +00:00
Daniel Micay 2d48c395cc Merge \\\"add a property for controlling perf_event_paranoid\\\" into mnc-dev am: 050243df76 am: f11efb251d
am: 2a311a9b38

Change-Id: I6ea7f744704405be67cf3cfa175b4142b5255e05
2016-06-23 21:10:41 +00:00
Jeffrey Vander Stoep 2a311a9b38 Merge \\"add a property for controlling perf_event_paranoid\\" into mnc-dev am: 050243df76
am: f11efb251d

Change-Id: I1c641d19b4badfc9fef73d1a11675777f6d653d5
2016-06-23 21:07:34 +00:00
Daniel Micay f11efb251d Merge \"add a property for controlling perf_event_paranoid\" into mnc-dev
am: 050243df76

Change-Id: Ifc1f319c5d81ed9f5735468d14d7a795b836f373
2016-06-23 21:04:57 +00:00
Jeffrey Vander Stoep 050243df76 Merge "add a property for controlling perf_event_paranoid" into mnc-dev 2016-06-23 21:00:04 +00:00
Josh Gao 42afe2033f adb: don't dup local socket fd.
SIGHUP handling depends on the local socket fd being fully closed in
order to trigger an event on its counterpart. Release the local socket
fd inside of Subprocess when returning it to ensure this.

Bug: http://b/29565233
Change-Id: I13b17bcddf0b396a5f4880f9e410fbbf24d9370d
2016-06-22 15:57:12 -07:00
Josh Gao 2dff6490fd DO NOT MERGE: adb: use asocket\\\\\\\\\\\'s close function when closing. am: 5218ad36ad am: d7e24ec999 am: a3d96cfec9 -s ours am: 45a4bca09d -s ours am: fb9747c411 am: dc6e14f219 am: fdf3112207 -s ours am: d389f5d186 am: 57f5c95376 am: 755ab3ed16
am: 46104a0d79  -s ours

Change-Id: If33739a6317a8ad6f008960a5726dc6e2ce7c18c
2016-06-22 18:33:53 +00:00
Josh Gao 46104a0d79 DO NOT MERGE: adb: use asocket\\\\\\\\\\'s close function when closing. am: 5218ad36ad am: d7e24ec999 am: a3d96cfec9 -s ours am: 45a4bca09d -s ours am: fb9747c411 am: dc6e14f219 am: fdf3112207 -s ours am: d389f5d186 am: 57f5c95376
am: 755ab3ed16

Change-Id: I43718396c291ac9cb261097f7a34cfa7c1fa3725
2016-06-22 18:31:11 +00:00
Josh Gao 755ab3ed16 DO NOT MERGE: adb: use asocket\\\\\\\\\'s close function when closing. am: 5218ad36ad am: d7e24ec999 am: a3d96cfec9 -s ours am: 45a4bca09d -s ours am: fb9747c411 am: dc6e14f219 am: fdf3112207 -s ours am: d389f5d186
am: 57f5c95376

Change-Id: Ib68980c2897ba668691c76989375a5382bc8af3f
2016-06-22 18:26:13 +00:00
Josh Gao 2a9f4e1c50 DO NOT MERGE: adb: use asocket\\\\\\\\'s close function when closing. am: 83cb3032d2 -s ours am: 420aa30c9f am: 05d5db2534 am: 8ec6f5b46f -s ours am: f5592e174e am: d99c745c31 am: 57b4b422e3
am: 96dea5690a  -s ours

Change-Id: Icef5dce2b992030b3cee1269e2e46992bd063537
2016-06-22 18:23:51 +00:00
Josh Gao 57f5c95376 DO NOT MERGE: adb: use asocket\\\\\\\\'s close function when closing. am: 5218ad36ad am: d7e24ec999 am: a3d96cfec9 -s ours am: 45a4bca09d -s ours am: fb9747c411 am: dc6e14f219 am: fdf3112207 -s ours
am: d389f5d186

Change-Id: I5c106da4673571bc24e17742ab62960333507f77
2016-06-22 18:23:41 +00:00
Josh Gao d389f5d186 DO NOT MERGE: adb: use asocket\\\\\\\'s close function when closing. am: 5218ad36ad am: d7e24ec999 am: a3d96cfec9 -s ours am: 45a4bca09d -s ours am: fb9747c411 am: dc6e14f219
am: fdf3112207  -s ours

Change-Id: I42711a1a41b8099df1b769eb1c4e1fbbd2ee78bf
2016-06-22 18:21:33 +00:00
Josh Gao 96dea5690a DO NOT MERGE: adb: use asocket\\\\\\\'s close function when closing. am: 83cb3032d2 -s ours am: 420aa30c9f am: 05d5db2534 am: 8ec6f5b46f -s ours am: f5592e174e am: d99c745c31
am: 57b4b422e3

Change-Id: I14d98d1df800f6197c5eb28a45bd9fe259c844bf
2016-06-22 18:21:11 +00:00
Josh Gao fdf3112207 DO NOT MERGE: adb: use asocket\\\\\\'s close function when closing. am: 5218ad36ad am: d7e24ec999 am: a3d96cfec9 -s ours am: 45a4bca09d -s ours am: fb9747c411
am: dc6e14f219

Change-Id: Iac5c5b2bb07505cde1638f42d5e1ae6566a88c0b
2016-06-22 18:19:09 +00:00
Josh Gao 57b4b422e3 DO NOT MERGE: adb: use asocket\\\\\\'s close function when closing. am: 83cb3032d2 -s ours am: 420aa30c9f am: 05d5db2534 am: 8ec6f5b46f -s ours am: f5592e174e
am: d99c745c31

Change-Id: I1b615a3910580ae7f78b038b18b969c196fabe1e
2016-06-22 18:18:37 +00:00
Josh Gao dc6e14f219 DO NOT MERGE: adb: use asocket\\\\\'s close function when closing. am: 5218ad36ad am: d7e24ec999 am: a3d96cfec9 -s ours am: 45a4bca09d -s ours
am: fb9747c411

Change-Id: Ife4804a27b044aebaaefda6626adb61c241812af
2016-06-22 18:16:21 +00:00
Josh Gao d99c745c31 DO NOT MERGE: adb: use asocket\\\\\'s close function when closing. am: 83cb3032d2 -s ours am: 420aa30c9f am: 05d5db2534 am: 8ec6f5b46f -s ours
am: f5592e174e

Change-Id: Ib220d4a778ea4e7bda44aafbbaa4911c243d7db7
2016-06-22 18:15:59 +00:00
Josh Gao fb9747c411 DO NOT MERGE: adb: use asocket\\\\'s close function when closing. am: 5218ad36ad am: d7e24ec999 am: a3d96cfec9 -s ours
am: 45a4bca09d  -s ours

Change-Id: I2124ed25893de9910be435ba68619dfc00e66239
2016-06-22 18:11:44 +00:00
Josh Gao f5592e174e DO NOT MERGE: adb: use asocket\\\\'s close function when closing. am: 83cb3032d2 -s ours am: 420aa30c9f am: 05d5db2534
am: 8ec6f5b46f  -s ours

Change-Id: If7256035b8844a6567080b5caf769a0a4f567d2f
2016-06-22 18:11:17 +00:00
Josh Gao 45a4bca09d DO NOT MERGE: adb: use asocket\\\'s close function when closing. am: 5218ad36ad am: d7e24ec999
am: a3d96cfec9  -s ours

Change-Id: I4ca0f2890519c3450a15edab989ca424b6bb10ae
2016-06-22 18:07:24 +00:00
Josh Gao 8ec6f5b46f DO NOT MERGE: adb: use asocket\\\'s close function when closing. am: 83cb3032d2 -s ours am: 420aa30c9f
am: 05d5db2534

Change-Id: I433e885416a6cbf93bc701cfebc046f78a7af7dd
2016-06-22 18:07:06 +00:00
Josh Gao a3d96cfec9 DO NOT MERGE: adb: use asocket\\'s close function when closing. am: 5218ad36ad
am: d7e24ec999

Change-Id: I9ca9e7e857de9e9679169cd7239f9e54a3d98dd2
2016-06-22 18:02:25 +00:00
Josh Gao 05d5db2534 DO NOT MERGE: adb: use asocket\\'s close function when closing. am: 83cb3032d2 -s ours
am: 420aa30c9f

Change-Id: I779b0b79ce268561f4a686d6e98c131707464ecf
2016-06-22 18:01:40 +00:00
Josh Gao d7e24ec999 DO NOT MERGE: adb: use asocket\'s close function when closing.
am: 5218ad36ad

Change-Id: Ibc9ee3b566d34847f4e1e02413890449750ba2f5
2016-06-22 17:59:18 +00:00
Josh Gao 420aa30c9f DO NOT MERGE: adb: use asocket\'s close function when closing.
am: 83cb3032d2  -s ours

Change-Id: I357c754fe2bc3fdf4f050c26aace2bea4c6569c2
2016-06-22 17:58:51 +00:00
Josh Gao 83cb3032d2 DO NOT MERGE: 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.

Backport of 53eb31d8 and 9b587de.

Bug: http://b/28347842
Change-Id: I05e071b3d5c7e55c7a59400c5c9bb0635eeef29f
2016-06-21 16:28:29 -07:00
Josh Gao 5218ad36ad DO NOT MERGE: 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.

Backport of 53eb31d8 and 9b587de.

Bug: http://b/28347842
Change-Id: I13ec6fd87a0691c72608baf6038adcc0f03dca9f
2016-06-21 16:28:21 -07:00
Josh Gao 69d2f98197 adb: fix fd double close, Subprocess lifetime issue.
This commit fixes two somewhat related issues in shell_service.

  - The fd returned by StartSubprocess is owned by a unique_fd
    contained in the Subprocess object, but also gets closed by the
    caller. Resolve this by duping the returned file descriptor.

  - A Subprocess object can be destroyed immediately after its initial
    construction in StartSubprocess if we're sufficiently unlucky.
    Split up the fork/exec and "start management thread" steps, so that
    we can safely do everything we need to do on the Subprocess before
    handing it over to the thread that'll eventually destroy it.

Also includes squashed patches from AOSP master that allow for use of
unique_fd inside adb.

Bug: http://b/29254462
Change-Id: Id9cf0b7e7a7293bee7176919edc758597691c636
(cherry picked from commit c0e6e40cc9)
(cherry picked from commit 54c72aaccc)
(cherry picked from commit 2c5d1d7cd9)
(cherry picked from commit 2a7b86337f)
(cherry picked from commit 13ea01db45)
(cherry picked from commit 344778da41)
2016-06-20 14:51:05 -07:00
Ruchi Kandoi b02819e2af Merge "logd: logcat -L takes longer causing vold to timeout." into nyc-dev 2016-06-16 17:44:30 +00:00
Ruchi Kandoi c1b26acae2 logd: logcat -L takes longer causing vold to timeout.
Temporary fix to prevent device from getting stuck at boot.

Bug: 28788401
Change-Id: Ie4246fc3c9eb7a3af2cb909546811c85997515da
Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
2016-06-14 15:26:30 -07:00
Sami Tolvanen a742d10277 Revert "logd: enforce policy integrity"
This reverts commit 0bdad0f231.

Bug: 26902605
Change-Id: I6ce8fa7bef63c45821628265c379970eb64963a2
2016-06-14 11:14:51 -07:00
Daniel Micay d4421f1962 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.

(Cherry picked from commit 2b22a66382)

Bug: 29054680

Change-Id: I6e3ae3cf18d8c76df94f879c34fb6fde519b89a9
2016-06-12 21:20:46 +00:00
TreeHugger Robot 6d349051ce Merge "Redirect bugreport stderr to host's stderr." into nyc-dev 2016-06-08 23:35:12 +00:00
Felipe Leme d1dd125bc2 Redirect bugreport stderr to host's stderr.
Change-Id: I46f474f0b0d5cacdc4b129eab1bb0a7f52ccece0
Fixes: 29161586
2016-06-08 11:09:34 -07:00
Elliott Hughes 75f42d7ea7 Allow multiple (sequential) adb users on Linux.
Before this, adb will fail to start for the second user who tries because
/tmp/adb.log already exists and isn't writable by the second user.

Also allow $TMPDIR to override the use of /tmp.

Bug: http://b/29201686
Bug: https://code.google.com/p/android/issues/detail?id=211420

(cherry picked from commit d89a6c2285)

Change-Id: Ibb1369e8043feb9774593e317dcd7bb93323fd89
2016-06-08 08:36:19 -07:00
Sami Tolvanen eacbb824c9 Merge "fs_mgr: validate corrected signatures" into nyc-dev 2016-06-07 00:01:56 +00:00
Sami Tolvanen 830126637a fs_mgr: validate corrected signatures
If signature verification fails and we have an error corrected
signature available, attempt to verify that instead.

Needs changes from
  Ie913c21ba1d07d6df4c6feeb7226b2ec963f4d19

Bug: 28943429
Change-Id: I7d48701916fe430b17aa05acb120f22a1802733d
2016-06-06 13:54:00 -07:00
David Pursell a6d5661140 adbd: properly close subprocess pipes on Ctrl+C.
When non-interactive sessions exit via Ctrl+C, adbd sends SIGHUP
to the child process to let it know to exit. However, adbd was not
closing the pipes to the child process, so if the subprocess ignored
SIGHUP and continued writing it could fill up the pipe and block
forever while adbd waits for it to exit.

This CL adds the necessary calls to close the subprocess pipe after
sending SIGHUP.

Bug: 28981563
Change-Id: I318e322e563241052648361172f4859c297837fb
(cherry picked from commit f2aa186c7b)
2016-06-06 12:56:52 -07:00
Siqi Lin 8c4076295e Revert "adb: close ep0 on disconnection."
This reverts commit 69e97e4bee.

Bug: 28932120
Change-Id: I5e2569abed316c089886556c432bfe59bca08549
(cherry picked from commit 57de0514f0)
2016-06-02 17:30:43 -07:00
Calin Juravle 6a29fe931d Merge "Add utility to prepare files in a similar way to directories" into nyc-dev 2016-06-02 10:10:37 +00:00
Daniel Micay fe01f56c0d add a property for controlling perf_event_paranoid
(Cherry picked from commit 2b22a66382)

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-06-01 16:58:48 -07:00
David Sehr 0eb24e1bc7 add /data/misc/profman for output
Bug: 28748264
Change-Id: Ib57ccc570de446e03ea8c27ce8e404929138b213
2016-05-31 17:36:41 -07:00
Erik Kline 088f0e7c40 Merge "Add /vendor/xbin to the list of directories of executables" into nyc-dev 2016-05-30 02:31:46 +00:00
Erik Kline a5a9c74f20 Add /vendor/xbin to the list of directories of executables
Bug: 28850734
Change-Id: Iaa14a463294d1f8a9c69328a273ce7f12a558bab
2016-05-27 17:37:53 +09:00
Yurii Zubrytskyi 049ebb810f [adb] Followup CL to clean up adb_auth_host.cpp
Get rid of unused includes + replace a fixed-size buffer with an
std::string

Change-Id: I4f9927b900a79a012b5d52908b9d22ac3d2a401c
2016-05-26 18:12:15 -07:00
Yurii Zubrytskyi a9e2b99a7f [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.

Bug: https://code.google.com/p/android/issues/detail?id=211233
Change-Id: Id9ca4999fd2e6393cc88278eaf444243e13c0ec0
2016-05-26 18:11:59 -07:00
Elliott Hughes 1265fd4934 resolve merge conflicts of f0d4f38 to nyc-dev
Change-Id: Ibce10a3c66560c10c67bd51f5b568552f43825f2
2016-05-24 17:22:51 -07:00
Elliott Hughes f0d4f38773 resolve merge conflicts of 7f5da85 to lmp-dev am: de529e72b6 am: 1a98776aee am: ad0c2bf5f3 am: a17f2802b1 am: 20b1e79563 am: c443a447b2
am: 5538f8bb63

* commit '5538f8bb63c79d1b9de6e809e085bd78b1027f9c':
  Fix scanf %s in lsof.

Change-Id: I09d37fb2798e6038bb00fb8e210b9d3c5348a4e4
2016-05-24 23:11:36 +00:00
Elliott Hughes 5538f8bb63 resolve merge conflicts of 7f5da85 to lmp-dev am: de529e72b6 am: 1a98776aee am: ad0c2bf5f3 am: a17f2802b1 am: 20b1e79563
am: c443a447b2

* commit 'c443a447b2f6e950b03fe472c5f7cb6c54e9ba61':
  Fix scanf %s in lsof.

Change-Id: Ia66e81641532cf7bca669fb52095aeca90158807
2016-05-24 23:08:36 +00:00
Elliott Hughes c443a447b2 resolve merge conflicts of 7f5da85 to lmp-dev am: de529e72b6 am: 1a98776aee am: ad0c2bf5f3 am: a17f2802b1
am: 20b1e79563

* commit '20b1e795637686d3a18c79413cccbba16881e295':
  Fix scanf %s in lsof.

Change-Id: Ic63528dee82e3045020b527c093b9b4fffaf5530
2016-05-24 23:05:55 +00:00