Commit Graph

24282 Commits

Author SHA1 Message Date
Connor O'Brien 9745b11db1 Fix vold vulnerability in FrameworkListener am: 470484d2a2 am: e9e046df6c am: 109024f74a am: b906ad88b9 am: 2fadbb93a4
am: e04054d9bb

Change-Id: Ia5f46e5b9622946ca0e44fbe7399729807d2d08a
2016-08-19 22:34:46 +00:00
Daniel Rosenberg ad3d3c184e Handle invalid suffix lists
Some devices will report an error string as a value
when unknown variables are queried. This can lead to
unexpected behavior, so we attempt to detect this case
by seeing if the suffix list doesn't make sense.

Change-Id: I939b1e01c40ddc05d881fd54423406db250cc8e5
(cherry-picked from commit 190d968414)
2016-08-19 15:31:01 -07:00
Daniel Rosenberg 1345409537 Call set_active after flashall and update
If the device has previously failed to boot, and the current slot is
marked as unbootable, we must call set_active to reenable the slot.

Bug: 29827625
Change-Id: I8b723dda80e246b48e5967aff4503c3d120bfb9b
(cherry-picked from commit 9c9a6c62e5)
2016-08-19 15:31:01 -07:00
Connor O'Brien e04054d9bb Fix vold vulnerability in FrameworkListener am: 470484d2a2 am: e9e046df6c am: 109024f74a am: b906ad88b9
am: 2fadbb93a4

Change-Id: I19405fe2bbf0034db3fc0298d1616df5611e2a92
2016-08-19 22:18:34 +00:00
Connor O'Brien 2fadbb93a4 Fix vold vulnerability in FrameworkListener am: 470484d2a2 am: e9e046df6c am: 109024f74a
am: b906ad88b9

Change-Id: Ida2b33bd1db284dfa8ad3f130219481a92785e97
2016-08-19 22:14:57 +00: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
Dmitriy Filchenko de9e6fb4b0 Merge "Remove process_name.c" am: e5b7ad1c39
am: 97e3cb7074

Change-Id: I8ddeceadedd4ca689d96f3a854ba34f31d16683f
2016-08-19 01:33:31 +00:00
Dmitriy Filchenko 97e3cb7074 Merge "Remove process_name.c"
am: e5b7ad1c39

Change-Id: I8f98f5fe9ff526ed8780971eddef128ed46de271
2016-08-19 01:30:34 +00:00
Treehugger Robot e5b7ad1c39 Merge "Remove process_name.c" 2016-08-19 01:26:39 +00:00
Dmitriy Filchenko 1bb49f483b Remove process_name.c
BUG: 29824203

Change-Id: I88d67cafb8ec0c4eea3db047bac0671de698ba02
2016-08-18 23:54:46 +00:00
Hung-ying Tyan d1f49a43fd Merge "Mount /vendor and /odm early" am: 35569e9d68
am: 46bfc918d0

Change-Id: Id18c4f3fbfb31dfd15b4fec67cbb959df358f852
2016-08-18 05:07:40 +00:00
Hung-ying Tyan 46bfc918d0 Merge "Mount /vendor and /odm early"
am: 35569e9d68

Change-Id: I9b5360bf3036fa88e770d686ab06b8f4cff80d7c
2016-08-18 05:04:43 +00:00
Treehugger Robot 35569e9d68 Merge "Mount /vendor and /odm early" 2016-08-18 05:01:14 +00:00
Hans Boehm 9bbcc891d7 Merge "Fix reference counting for Assembly" am: 3b6530507b
am: 53bfab1f6d

Change-Id: I6043b5ded422097f6cc10c7bc4470c43ed4dcd36
2016-08-18 00:03:22 +00:00
Hans Boehm 53bfab1f6d Merge "Fix reference counting for Assembly"
am: 3b6530507b

Change-Id: I4c5b167d34e495a8bd2a373887d0124b8f12c96a
2016-08-18 00:00:23 +00:00
Hans Boehm 3b6530507b Merge "Fix reference counting for Assembly" 2016-08-17 23:56:09 +00:00
Felipe Leme 321c21e2df Split 'generating' and 'pulling' in 2 messages.
BUG: 30799929
Change-Id: I0af0ad2478c57ffc5b2c953118e01677f788d14a
(cherry picked from commit 9c0be90528)
2016-08-17 10:52:15 -07:00
Felipe Leme b0022b036e Ignore bugreportz output when it's not supported.
On devices running M or below, calling 'bugreportz -v' writes
'/system/bin/sh: bugreportz: not found' in the stdout output, which must
be redirected to stderr so it's not shown in the flat-file bugreport,
above the bugreport header.

