Commit graph

5722 commits

Author SHA1 Message Date
Tianjie Xu
3c46516f9e Merge changes from topic "am-88276146-0d74-467c-8b81-8d471d84ce66" into oc-dev am: 2c28ae3933 am: d142b28c2b
am: a5860449c1

Change-Id: Ic2735740442410b5246eef6de3481b933f725416
2018-10-05 15:18:52 -07:00
Tianjie Xu
71b2447163 [automerger skipped] DO NOT MERGE: Initialize the ZipArchive to zero before parsing skipped: e830a51351 skipped: 244aba4412 skipped: 9216bccd16 skipped: 98acdb9fce skipped: bc42a6b0eb am: 35332d7c62 am: 6b13f89f15
am: 274945cb5b  -s ours

Change-Id: Ic5569d0abf7674ca5bee1b3df01170e69b6a0c1d
2018-10-05 15:18:31 -07:00
Tianjie Xu
a5860449c1 Merge changes from topic "am-88276146-0d74-467c-8b81-8d471d84ce66" into oc-dev am: 2c28ae3933
am: d142b28c2b

Change-Id: If12b37fbe0ee9934b46eedc5332981b63e5774cc
2018-10-05 15:13:56 -07:00
Tianjie Xu
274945cb5b [automerger skipped] DO NOT MERGE: Initialize the ZipArchive to zero before parsing skipped: e830a51351 skipped: 244aba4412 skipped: 9216bccd16 skipped: 98acdb9fce skipped: bc42a6b0eb am: 35332d7c62
am: 6b13f89f15

Change-Id: Iecb9ede3a76664e15fc2b533b20571c8052ed4ba
2018-10-05 15:13:37 -07:00
Tianjie Xu
d142b28c2b Merge changes from topic "am-88276146-0d74-467c-8b81-8d471d84ce66" into oc-dev
am: 2c28ae3933

Change-Id: I265f4af4039125793e90fc034c3dfc87eb6ad227
2018-10-05 15:08:58 -07:00
Tianjie Xu
6b13f89f15 [automerger skipped] DO NOT MERGE: Initialize the ZipArchive to zero before parsing skipped: e830a51351 skipped: 244aba4412 skipped: 9216bccd16 skipped: 98acdb9fce skipped: bc42a6b0eb
am: 35332d7c62

Change-Id: I54660a0731148f1ebbe74d4412d333a9f956dcb1
2018-10-05 15:08:31 -07:00
Tianjie Xu
2c28ae3933 Merge changes from topic "am-88276146-0d74-467c-8b81-8d471d84ce66" into oc-dev
* changes:
  [automerger skipped] DO NOT MERGE: Initialize the ZipArchive to zero before parsing skipped: f39f139103 skipped: cce521e439 skipped: 4a53559e98
  [automerger skipped] DO NOT MERGE: Initialize the ZipArchive to zero before parsing skipped: f39f139103 skipped: cce521e439
  [automerger skipped] DO NOT MERGE: Initialize the ZipArchive to zero before parsing skipped: f39f139103
  DO NOT MERGE: Initialize the ZipArchive to zero before parsing
2018-10-05 21:57:50 +00:00
Android Build Merger (Role)
62497b2c80 [automerger skipped] DO NOT MERGE: Initialize the ZipArchive to zero before parsing skipped: f39f139103 skipped: cce521e439 skipped: 4a53559e98
Change-Id: I4299e6a86c1006f2545f925da4552be7fda75f32
2018-09-07 23:15:41 +00:00
Android Build Merger (Role)
4a53559e98 [automerger skipped] DO NOT MERGE: Initialize the ZipArchive to zero before parsing skipped: f39f139103 skipped: cce521e439
Change-Id: I7e60856514769442397e0055e2edae73e9b92cee
2018-09-07 23:15:39 +00:00
Android Build Merger (Role)
cce521e439 [automerger skipped] DO NOT MERGE: Initialize the ZipArchive to zero before parsing skipped: f39f139103
Change-Id: Ibe1a269dbc52c6106161ccd757434a131fb5c4a2
2018-09-07 23:15:38 +00:00
Tianjie Xu
f39f139103 DO NOT MERGE: Initialize the ZipArchive to zero before parsing
The fields of the ZipArchive on the stack are not initialized before we
call libminzip to parse the zip file. As a result, some random memory
location is freed unintentionally when we close the ZipArchive upon
parsing failures.

