Commit graph

6341 commits

Author SHA1 Message Date
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
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
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
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
311002936e Revert "libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8"
This reverts commit 53473c1607.

Change-Id: I27379317e08ecbd5e3b95b7ece58194838ab6c21
2016-07-13 11:47:53 +00:00
Sergio Giro
53473c1607 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)
(changed code for safetynet logging due to lack of sstream and string in klp)

Change-Id: If50d59a91a13fddbff9a8fff0d3eebe57c711e93
Bug: 29250543
2016-07-12 18:39:11 +01: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
Elliott Hughes
008efb756f Fix scanf %s in lsof.
Bug: http://b/28175237
Change-Id: Ief0ba299b09693ad9afc0e3d17a8f664c2fbb8c2
2016-04-19 14:57:09 -07:00
Daniel Rosenberg
6ea6c04ca6 Fix overflow in path building
An incorrect size was causing an unsigned value
to wrap, causing it to write past the end of
the buffer.

Bug: 28085658
Change-Id: Ie9625c729cca024d514ba2880ff97209d435a165
2016-04-13 00:11:52 +00:00
Josh Gao
a183654b82 Don't demangle symbol names. DO NOT MERGE
Bug: http://b/27299236
Change-Id: I80524d8d5df9c5abea8c6db8ded965a5dfa3d607
2016-03-22 11:33:28 -07:00
Josh Gao
557749e55b Don't create tombstone directory. DO NOT MERGE
Partial backport of cf79748.

Bug: http://b/26403620
Change-Id: I412889bfa331c96ad8e2ce6e0d66b54fb230e8c0
2016-02-16 15:07:35 -08:00
Josh Gao
9515c23e16 debuggerd: use O_NOFOLLOW|O_CLOEXEC for tombstones. DO NOT MERGE
Effectively a cherry-pick of 04f9b2a.

Bug: http://b/26403620
Change-Id: I0437fdc774501f428d8b4f8dd7682b32eaa29cef
2016-02-16 15:07:35 -08:00
Nick Kralevich
9c0ed66313 ensure /data/tombstones exists on all Android device. DO NOT MERGE
/data/tombstones is referenced by core platform code, but is not
guaranteed to exist on all Android devices. Move the directory
creation out of device specific files and into the core
init.rc file.

Bug: https://code.google.com/p/android/issues/detail?id=93207
Change-Id: I94ae5199a6a32c4fe555ca994fc4a8345e0c9690

Bug: http://b/26403620
(cherry picked from commit 0359d778a5)
2016-02-16 15:07:29 -08:00
Jon Larimer
809d5a0158 Merge "Add macro to call event logger for errors. DO NOT MERGE" into klp-dev 2015-11-11 13:42:33 +00:00
William Luh
4fd82100cc Add macro to call event logger for errors. DO NOT MERGE
Bug:23180694
Change-Id: I566a290334345f48013029534efef3e08e726e40
2015-11-10 22:33:10 +00:00
Narayan Kamath
6c53de92cf Follow up to change b638126ed DO NOT MERGE.
Resolves delta between the kitkat and L version of this patch.
Fixes the molly build on klp-dev.

bug: 22953624
Change-Id: I696a506320f30d3d5cd95f6da35361244986cb36
2015-09-10 20:30:59 +00:00
Narayan Kamath
b638126ed3 libutils: Fix integer overflows in VectorImpl. DO NOT MERGE
Use external/safe-iop to check for overflows on arithmetic
operations.

Also remove an unnecessary copy of Vector/SharedBuffer from
codeflinger and use the copy from libutils instead.

Note that some of the unit tests are somewhat useless due to
test-runner limitations : gtest's ability to filter on abort message
doesn't work when combined with messages formatted by android's logging
system.

bug: 22953624

(cherry picked from commit c609c31fb5)

Change-Id: I673b7ab142bed4fcba9159a00a65cf6bca6b1f6c
2015-09-09 11:20:13 +01:00
Sergio Giro
66b6eb9490 [DO NOT MERGE] libutils: fix overflow in SharedBuffer
See
https://code.google.com/p/android/issues/detail?id=181910

Bug: 22952485
(cherry picked from commit 7987b83553)

Change-Id: I3cac87185f209dc79678ae702aa18afbdf4190df
2015-08-21 20:36:19 +01:00
Abhishek Arya
e0dce90b0d Fix compile failure after rIfe1dc0791040150132bea6884f1e6c8d31972d1b
Bug: 23290056
Change-Id: If6e22b0159de6635a8ca5305895b7718f15becc7
2015-08-20 21:55:55 -07:00
Sergio Giro
5b85b1d40d libutils: fix overflow in String8::allocFromUTF8
Patch contributed in:
https://code.google.com/p/android/issues/detail?id=182908