BUG: 30451114

Change-Id: I942c92fdf6ae85e0cde7b9f94b9eb0b1fecad77a
(cherry picked from commit 9a882a3ef3)
2016-08-17 10:52:14 -07:00
Felipe Leme f8d9e4eb00 Deprecated 'adb bugreport' with flat files.
Starting on Android N, zipped bugreports contain more information than
flat-file, text bugreports. On N, calls to 'adb bugreport' would still
generate a flat-file bugreport, but with a warning.

With this change, 'adb bugreport' will generate a zipped bugreport in
the current directory, using the bugreport name provided by the
device. Similarly, calling 'adb bugreport dir' will generate a bugreport
with a device-provided name, but in such directory.

BUG: 30451114
BUG: 29448020

Change-Id: Ibc8920dd44a5f62feb15bf3fefdcb0bdbf389a90
(cherry picked from commit 307951e124)
2016-08-17 10:52:12 -07:00
Felipe Leme 5f6eacaeda Minor improvements on bugreport generation.
- Skipped artificial 100/100 message, since pulling will take care of
  the final 100% progress.
- Consolidated unsupported lines in just one message.
- Let user know the bugreport can still be recovered when it could not
  be copied to the destination directory.

BUG: 30451114

Change-Id: Icfce9c1e8e7ed407719728b9874679ac40b21eab
(cherry picked from commit 80a65d03c9)
2016-08-17 10:52:10 -07:00
Felipe Leme 33ae849fef Removed extra 'pulling file' message.
Taking a zip bugreport has 2 phases: generating the bugreport and
pulling the file.

Initially adb was printing 2 messages, but since the latter is almost
instantaneously, it could be confusing to have 2 lines...

Fixes: 30451250
Change-Id: I1c6cc6163492c1fb6064667dfdb7aaf6ed4c4c6f
(cherry picked from commit f7c38b4c03)
2016-08-17 10:52:09 -07:00
Felipe Leme 97b73a0daf Show bugreport progress.
adb calls bugreportz to generate a bugreport; initially, bugreportz
would only report the final status of the operation (OK or FAIL), but
now it sends intermediate PROGRESS lines reporting its progress (in the
form of current/max).

Similarly, the initial implementation of 'adb bugreport <zip_file>'
would print an initial 'please wait' message and wait for the full
stdout before parsing the result, but now it uses a new callback class
to handle the stdout as it is generated by bugreportz.

BUG: 28609499

Change-Id: I6644fc39a686279e1635f946a47f3847b547d1c1
(cherry picked from commit cd42d658b2)
2016-08-17 10:52:07 -07:00
Felipe Leme d18854218e Refactored functions that copy sdout and stderr to strings to use a callback.
BUG: 28609499

Change-Id: I04aea346e18678ea00797f7f659480edba4436c2
(cherry picked from commit 07ac8554b4)
2016-08-17 10:52:06 -07:00
Felipe Leme 218e1ff759 Split bugreport() into its own file and added unit tests.
bugreport() will be soon refactored to track progress, which will
require more comprehensive unit tests.

As such, it's better to move it to its own files, which in turn also
requires moving send_shell_command() and usage() to commandline.h.

Fixes: 30100363
Bug: 30268737

Change-Id: I3cdf114a0b5547293320042ff0749a60886440b0
(cherry picked from commit 78e0963e4b)
2016-08-17 10:51:38 -07:00
Hung-ying Tyan 99c4a8a6b3 Mount /vendor and /odm early
Right now these two partitions are mounted in the fs stage of the init
process. As a result, many vendor/ODM files needed earlier in the boot
process (e.g., init.<hardware>.rc, fstab.<hardware>.rc,
uevent.<hardware>.rc, SELinux policy files etc) can only live on the root
partition.

To prevent vendors/ODMs from polluting the root partition, this patch makes
it possible to mount the vendor and ODM partitions in the first stage of the
init process. The fstab info of both partitions to be mounted early is
composed from new kernel cmdline arguments android.early.prefix and
android.early.fstab.