Bug: 35385357
Test: recompile and run the poc with asan.
Change-Id: I7e7f8ab4816c84a158af7389e1a889f8fc65f079
2018-09-07 16:14:57 -07:00
Android Build Merger (Role)
35332d7c62 [automerger skipped] DO NOT MERGE: Initialize the ZipArchive to zero before parsing skipped: e830a51351 skipped: 244aba4412 skipped: 9216bccd16 skipped: 98acdb9fce skipped: bc42a6b0eb
Change-Id: I2239a4b3dea1a167ed7cd7ceaeaf42a3caa2189f
2018-09-07 23:13:14 +00:00
Android Build Merger (Role)
bc42a6b0eb [automerger skipped] DO NOT MERGE: Initialize the ZipArchive to zero before parsing skipped: e830a51351 skipped: 244aba4412 skipped: 9216bccd16 skipped: 98acdb9fce
Change-Id: I3f11a59a38c2604970d2a2a2d5795a15b0f07100
2018-09-07 23:13:13 +00:00
Android Build Merger (Role)
98acdb9fce [automerger skipped] DO NOT MERGE: Initialize the ZipArchive to zero before parsing skipped: e830a51351 skipped: 244aba4412 skipped: 9216bccd16
Change-Id: Ieb67174f2b98361f82ebc6c76b18bb904d44ea99
2018-09-07 23:13:11 +00:00
Android Build Merger (Role)
9216bccd16 [automerger skipped] DO NOT MERGE: Initialize the ZipArchive to zero before parsing skipped: e830a51351 skipped: 244aba4412
Change-Id: I7efba2ee6798c5fb71679bee7861d98f3643f414
2018-09-07 23:13:10 +00:00
Android Build Merger (Role)
244aba4412 [automerger skipped] DO NOT MERGE: Initialize the ZipArchive to zero before parsing skipped: e830a51351
Change-Id: I7e1da775a32b1f5ef72a2d95b94c0bf494251781
2018-09-07 23:13:09 +00:00
Tianjie Xu
e830a51351 DO NOT MERGE: Initialize the ZipArchive to zero before parsing
The fields of the ZipArchive on the stack are not initialized before we
call libminzip to parse the zip file. As a result, some random memory
location is freed unintentionally when we close the ZipArchive upon
parsing failures.

Bug: 35385357
Test: recompile and run the poc with asan.
Change-Id: I7e7f8ab4816c84a158af7389e1a889f8fc65f079
2018-09-07 16:09:28 -07:00
Paul Crowley
723056a83f Wipe the metadata partition when we wipe data.
Bug: 78469201
Test: Wipe from recovery menu, check that wipe is logged correctly
    and boot works as expected.
Merged-In: I5bc8ef1b83d78de8b5edba6cc17882edcc744356
Change-Id: I5bc8ef1b83d78de8b5edba6cc17882edcc744356
2018-04-25 09:31:04 -07:00
TreeHugger Robot
eacb9c0697 Merge "minadbd: track signature change of service_to_fd." into pi-dev 2018-04-14 15:33:14 +00:00
Josh Gao
84c82a8142 minadbd: track signature change of service_to_fd.
Bug: http://b/37066218
Bug: http://b/71898863
Test: treehugger
Change-Id: I5f2b14c65cff8d41dd3230d78b87e3e27e489bf6
(cherry picked from commit 570b08b790)
2018-04-13 17:49:10 -07:00
TreeHugger Robot
257dd337da Merge "recovery: enable fsverity feature bit" into pi-dev 2018-04-11 03:59:58 +00:00
Pirama Arumuga Nainar
2ca4a403e7 Use the non-LTO, non-PGO version of libhwbinder
Bug: http://b/77320844

Android.mk doesn't have support for PGO either.  This causes linker
error (about missing __llvm_profile symbols) in the PGO-instrumentation
enabled builds in the release branch.

Test: m ANDROID_PGO_INSTRUMENT=ALL
Change-Id: Ib5dfdea88073bd95da2cd02e92c85bfffcca80d6
2018-04-09 17:43:25 +00:00
TreeHugger Robot
7fdb6355e4 Merge "Use non-LTO variant of libhwbinder" into pi-dev 2018-04-06 20:25:02 +00:00
Jaegeuk Kim
2e5dc84d51 recovery: enable fsverity feature bit
Bug: 74604441
Bug 67380979
Change-Id: Iab1cc9aef356f0ddf6e2491578a2bd53009182ce
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
2018-04-06 10:17:47 -07:00
Jaegeuk Kim
1224544806 install: mkfs.f2fs: specify sector size for target image size
The total sectors that we want to format is used in different meanings from
various users. This notifies its size based on 512 bytes explicitly.

Bug: 76407663
Change-Id: I20687b40a1733d3b459a45f8b64a338c37a7bc95
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
2018-04-04 21:14:01 -07:00
Jaegeuk Kim
848f227eea f2fs: support f2fs by setting unmovable bit for package file
This enables to use uncrypt for f2fs update-on-reboot.
It requires kernel patch named:
    "f2fs: add an ioctl to disable GC for specific file"

