Commit Graph

14810 Commits

Author SHA1 Message Date
Josh Gao 5c4bf3d66f DO NOT MERGE: adb: reenable (and fix) Windows build.
am: 804de7a29e

Change-Id: I4dc4d5cb64c4757894fbdff1b3e12426aa965aa7
2016-08-11 20:19:09 +00:00
Josh Gao 804de7a29e DO NOT MERGE: adb: reenable (and fix) Windows build.
This branch is still getting used to build some SDK targets.

Bug: http://b/30767018
Change-Id: I85b03a80d69ceef5e5333505f0832129387ed2da
2016-08-11 11:29:43 -07:00
Josh Gao fe59793375 debuggerd: fix missed use of ptrace(PTRACE_ATTACH).
am: 8b6b654a5f

Change-Id: Iebf1eb6f47a917c84c3e5f1bd16d9ed5f3a487ae
2016-08-09 23:23:00 +00:00
Josh Gao 8b6b654a5f debuggerd: fix missed use of ptrace(PTRACE_ATTACH).
Bug: http://b/29555636
Change-Id: Ibd8a2e2b619b74aac667555b7085d6f28e367c07
2016-08-09 15:52:26 -07:00
Josh Gao 174579d6ef DO NOT MERGE: debuggerd: verify that traced threads belong to the right process. am: 0528829b73 -s ours am: b9b6ec3644 am: 5920345eeb am: cb4d905c96 -s ours
am: e467cced5c

Change-Id: Id5534fddb6ca8c237fbcfd310a6843f03c12a3d3
2016-07-19 20:44:11 +00:00
Josh Gao e467cced5c DO NOT MERGE: debuggerd: verify that traced threads belong to the right process. am: 0528829b73 -s ours am: b9b6ec3644 am: 5920345eeb
am: cb4d905c96  -s ours

Change-Id: Ia99e7055a24da12133e48e03b466fe09ebcb811f
2016-07-19 20:42:28 +00:00
Josh Gao be484f3f7b DO NOT MERGE: debuggerd: verify that traced threads belong to the right process. am: 36dd144367 am: 9048b3bb8e am: 6cb199bf4a -s ours
am: 851f840835

Change-Id: I4edf38e6bbee8745241329816647d730addc23ea
2016-07-19 20:40:05 +00:00
Josh Gao cb4d905c96 DO NOT MERGE: debuggerd: verify that traced threads belong to the right process. am: 0528829b73 -s ours am: b9b6ec3644
am: 5920345eeb

Change-Id: I06ba81a4abd04402ef250efebd333b878496cdab
2016-07-19 20:38:46 +00:00
Josh Gao 851f840835 DO NOT MERGE: debuggerd: verify that traced threads belong to the right process. am: 36dd144367 am: 9048b3bb8e
am: 6cb199bf4a  -s ours

Change-Id: I26ed6fa730d66419319a5832b7f011cd15601e03
2016-07-19 20:36:38 +00:00
Josh Gao 5920345eeb DO NOT MERGE: debuggerd: verify that traced threads belong to the right process. am: 0528829b73 -s ours
am: b9b6ec3644

Change-Id: Iaf40759e124c4a01a9a3d21021939729a73c48e9
2016-07-19 20:35:39 +00:00
Josh Gao 8a9e4369f6 Merge \"DO NOT MERGE: debuggerd: verify that traced threads belong to the right process.\" into mnc-dev
am: 73922b82ee

Change-Id: I36abe7ac6a52b561cfed8dfa689216b166f4df43
2016-07-19 20:34:12 +00:00
Josh Gao 6cb199bf4a DO NOT MERGE: debuggerd: verify that traced threads belong to the right process. am: 36dd144367
am: 9048b3bb8e

Change-Id: I2223884e41d15dabf94df861e28f9392b82678af
2016-07-19 20:33:40 +00:00
Josh Gao b9b6ec3644 DO NOT MERGE: debuggerd: verify that traced threads belong to the right process.
am: 0528829b73  -s ours

Change-Id: I1644cca9d9631f291a3e80b6813e9cc33a8d5833
2016-07-19 20:32:42 +00:00
Josh Gao 9048b3bb8e DO NOT MERGE: debuggerd: verify that traced threads belong to the right process.
am: 36dd144367

