Commit Graph

10345 Commits

Author SHA1 Message Date
Tianjie Xu 6fdfd58fe1 Do Not Merge: Fix out of bound read in libziparchive
We should check the boundary of central directory before checking its
signature. Swap the order of these two checks.

Bug: 36392138
Test: libziparchive doesn't read the signature after boundary check fails.
Change-Id: Ie89f709bb2d1ccb647116fb7ccb1e23c943e5ab8
(cherry picked from commit 74464a1361)
2017-04-06 11:42:13 -07:00
Josh Gao 8027acd140 Merge "adb: actually fix the windows build." into klp-dev am: da66b9100a am: 0b4bd3feea
am: 55d871c401

Change-Id: Ia6e73d6df06b49b3c2f9b83ac5d4c8c52917d25a
2016-11-17 22:00:10 +00:00
Josh Gao 0d5c1a7745 adb: actually fix the windows build. am: 58eda35ace am: bbd6d7b3e7
am: 1ceca95f8e

Change-Id: I1c8c386d69b3528a9be8f1b2c0032ed04363a228
2016-11-17 21:59:57 +00:00
Josh Gao 55d871c401 Merge "adb: actually fix the windows build." into klp-dev am: da66b9100a
am: 0b4bd3feea

Change-Id: Ia706579c1d4f995956c91ffba7aa86e3da4e82d5
2016-11-17 21:51:38 +00:00
Josh Gao 1ceca95f8e adb: actually fix the windows build. am: 58eda35ace
am: bbd6d7b3e7

Change-Id: I0d2553e19b3e96e9af4e0aa3493a4b8b36e55431
2016-11-17 21:51:26 +00:00
Josh Gao 0b4bd3feea Merge "adb: actually fix the windows build." into klp-dev
am: da66b9100a

Change-Id: If9b3829707e7fc6d9846bc769108180e08d67b5f
2016-11-17 21:43:27 +00:00
Josh Gao bbd6d7b3e7 adb: actually fix the windows build.
am: 58eda35ace

Change-Id: If917d578acb8a0b289369f7b5b1aca7deff4a4b9
2016-11-17 21:43:26 +00:00
Josh Gao da66b9100a Merge "adb: actually fix the windows build." into klp-dev 2016-11-17 21:32:45 +00:00
Josh Gao 58eda35ace adb: actually fix the windows build.
Bug: http://b/32292581
Change-Id: I714e1f47c2c2e89027989d485cb28891b905f931
2016-11-15 13:05:11 -08:00
Josh Gao 4775e66996 Merge "adb: turn darwin/windows builds back on, hopefully fix them." into klp-dev am: b19b5fe08c am: 50fb0a1f11
am: 85b6b13175

Change-Id: I4a983b34a4c613a3226834d8683e520d6de3e617
2016-11-14 22:26:25 +00:00
Josh Gao 8b88eb368a adb: turn darwin/windows builds back on, hopefully fix them. am: a9c0ac0c46 am: e4e1ed0e5b
am: ddf0740c08

Change-Id: I82ec8fe1bd14a0e80bd4cd57ca4958d5999eea3a
2016-11-14 22:26:10 +00:00
Josh Gao 85b6b13175 Merge "adb: turn darwin/windows builds back on, hopefully fix them." into klp-dev am: b19b5fe08c
am: 50fb0a1f11

Change-Id: Id68902bdc816f3885f97e6ea1226ed538e9df506
2016-11-14 22:18:52 +00:00
Josh Gao ddf0740c08 adb: turn darwin/windows builds back on, hopefully fix them. am: a9c0ac0c46
am: e4e1ed0e5b

Change-Id: I36f3c0d34a64e7983a95607143e863d332e5324b
2016-11-14 22:18:39 +00:00
Josh Gao 50fb0a1f11 Merge "adb: turn darwin/windows builds back on, hopefully fix them." into klp-dev
am: b19b5fe08c

Change-Id: If4c9afd09de879519e4fd38d3b792af211c44d29
2016-11-14 22:10:40 +00:00
Josh Gao e4e1ed0e5b adb: turn darwin/windows builds back on, hopefully fix them.
am: a9c0ac0c46