If any operation fails during uncrypt, please delete package file as soon as
possible, and create the file again to move forward. IOWs, don't leave the
package file for a long time.

Bug: 70309376
Bug: 30170612
Change-Id: I3b4233e7da756f107be35364521699deaf2e7139
Merged-In: I3b4233e7da756f107be35364521699deaf2e7139
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
2018-04-04 19:28:15 -07:00
Jaegeuk Kim
4358262b75 mkfs.f2fs: specify sector size for target image size
The total sectors that we want to format is used in different meanings from
various users. This notifies its size based on 4096 bytes explicitly.

Bug: 76407663
Change-Id: I3392646648264ad1ca78e4b87240edc9385a0cc4
Merged-In: I3392646648264ad1ca78e4b87240edc9385a0cc4
Reported-by: katao@xiaomi.com
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
2018-04-04 14:26:23 -07:00
Yi Kong
10b3faa10d Use non-LTO variant of libhwbinder
... as a workaround for build system does not currently infer non-LTO
usage from Android.mk.

Test: m
Bug: 77320844
Change-Id: I6e9954b895051cc20408a30d0761e164e4c5bfd9
2018-04-03 12:45:45 -07:00
Tao Bao
454d8cb805 update_verifier: Support verifying product partition.
We have added the support for building /product partition in build
system (the CL in [1]), where /product is an optional partition that
contains system files. This CL adds the matching support if /product
needs to be verified during A/B OTA (i.e. listed in care_map file).

[1]: commit b7735d81054002961b681f4bdf296d4de2701135,
https://android-review.googlesource.com/c/platform/build/+/598454

Bug: 63974895
Test: Run update_verifier test on walleye.
Change-Id: Ia1c35e9583b8e66c98a4495b1f81a5ea7e65036f
(cherry picked from commit ec2e8c6c1e)
2018-03-23 13:27:53 -07:00
Tao Bao
d26f95287a tests: Add ApplyPatchModesTest.PatchModeEmmcTargetWithBsdiffPatch test.
/system/bin/applypatch on device is expected to work with bsdiff based
recovery-from-boot patch automatically. Adding a test to ensure that's
always the case.

Bug: 72731506
Test: Run recovery_component_test on marlin.
Change-Id: I56283cd3ce7cf0215cc3bb3619b206fa01d552c4
Merged-In: I56283cd3ce7cf0215cc3bb3619b206fa01d552c4
(cherry picked from commit d612b23dfd)
2018-03-20 11:38:16 +08:00
Yifan Hong
91b48f9161 recovery: add libhidl-gen-utils depedency
introduced as a depedency to libvintf.

Test: builds
Bug: 73556059
Change-Id: Ia51ba81ef462879481dcacb80d9ea9ea35e8b0bb
Merged-In: Ia51ba81ef462879481dcacb80d9ea9ea35e8b0bb
2018-03-13 10:56:51 -07:00
Tianjie Xu
01daebbe68 Set the update locations to default in CacheLocation's constructor
Otherwise the applypatch executable will fail to back up the source
file to /cache when patching the recovery image.

Bug: 74198354
Test: run applypatch from boot to recovery
(cherry picked from commit b4e3a370bf)

Change-Id: I37b7fd88d66ab49ef953d4b7dca22577bd1472e1
2018-03-08 14:40:09 -08:00
Tianjie Xu
4249cdfe29 Merge "Add a singleton CacheLocation to replace the hard coded locations" am: 47cd789eed am: a72f93d6da
am: 6c87845cfb

Change-Id: If8cf8b4f86ceae41d19ecbcf8e8fc62ef17eb2ac
2018-03-01 18:58:27 +00:00
Tianjie Xu
6c87845cfb Merge "Add a singleton CacheLocation to replace the hard coded locations" am: 47cd789eed
am: a72f93d6da

Change-Id: Ie505267652e83735f60e8acc93da22e2ac1abe69
2018-03-01 18:52:54 +00:00
Tianjie Xu
a72f93d6da Merge "Add a singleton CacheLocation to replace the hard coded locations"
am: 47cd789eed

Change-Id: I11c265d3adebc338e0603ed00c7d1aaaffae0253
2018-03-01 18:45:52 +00:00
Tianjie Xu
47cd789eed Merge "Add a singleton CacheLocation to replace the hard coded locations" 2018-03-01 18:36:05 +00:00
Tianjie Xu
3bbb20f557 Add a singleton CacheLocation to replace the hard coded locations
This class allows us to set the following locations dynamically:
cache_temp_source, last_command_file, stash_directory_base.