Bug: 23290056

(cherry picked from commit 4eeacbeec0)

Change-Id: Ife1dc0791040150132bea6884f1e6c8d31972d1b
(cherry picked from commit ebabef2752)
2015-08-18 20:52:25 +00:00
Adam Lesinski
9bd7afc0a1 Prevent integer overflow when allocating native_handle_t
User specified values of numInts and numFds can overflow
and cause malloc to allocate less than we expect, causing
heap corruption in subsequent operations on the allocation.

Bug: 19334482
Change-Id: I43c75f536ea4c08f14ca12ca6288660fd2d1ec55
2015-05-27 10:20:03 -07:00
JP Abgrall
efbf36f2da init.rc: prep tcp_default_init_rwnd, set the default to 60
The kernel's default is between 4~20.

Prepare for javaland to modify the value at runtime.

It can be done via
  setprop sys.sysctl.tcp_def_init_rwnd  <value>


Bug: 12020135
Change-Id: Id34194b085206fd02e316401c0fbbb9eb52522d2
(cherry picked from commit 7c862c8b5e)
2014-03-13 00:25:51 +00:00
Nick Kralevich
6941a83c2d don't load property_contexts from /data
Bug: 12613118
Change-Id: I5a84b13d2151075d5136e3682431fbcc9307df13
(cherry picked from commit dc3a42bb11)
2014-03-04 19:14:34 +00:00
Nick Kralevich
02916aa20e Remove obsolete vdc call.
Since ca8e66a8b0, init has
been handling reboots and filesystem unmounts. Remove obsolete
call to vdc.

Bug: 12504045
Change-Id: If8704ca042cb3a68857743b9973e48c52e7eb881
(cherry picked from commit 225459a5da)
2014-03-04 04:54:00 +00:00
Nick Kralevich
b2dfa7ece7 am 02d90b92: am 33e7f915: am 54a80bcf: am cd072e94: am ba104fb7: am e975716e: am 03d4eb29: am d63fb078: am e89e09dd: Fix overflow in adb_client
* commit '02d90b92ce65ad4e7f49565f0e97373e1d8b0fbf':
  Fix overflow in adb_client
2013-12-10 12:39:32 -08:00
Nick Kralevich
02d90b92ce am 33e7f915: am 54a80bcf: am cd072e94: am ba104fb7: am e975716e: am 03d4eb29: am d63fb078: am e89e09dd: Fix overflow in adb_client
* commit '33e7f915d6a27880dd4c4c0709dcc921f549eea2':
  Fix overflow in adb_client
2013-12-10 12:37:32 -08:00
Nick Kralevich
33e7f915d6 am 54a80bcf: am cd072e94: am ba104fb7: am e975716e: am 03d4eb29: am d63fb078: am e89e09dd: Fix overflow in adb_client
* commit '54a80bcf88060b21f527c631c7ec911171bdb13f':
  Fix overflow in adb_client
2013-12-10 12:31:17 -08:00
Nick Kralevich
54a80bcf88 am cd072e94: am ba104fb7: am e975716e: am 03d4eb29: am d63fb078: am e89e09dd: Fix overflow in adb_client
* commit 'cd072e94cf7e546cd6d333cd65641edcd69402b7':
  Fix overflow in adb_client
2013-12-10 12:29:05 -08:00
Nick Kralevich
cd072e94cf am ba104fb7: am e975716e: am 03d4eb29: am d63fb078: am e89e09dd: Fix overflow in adb_client
* commit 'ba104fb7f1f0acad99a0d3a1cf7153aab57ea450':
  Fix overflow in adb_client
2013-12-10 12:25:59 -08:00
Nick Kralevich
ba104fb7f1 am e975716e: am 03d4eb29: am d63fb078: am e89e09dd: Fix overflow in adb_client
* commit 'e975716e36c9ad6aa80be2b54ee2cc63eadbdc44':
  Fix overflow in adb_client
2013-12-10 12:22:50 -08:00
Nick Kralevich
e975716e36 am 03d4eb29: am d63fb078: am e89e09dd: Fix overflow in adb_client
* commit '03d4eb29003a712c28733646588fafc8939fc1fe':
  Fix overflow in adb_client