Change-Id: I29864f223541596e9ffccb44c0c257399b0d9cb0
2016-07-19 20:30:19 +00:00
Josh Gao 73922b82ee Merge "DO NOT MERGE: debuggerd: verify that traced threads belong to the right process." into mnc-dev 2016-07-19 20:20:56 +00:00
Josh Gao a50e8ffa7d DO NOT MERGE: debuggerd: verify that traced threads belong to the right process.
Fix two races in debuggerd's PTRACE_ATTACH logic:
  1. The target thread in a crash dump request could exit between the
     /proc/<pid>/task/<tid> check and the PTRACE_ATTACH.
  2. Sibling threads could exit between listing /proc/<pid>/task and the
     PTRACE_ATTACH.

Backport of NYC change I4dfe1ea30e2c211d2389321bd66e3684dd757591
Bug: http://b/29555636
Change-Id: I6c6efcf82a49bca140d761b2d1de04215ba4d252
2016-07-18 13:23:29 -07:00
Josh Gao d179556680 adb: use asocket\'s close function when closing.
am: f71c01493a

Change-Id: Id77dd7ff1931f03ea7f1e0339eca6610e02e9122
2016-07-18 19:47:45 +00:00
Josh Gao a6b92d1f2e adb: switch the socket list mutex to a recursive_mutex.
am: 6f641adea5

Change-Id: I839bc3817e7d7bb24b2bf3c5059919802c9f5d33
2016-07-18 19:47:45 +00:00
Josh Gao 36dd144367 DO NOT MERGE: debuggerd: verify that traced threads belong to the right process.
Fix two races in debuggerd's PTRACE_ATTACH logic:
  1. The target thread in a crash dump request could exit between the
     /proc/<pid>/task/<tid> check and the PTRACE_ATTACH.
  2. Sibling threads could exit between listing /proc/<pid>/task and the
     PTRACE_ATTACH.

Backport of NYC change I4dfe1ea30e2c211d2389321bd66e3684dd757591
Bug: http://b/29555636
Change-Id: I320f47216b21018d3f613cfbbaaff40b3548ef36
2016-07-18 19:35:45 +00:00
Josh Gao f71c01493a 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
(cherry picked from commit 53eb31d87c)
(cherry picked from commit 014b01706c)
2016-07-15 17:17:14 -07:00
Josh Gao 6f641adea5 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
(functionally a cherrypick of 903b749f + 9b587dec, with windows disabled)
2016-07-15 17:17:14 -07:00
Josh Gao 0528829b73 DO NOT MERGE: debuggerd: verify that traced threads belong to the right process.
Fix two races in debuggerd's PTRACE_ATTACH logic:
  1. The target thread in a crash dump request could exit between the
     /proc/<pid>/task/<tid> check and the PTRACE_ATTACH.
  2. Sibling threads could exit between listing /proc/<pid>/task and the
     PTRACE_ATTACH.

Backport of NYC change I4dfe1ea30e2c211d2389321bd66e3684dd757591
Bug: http://b/29555636
Change-Id: I320f47216b21018d3f613cfbbaaff40b3548ef36
2016-07-14 16:47:10 -07:00
Sergio Giro ae21a25383 Merge \\\\\"DO NOT MERGE libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8\\\\\" into lmp-dev am: 8d2d6cedbb -s ours am: 71da8e7537 am: 5e03ed1dab am: b00e3603ef -s ours
am: 72bad95df5

Change-Id: I157121792e7de52ae705afc105ebf31299612b59
2016-07-14 18:24:17 +00:00
Sergio Giro 207717bde6 DO NOT MERGE libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8 am: 2806397d1e am: 8c9d02551c am: 28f28ce635 -s ours
am: f611765aaf

Change-Id: I236fac995374280f948759f44e673aff98b53447
2016-07-14 18:24:13 +00:00
Sergio Giro 01dbd1da64 libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8
am: 3411dd4457

Change-Id: I34322210bd7ab90c1986d55f9b444292e76c646a
2016-07-14 18:07:28 +00:00
Sergio Giro 72bad95df5 Merge \\\\"DO NOT MERGE libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8\\\\" into lmp-dev am: 8d2d6cedbb -s ours am: 71da8e7537 am: 5e03ed1dab
am: b00e3603ef  -s ours