In the updater's main function, we reset the values of these variables
to their default locations in /cache; while we can set them to temp
files in unit tests or host simulation.

Test: unit tests pass
Change-Id: I528652650caa41373617ab055d41b1f1a4ec0f87
2018-02-28 11:19:11 -08:00
Tianjie Xu
bb928df6eb Merge "Fix the behavior of undefined commands in BlockImageVerify" am: ac4818d6af am: 7b9a92c1e2
am: e0f7c39c4f

Change-Id: I33b49c01cfaa0e1ec8bfc7f92ffe5c7d034c3bf4
2018-02-28 19:11:05 +00:00
Tianjie Xu
e0f7c39c4f Merge "Fix the behavior of undefined commands in BlockImageVerify" am: ac4818d6af
am: 7b9a92c1e2

Change-Id: I7891f4e907cc73618b99e2102eb8844771554b1f
2018-02-28 19:05:04 +00:00
Tianjie Xu
7b9a92c1e2 Merge "Fix the behavior of undefined commands in BlockImageVerify"
am: ac4818d6af

Change-Id: I5e42bcafca4c42e6c30cef082c03ad2b8d18ac6c
2018-02-28 18:59:33 +00:00
Tianjie Xu
ac4818d6af Merge "Fix the behavior of undefined commands in BlockImageVerify" 2018-02-28 18:49:56 +00:00
Tianjie Xu
c242084539 Fix the behavior of undefined commands in BlockImageVerify
In BlockImageVerify some commands are undefined, e.g. "erase", "new",
"zero". And we should not error out if the corresponding function
pointer of these commands is null; otherwise we will fail the
verification.

The old code is:
if (cmd->f != nullptr && cmd->f(params) == -1)
  return false;

In the last_command_file change the logic was wrongly modified to
if (cmd->f == nullptr)
  return false;
...
if (cmd->f(params) == -1)
  return false;

Test: sideload an incremental OTA twice on bullhead
Change-Id: I2561c365badb850da0e416629ccd61f0df7da5d7
2018-02-27 23:04:14 -08:00
Tianjie Xu
133d1d25d7 Merge "Remove the assumption of target chunk size in imgdiff" am: cc3446a7f7 am: a306d7bc55
am: 98da1357b4

Change-Id: Ieb024183866d702c72a3c1d3a4636500ebfc0b0a
2018-02-23 21:55:58 +00:00
Tianjie Xu
98da1357b4 Merge "Remove the assumption of target chunk size in imgdiff" am: cc3446a7f7
am: a306d7bc55

Change-Id: Ieb2fe6cf9f8bf71a5018809f16510c4ef05420d4
2018-02-23 21:43:14 +00:00
Tianjie Xu
a306d7bc55 Merge "Remove the assumption of target chunk size in imgdiff"
am: cc3446a7f7

Change-Id: Ic5d50e6c54dfd352950925d01448020669735056
2018-02-23 21:31:09 +00:00
Treehugger Robot
cc3446a7f7 Merge "Remove the assumption of target chunk size in imgdiff" 2018-02-23 21:12:39 +00:00
Tianjie Xu
572abbb81c Remove the assumption of target chunk size in imgdiff
In the split mode of imgdiff, we used to assume that the size of a split
target chunk is always greater than the blocksize i.e. 4096. This may
lead to the following assertion failure:
I0221 04:57:33.451323 818464 common.py:205 imgdiff F 02-21 04:57:33 821203 821203 imgdiff.cpp:999]
Check failed: tgt_size >= BLOCK_SIZE (tgt_size=476, BLOCK_SIZE=4096)

This CL removes the assumption and handles the edge cases.

Test: generate and verify the incremental update for TFs in the bug; unit test passes

Bug: 73757557
Bug: 73711365
Change-Id: Iadbb4ee658995f5856cd488f3793980881a59620
2018-02-23 10:44:05 -08:00
George Burgess IV
a362703826 Merge "Replace vfork() with fork()." am: 21b381622d am: 44f2cb2d67
am: c298833b1c

Change-Id: Ia72697181a9132713b216b6f7c0b7116e09d62fd
2018-02-23 17:47:22 +00:00
George Burgess IV
c298833b1c Merge "Replace vfork() with fork()." am: 21b381622d
am: 44f2cb2d67

Change-Id: Ie67e2e0a39c781e27916294f501fcc4ef8fbd38f
2018-02-23 17:31:08 +00:00
George Burgess IV
44f2cb2d67 Merge "Replace vfork() with fork()."
am: 21b381622d

Change-Id: Ia06201cedfcca6358f6f65face5325a4cf528f72
2018-02-23 17:24:51 +00:00