2013-12-10 12:20:08 -08:00
Nick Kralevich
03d4eb2900 am d63fb078: am e89e09dd: Fix overflow in adb_client
* commit 'd63fb078aea697c536b19c03d29d4dde4ac087fc':
  Fix overflow in adb_client
2013-12-10 12:17:45 -08:00
Nick Kralevich
d63fb078ae am e89e09dd: Fix overflow in adb_client
* commit 'e89e09dd2b9b42184973e3ade291186a2737bced':
  Fix overflow in adb_client
2013-12-10 12:14:44 -08:00
Nick Kralevich
e89e09dd2b Fix overflow in adb_client
Change-Id: I7f8582bd8a69d61ce47d11a9ffd0e901fc371037
Credit: Joshua Drake
Bug: 12060953
2013-12-10 10:18:10 -08:00
Todd Poynor
479efb540a init.rc: mount pstore fs, set console-ramoops permissions
Change-Id: I44cb00f9123c6044a03de926b6a616da753bb549
2013-11-21 20:23:54 -08:00
Igor Murashkin
e65b7ea880 utils: Fix broken sdk build on windows
Bug: 11324229
Change-Id: Ia50e79b5e2430faea77b0c98902e8e018fb9ceff
2013-10-30 18:09:52 -07:00
Igor Murashkin
81f2c3d211 utils: Fix broken build
Bug: 11324229
Change-Id: I7e4f514c5531e4c0c11bb0ba5d67e4dabbcd5792
2013-10-30 16:05:45 -07:00
Igor Murashkin
1b84e0a314 Merge "utils: Add ProcessCallStack to collect stack traces for all threads in a process" into klp-dev 2013-10-30 21:09:28 +00:00
Igor Murashkin
ec79ef2e7b utils: Add ProcessCallStack to collect stack traces for all threads in a process
- Also add a Printer class (print lines to logcat, fd, or strings)

Bug: 11324229
Change-Id: I78435ed49aa196a0efb45bf9b2d58b62c41737d3
2013-10-25 19:24:56 -07:00
Nick Kralevich
917045222a Don't return immediately from reboot commands.
The reboot commands return too fast, interfering with testing.
Add a pause(), which will allow the device time to complete the
reboot.

Change-Id: Ie9cc6eea67b7ff662ec71ea2329cbb94f8d55404
Bug: 11369303
2013-10-24 11:01:16 -07:00
Jeff Sharkey
a9e453f1b5 Merge "vold no longer does MS_MOVE; remove tmpfs." into klp-dev 2013-10-18 01:45:05 +00:00
Jeff Sharkey
00c8e1a219 vold no longer does MS_MOVE; remove tmpfs.
MS_MOVE was used when staging external storage devices, which no
longer occurs.  In fact, having a writable tmpfs was masking a vold
bug around moving apps to SD cards.

Bug: 11175082
Change-Id: Ib2d7561c3a0b6fde94f651a496cb0c1f12f88d96
2013-10-17 16:47:20 -07:00
Ed Heyl
169c12b5cf merge in klp-release (no-op) 2013-10-16 17:48:19 -07:00
The Android Automerger
19ebdadee4 merge in klp-release history after reset to klp-dev 2013-10-09 06:02:11 -07:00
Ed Heyl
1c39fdcd9e merge in KQS81M 2013-10-08 15:45:06 -07:00
Jeff Sharkey
e93a0517f4 Set GID required to write, media_rw mount point.
Add sdcard FUSE daemon flag to specify the GID required for a package
to have write access.  Normally sdcard_rw, but it will be media_rw
for secondary external storage devices, so DefaultContainerService
can still clean up package directories after uninstall.

Create /mnt/media_rw which is where vold will mount raw secondary
external storage devices before wrapping them in a FUSE instance.

Bug: 10330128, 10330229
Change-Id: I4385c36fd9035cdf56892aaf7b36ef4b81f4418a
2013-10-08 12:56:37 -07:00
The Android Automerger
f981b1ed0f merge in klp-release history after reset to klp-dev 2013-10-01 06:01:48 -07:00
William Luh
e3e22062f0 Merge "Add new cert_pin_failure tag that can be used in user-consent filtering." into klp-dev 2013-09-30 20:19:20 +00:00
The Android Automerger
48dbe8d4ab merge in klp-release history after reset to klp-dev 2013-09-29 06:01:55 -07:00
Adam Lesinski
bbe4c49b4e Merge "Moves libmemtrack header to standard location" into klp-dev 2013-09-26 17:22:15 +00:00