Change-Id: Icc58ac512edaaa0a47dda375147a832214107556
2016-11-14 22:10:39 +00:00
Josh Gao b19b5fe08c Merge "adb: turn darwin/windows builds back on, hopefully fix them." into klp-dev 2016-11-14 21:53:50 +00:00
Josh Gao a9c0ac0c46 adb: turn darwin/windows builds back on, hopefully fix them.
Bug: http://b/32292581
Change-Id: Ie5182165a122f7aed4a5728906f005cc7d54ddd1
2016-11-14 13:06:44 -08:00
Tianjie Xu 3bd49af10b DO NOT MERGE:Add missing SOCK_CLOEXEC flag when opening socket am: a7ba9ff00b am: 4f3df4e131
am: ccfb7619f4  -s ours

Change-Id: If730d293efe1076a33555863fb6122ddde77694c
2016-11-08 23:09:24 +00:00
Tianjie Xu ccfb7619f4 DO NOT MERGE:Add missing SOCK_CLOEXEC flag when opening socket am: a7ba9ff00b
am: 4f3df4e131

Change-Id: I067fb2db1e83a0af84f248774b78c155f5e89c96
2016-11-08 23:03:21 +00:00
Tianjie Xu 4f3df4e131 DO NOT MERGE:Add missing SOCK_CLOEXEC flag when opening socket
am: a7ba9ff00b

Change-Id: I827b249f556667747b1978ec8500185a54094030
2016-11-08 22:57:51 +00:00
Tianjie Xu 40138b630c Merge "DO NOT MERGE:Add missing SOCK_CLOEXEC flag when opening socket" into lmp-dev 2016-11-08 22:50:32 +00:00
Tianjie Xu a7ba9ff00b DO NOT MERGE:Add missing SOCK_CLOEXEC flag when opening socket
Go through the code that opens socket in marshmallow, and backport the
SOCK_CLOEXEC usage for AF_NETLINK. In kitkat, SOCK_CLOEXEC is not defined;
therefore I used O_CLOEXEC instead.
Bug: 31242981
Test: mma

Change-Id: I792024c16b84ba3d6666d3df6002c89e0028f4b0
2016-11-03 06:08:55 +00:00
Tianjie Xu bef09aaf9e DO NOT MERGE:Add missing SOCK_CLOEXEC flag when opening socket
Go through the code that opens socket in marshmallow, and backport the
SOCK_CLOEXEC usage when opening sockets with AF_NETLINK.
Bug: 31242981
Test: mma

Change-Id: I709fc1dd43a883f95bb99021e1350c062ca35203
2016-11-03 06:08:17 +00:00
Tianjie Xu 1ee4892e66 Fix out of bound access in libziparchive
The boundary check of an invalid EOCD record may succeed due to the
overflow of uint32_t. Fix the check.

Test: Open the crash.apk and libziparchive reports the offset error as expected.

Bug: 31251826
Change-Id: I1d8092a19b73886a671bc9d291cfc27d65e3d236
(cherry picked from commit ae8180c06d)
2016-09-22 18:24:53 -07:00
Narayan Kamath 61f27551c7 resolve merge conflicts of a47780b to lmp-dev
Test: test_zipfile with known bad files.

Change-Id: I25dde73c9b94d253c8017e441e89cb7339907c7f
2016-09-21 09:57:39 +01:00
Narayan Kamath a47780b998 libzipfile: add additional validity checks. am: a1ec23634a
am: c307830f5d

Change-Id: I5d856cec4528541ff5416456cbe1338c78a09699
2016-09-21 08:26:10 +00:00
Narayan Kamath c307830f5d libzipfile: add additional validity checks.
am: a1ec23634a

Change-Id: I290e611776bd58b47266a2cb9371a832bdc0744e
2016-09-21 08:23:39 +00:00
Narayan Kamath a1ec23634a libzipfile: add additional validity checks.
- Make sure the start and end of the data for a given entry are
  within the allocated buffer.
- Make sure all central directory entries start and end within the
  central directory buffer.
- Reject zip file entries that have no filenames.

bug: 30916186
test: test_zipfile with known bad zip files.
Change-Id: Ibf3f6469e60c85ec1608f5ce613d40867d2d09b7
2016-09-13 16:08:38 +01:00
Narayan Kamath 0414412007 Merge "liblog: add __android_log_close()" into lmp-dev 2016-09-07 18:48:15 +00:00
Mark Salyzyn ef661e0a6d liblog: add __android_log_close() am: c68706fe49 am: edc5507f76
am: 85b0dd64f1  -s ours

Change-Id: If80f5b856cbcfc0334696e9d734e8c9ad90eca36
2016-09-07 18:48:03 +00:00
Mark Salyzyn 85b0dd64f1 liblog: add __android_log_close() am: c68706fe49
am: edc5507f76