Change-Id: Id73880ce44c4a1cb14c04b6e533e888ac28e1ae0
2016-07-14 18:03:17 +00:00
Sergio Giro f611765aaf DO NOT MERGE libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8 am: 2806397d1e am: 8c9d02551c
am: 28f28ce635  -s ours

Change-Id: I2ef3ab0e4e3c64c9b5c17454ab738f3d5bdb5dd3
2016-07-14 18:03:14 +00:00
Sergio Giro b00e3603ef Merge \\\"DO NOT MERGE libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8\\\" into lmp-dev am: 8d2d6cedbb -s ours am: 71da8e7537
am: 5e03ed1dab

Change-Id: I69b9c166dcd1f76cfe6555cae0580366f79258cc
2016-07-14 18:00:50 +00:00
Sergio Giro 28f28ce635 DO NOT MERGE libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8 am: 2806397d1e
am: 8c9d02551c

Change-Id: Ia8754c27d2d2a639280235c2dbf9043f3442421e
2016-07-14 17:59:56 +00:00
Sergio Giro 5e03ed1dab Merge \\"DO NOT MERGE libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8\\" into lmp-dev am: 8d2d6cedbb -s ours
am: 71da8e7537

Change-Id: I1c9b5abdf550bb2e6f294c7f0920ff72e6bcfc0e
2016-07-14 17:59:48 +00:00
Sergio Giro 8c9d02551c DO NOT MERGE libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8
am: 2806397d1e

Change-Id: I28785c3aa9d2b11b045c53fea557c0d74bd65181
2016-07-14 17:52:06 +00:00
Sergio Giro 71da8e7537 Merge \"DO NOT MERGE libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8\" into lmp-dev
am: 8d2d6cedbb  -s ours

Change-Id: Id0e0d5176560cf883da2e5507ba9106ecc624536
2016-07-14 17:52:05 +00:00
Sergio Giro 8d2d6cedbb Merge "DO NOT MERGE libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8" into lmp-dev 2016-07-14 17:36:23 +00:00
Sergio Giro 2806397d1e DO NOT MERGE libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8
Inconsistent behaviour between utf16_to_utf8 and utf16_to_utf8_length
is causing a heap overflow.

Correcting the length computation and adding bound checks to the
conversion functions.

(cherry picked from commit c4966a363e)

Change-Id: Idfb0eb29b305678608586d25c2f372146569ad39
Bug: 29250543
2016-07-14 17:25:27 +00:00
Sergio Giro 3411dd4457 libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8
Inconsistent behaviour between utf16_to_utf8 and utf16_to_utf8_length
is causing a heap overflow.

Correcting the length computation and adding bound checks to the
conversion functions.

Test: ran libutils_tests
Bug: 29250543
Change-Id: I6115e3357141ed245c63c6eb25fc0fd0a9a7a2bb
(cherry picked from commit c4966a363e)
2016-07-14 16:49:50 +01:00
Sergio Giro b022447a3a DO NOT MERGE libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8
Inconsistent behaviour between utf16_to_utf8 and utf16_to_utf8_length
is causing a heap overflow.

Correcting the length computation and adding bound checks to the
conversion functions.

(cherry picked from commit c4966a363e)

Change-Id: Idfb0eb29b305678608586d25c2f372146569ad39
Bug: 29250543
2016-07-14 14:47:59 +00:00
Sergio Giro 2858362ffe DO NOT MERGE libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8 am: 5fce0542b6 am: d0ad14ca21 am: 3841c92912 -s ours am: 247ac63c69 -s ours am: 6179f1a56e am: 451f4b3d04 am: 3c85e4e5e7 -s ours
am: baac6666fe

Change-Id: I78b737a0a19a9ae692fd94f1b3ca8d0870291c96
2016-07-14 13:40:49 +00:00
Sergio Giro baac6666fe DO NOT MERGE libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8 am: 5fce0542b6 am: d0ad14ca21 am: 3841c92912 -s ours am: 247ac63c69 -s ours am: 6179f1a56e am: 451f4b3d04
am: 3c85e4e5e7  -s ours