For example, with:
android.early.prefix=/sys/devices/1010000.msdc0/mmc_host/mmc0/mmc0:0001/block/mmcblk0/
android.early.fstab=mmcblk0p10+/odm+ext4+ro+verify\nmmcblk0p09+/vendor+ext4+ro+verify

the final fstab string will be:
/sys/devices/1010000.msdc0/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p10 /odm ext4 ro verify
/sys/devices/1010000.msdc0/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p09 /vendor ext4 ro verify

The android.early.prefix is optional. When it is missing, the final fstab
string will be directly converted from android.early.fstab.

This patch also makes sure that the early mounted partitions are dm-verity
enabled so that they are trust worthy to store system files.

BUG=27805372

Change-Id: I3cf32482a5ec65445ba3aedab2164c7ba8f12694
2016-08-17 17:21:35 +08:00
Hans Boehm e74dec4a39 Fix reference counting for Assembly
Use correct memory ordering.

Start the reference count at zero instead of one, thus giving us a
chance to actually deallocate something.

Remove remaining (unused) inclusions of cutils/atomic.h from
libpixelflinger.

Bug: 30838047

Change-Id: I3c6fd4a4861b3635cf398ca2aa3e915118100b10
2016-08-16 10:12:43 -07:00
Narayan Kamath 8aa4284b02 Merge "zip_archive: Improve error message on fallocate failure." am: 704d818ec1
am: 388a65d146

Change-Id: I2d76efca553e73cd1149825a446d2518e04086b7
2016-08-16 09:07:03 +00:00
Narayan Kamath 388a65d146 Merge "zip_archive: Improve error message on fallocate failure."
am: 704d818ec1

Change-Id: Ic1ab5e824dcc2b6a78e8ceb29732185ad5da1987
2016-08-16 09:03:04 +00:00
Narayan Kamath 704d818ec1 Merge "zip_archive: Improve error message on fallocate failure." 2016-08-16 08:55:46 +00:00
Josh Gao ddaee54b49 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 am: 58dd6f7cba -s ours am: 55259f320b am: 9183477cca am: fdb4cd42f6 -s ours am: 0790936473 am: c0e52f145e am: 2b16e16142 am: c8d2050a52 -s ours
am: 9008a5cb80

Change-Id: I2f30024ea145bf7fe0ace4ee5d341573ab42bf91
2016-08-15 19:59:47 +00:00
Josh Gao 70b82ba594 DO NOT MERGE: debuggerd: verify that traced threads belong to the right process. am: 8d6ca194ee am: 8f7cc0e387 -s ours am: be9d9fc379 -s ours am: 2071bcfa75 -s ours am: 7fe65ab421 am: b92fecf460 am: 48cd7ddd89 -s ours am: dc83f1839b am: 3e59e93c71 am: a44a3ae938 am: 240289e7e9 -s ours
am: 2eecaedcb0

Change-Id: I492dfa78a386114930994b3c1ec1c6b89eccc7b9
2016-08-15 19:59:46 +00:00
Josh Gao 9008a5cb80 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 am: 58dd6f7cba -s ours am: 55259f320b am: 9183477cca am: fdb4cd42f6 -s ours am: 0790936473 am: c0e52f145e am: 2b16e16142
am: c8d2050a52  -s ours

Change-Id: I27b9571786ea72c31c2fd74d0e033ec0f078f3d9
2016-08-15 19:55:23 +00:00
Josh Gao 2eecaedcb0 DO NOT MERGE: debuggerd: verify that traced threads belong to the right process. am: 8d6ca194ee am: 8f7cc0e387 -s ours am: be9d9fc379 -s ours am: 2071bcfa75 -s ours am: 7fe65ab421 am: b92fecf460 am: 48cd7ddd89 -s ours am: dc83f1839b am: 3e59e93c71 am: a44a3ae938
am: 240289e7e9  -s ours

Change-Id: I5fca213679641f0da4cbc5ffdd3b00cf03177946
2016-08-15 19:55:22 +00:00
Josh Gao c8d2050a52 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 am: 58dd6f7cba -s ours am: 55259f320b am: 9183477cca am: fdb4cd42f6 -s ours am: 0790936473 am: c0e52f145e
am: 2b16e16142