Change-Id: Ia2acfa02bd8f7e35d83791ea8242139a7ac34435
2016-09-07 18:43:14 +00:00
Mark Salyzyn edc5507f76 liblog: add __android_log_close()
am: c68706fe49

Change-Id: I0f63dcafaa4b6bf40dddb3674c3768b0cb158fe4
2016-09-07 18:40:15 +00:00
Mark Salyzyn 2d14969155 liblog: add __android_log_close()
Bug: 30963384

(cherry picked from commit df7a4c6bae)

Change-Id: I2255486e84dd55af0f4e7fbbfb616c2deb1765d0
2016-09-05 15:50:58 +01:00
Mark Salyzyn c68706fe49 liblog: add __android_log_close()
Bug: 30963384

(cherry picked from commit df7a4c6bae)

Change-Id: Iff0634a66c4b690331f5da66f7a6c2364b64480e
2016-09-05 15:44:22 +01:00
Connor O'Brien b906ad88b9 Fix vold vulnerability in FrameworkListener am: 470484d2a2 am: e9e046df6c
am: 109024f74a

Change-Id: Ia6e8dca36bc28d442a6e374ecf033b79176f4b93
2016-08-19 22:11:27 +00:00
Connor O'Brien 109024f74a Fix vold vulnerability in FrameworkListener am: 470484d2a2
am: e9e046df6c

Change-Id: I8f2452782817ddf03051af08e70ba9d4c4fa578a
2016-08-19 22:08:22 +00:00
Connor O'Brien e9e046df6c Fix vold vulnerability in FrameworkListener
am: 470484d2a2

Change-Id: Id27ae391c4c0e07f014fbde41d99d45bfa275554
2016-08-19 22:01:08 +00:00
Connor O'Brien 470484d2a2 Fix vold vulnerability in FrameworkListener
Modify FrameworkListener to ignore commands that exceed the maximum
buffer length and send an error message.

Bug: 29831647
Change-Id: I9e57d1648d55af2ca0191bb47868e375ecc26950
Signed-off-by: Connor O'Brien <connoro@google.com>
(cherry picked from commit baa126dc15)
2016-08-19 17:05:25 +00:00
Josh Gao 58dd6f7cba Merge "DO NOT MERGE: debuggerd: verify that traced threads belong to the right process." into klp-dev am: 23effb07ee am: ac3fbb1a4a
am: 7ed0995930  -s ours

Change-Id: I5e4be4eaca413d2f1a8027cf5fa69be9e1d9a644
2016-08-15 19:01:10 +00:00
Josh Gao 2071bcfa75 DO NOT MERGE: debuggerd: verify that traced threads belong to the right process. am: 8d6ca194ee am: 8f7cc0e387 -s ours
am: be9d9fc379  -s ours

Change-Id: I8c637fa765c4f6b79354855f245e78b82b87e3bf
2016-08-15 19:01:10 +00:00
Josh Gao 7ed0995930 Merge "DO NOT MERGE: debuggerd: verify that traced threads belong to the right process." into klp-dev am: 23effb07ee
am: ac3fbb1a4a

Change-Id: I6988483d7d461c1accdb27130517d11d0fdd7f0e
2016-08-15 18:57:27 +00:00
Josh Gao be9d9fc379 DO NOT MERGE: debuggerd: verify that traced threads belong to the right process. am: 8d6ca194ee
am: 8f7cc0e387  -s ours

Change-Id: I073d06e3ee81c39bfaca866783de2113ac13cf72
2016-08-15 18:57:09 +00:00
Josh Gao ac3fbb1a4a Merge "DO NOT MERGE: debuggerd: verify that traced threads belong to the right process." into klp-dev
am: 23effb07ee

Change-Id: If1aa441cf204ce5f3e56b9c1d2637acae72a83e1
2016-08-15 18:29:09 +00:00
Josh Gao 8f7cc0e387 DO NOT MERGE: debuggerd: verify that traced threads belong to the right process.
am: 8d6ca194ee

Change-Id: I1459607b655da6e01bd5d59e31bdb6d79d504431
2016-08-15 18:29:09 +00:00
Josh Gao 23effb07ee Merge "DO NOT MERGE: debuggerd: verify that traced threads belong to the right process." into klp-dev 2016-08-15 18:18:44 +00: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
Josh Gao 8d6ca194ee 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: I93f6423e6de38e2bc6c75d8d33052da4cd2daa8a
2016-07-14 16:19:49 -07: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 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 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