Change-Id: I2a4bdacfce15e656f487ad24508df3d4066ca8b7
2016-07-14 13:34:44 +00:00
Sergio Giro 3c85e4e5e7 DO NOT MERGE libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8 am: 5fce0542b6 am: d0ad14ca21 am: 3841c92912 -s ours am: 247ac63c69 -s ours am: 6179f1a56e
am: 451f4b3d04

Change-Id: I1781e52845996557f9f6a7e8b359e1d698e38e45
2016-07-14 13:28:27 +00:00
Sergio Giro 451f4b3d04 DO NOT MERGE libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8 am: 5fce0542b6 am: d0ad14ca21 am: 3841c92912 -s ours am: 247ac63c69 -s ours
am: 6179f1a56e

Change-Id: I1622017cea3f29fc17e8f75f0cfa77c786a08937
2016-07-14 13:16:45 +00:00
Sergio Giro 6179f1a56e DO NOT MERGE libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8 am: 5fce0542b6 am: d0ad14ca21 am: 3841c92912 -s ours
am: 247ac63c69  -s ours

Change-Id: Ia8ee4d393bc8cf9cde7ada6af9f79eeee3100f80
2016-07-14 13:08:26 +00:00
Sergio Giro 247ac63c69 DO NOT MERGE libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8 am: 5fce0542b6 am: d0ad14ca21
am: 3841c92912  -s ours

Change-Id: Ia555a7e1a9eaf3f00dfa91ceb8afe85c48e4b7d5
2016-07-14 13:01:44 +00:00
Sergio Giro 3841c92912 DO NOT MERGE libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8 am: 5fce0542b6
am: d0ad14ca21

Change-Id: Id0901a86ea469d664badfee75db32948c88e72f7
2016-07-14 12:55:58 +00:00
Sergio Giro d0ad14ca21 DO NOT MERGE libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8
am: 5fce0542b6

Change-Id: I348b457decce08d6d08819a16d618b0bc194aa91
2016-07-14 12:49:59 +00:00
Sergio Giro 5fce0542b6 DO NOT MERGE libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8
Inconsistent behaviour between utf16_to_utf8 and utf16_to_utf8_length
is causing a heap overflow.

Correcting the length computation and adding bound checks to the
conversion functions.

(cherry picked from commit c4966a363e)

Bug: 29250543
Change-Id: Ia2d6a550f5594280505fb0835c752e53898700ed
2016-07-14 12:34:30 +00:00
Sergio Giro 85d694cd0d Revert \\\\\\\\"libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8\\\\\\\\" am: 311002936e am: ddd0051968 am: b218b2d34d am: 605de74373 am: 37826f5613 am: 80473d5d33 am: c06d338ad7
am: e059f5e325

Change-Id: I5682a9b927fb31cb3d888b7f430d8ad62fcaeef3
2016-07-13 13:05:57 +00:00
Sergio Giro e059f5e325 Revert \\\\\\\"libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8\\\\\\\" am: 311002936e am: ddd0051968 am: b218b2d34d am: 605de74373 am: 37826f5613 am: 80473d5d33
am: c06d338ad7

Change-Id: I4ee28f7eb936464eeee476b9fedb19aa7fb96ac0
2016-07-13 13:01:47 +00:00
Sergio Giro c06d338ad7 Revert \\\\\\"libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8\\\\\\" am: 311002936e am: ddd0051968 am: b218b2d34d am: 605de74373 am: 37826f5613
am: 80473d5d33

Change-Id: Ia5cb6e89924e69df568d633472656dd4b0c12a76
2016-07-13 12:58:09 +00:00
Sergio Giro 80473d5d33 Revert \\\\\"libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8\\\\\" am: 311002936e am: ddd0051968 am: b218b2d34d am: 605de74373
am: 37826f5613

Change-Id: I3bc2854586879b2a7d7678516a99b7f767a3d4cb
2016-07-13 12:54:32 +00:00
Sergio Giro 37826f5613 Revert \\\\"libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8\\\\" am: 311002936e am: ddd0051968 am: b218b2d34d
am: 605de74373

Change-Id: Ib58bd045e59fcfcf449b346861b5427d07fba9c6
2016-07-13 12:51:06 +00:00