Change-Id: I2d06b5ec4053884cbf2ba61e77dc642af84020b3
2016-08-15 19:51:15 +00:00
Josh Gao 240289e7e9 DO NOT MERGE: debuggerd: verify that traced threads belong to the right process. am: 8d6ca194ee am: 8f7cc0e387 -s ours am: be9d9fc379 -s ours am: 2071bcfa75 -s ours am: 7fe65ab421 am: b92fecf460 am: 48cd7ddd89 -s ours am: dc83f1839b am: 3e59e93c71
am: a44a3ae938

Change-Id: I59be0d4380dbbcdfae4f52a9ae5d7495870ce983
2016-08-15 19:51:14 +00:00
Josh Gao 2b16e16142 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 am: 58dd6f7cba -s ours am: 55259f320b am: 9183477cca am: fdb4cd42f6 -s ours am: 0790936473
am: c0e52f145e

Change-Id: If95e3aa41a5e1b77fc341693031d12c36ab99fc5
2016-08-15 19:46:46 +00:00
Josh Gao a44a3ae938 DO NOT MERGE: debuggerd: verify that traced threads belong to the right process. am: 8d6ca194ee am: 8f7cc0e387 -s ours am: be9d9fc379 -s ours am: 2071bcfa75 -s ours am: 7fe65ab421 am: b92fecf460 am: 48cd7ddd89 -s ours am: dc83f1839b
am: 3e59e93c71

Change-Id: I2ec5be3ac5b3379428bc1afb000bc80939435e22
2016-08-15 19:46:45 +00:00
Josh Gao c0e52f145e 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 am: 58dd6f7cba -s ours am: 55259f320b am: 9183477cca am: fdb4cd42f6 -s ours
am: 0790936473

Change-Id: I65d54a2c52fcc051bca0cb7a586e02b18413ee15
2016-08-15 19:42:16 +00:00
Josh Gao 3e59e93c71 DO NOT MERGE: debuggerd: verify that traced threads belong to the right process. am: 8d6ca194ee am: 8f7cc0e387 -s ours am: be9d9fc379 -s ours am: 2071bcfa75 -s ours am: 7fe65ab421 am: b92fecf460 am: 48cd7ddd89 -s ours
am: dc83f1839b

Change-Id: I8c2ea607c5a0d4af2114cddd5ebf04f69c30c58e
2016-08-15 19:42:15 +00:00
Josh Gao 0790936473 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 am: 58dd6f7cba -s ours am: 55259f320b am: 9183477cca
am: fdb4cd42f6  -s ours

Change-Id: Ie74b4d7f058f5309835467b1f2b0c7af10a3deb5
2016-08-15 19:38:14 +00:00
Josh Gao dc83f1839b DO NOT MERGE: debuggerd: verify that traced threads belong to the right process. am: 8d6ca194ee am: 8f7cc0e387 -s ours am: be9d9fc379 -s ours am: 2071bcfa75 -s ours am: 7fe65ab421 am: b92fecf460
am: 48cd7ddd89  -s ours

Change-Id: Iaaf6bda3c6331c437116cde7913a5b8562854390
2016-08-15 19:38:14 +00:00
Josh Gao fdb4cd42f6 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 am: 58dd6f7cba -s ours am: 55259f320b
am: 9183477cca

Change-Id: Idf1fc233cf76a144b1f410962f6b2b5527867c42
2016-08-15 19:33:36 +00:00
Josh Gao 48cd7ddd89 DO NOT MERGE: debuggerd: verify that traced threads belong to the right process. am: 8d6ca194ee am: 8f7cc0e387 -s ours am: be9d9fc379 -s ours am: 2071bcfa75 -s ours am: 7fe65ab421
am: b92fecf460

Change-Id: Ie10d035b8a18c39bd15e72afc6f270fe33aff63a
2016-08-15 19:33:35 +00:00
Josh Gao 9183477cca 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 am: 58dd6f7cba -s ours
am: 55259f320b

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

Change-Id: I5ff20f785127d356eae5c0626cc4cc994d638109
2016-08-15 19:10:11 +00:00
Josh Gao 55259f320b 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
am: 58dd6f7cba  -s ours

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

Change-Id: I491d40595bf23ea2a8b9db6df1c57b6e6e281604
2016-08-15 19:05:10 +00:00