Commit graph

69632 commits

Author SHA1 Message Date
David Drysdale
267adbd4f1 Merge "TrustyKeyMint: support boot, vendor patchlevels" 2021-07-22 06:32:32 +00:00
David Drysdale
e7697d7101 TrustyKeyMint: support boot, vendor patchlevels
- Invoke TrustyKeymaster::ConfigureVendorPatchlevel() from
   remote keymint Initialize(), using vendor patchlevel retrieved
   from property.
 - Add TrustyKeymaster::ConfigureVendorPatchlevel() method to
   send the CONFIGURE_VENDOR_PATCHLEVEL message.
 - Add message type values for
   CONFIGURE_{VENDOR,BOOT}_PATCHLEVEL messages.

Test: pending device availability
Change-Id: Ie42345112b08ef9c669535cef2de60ea77da15b4
2021-07-21 16:26:32 +01:00
Treehugger Robot
7d11ce854c Merge "Revert "Add systrace tag for system property"" 2021-07-21 11:43:39 +00:00
Bowgo Tsai
ebb79debcc Revert "Add systrace tag for system property"
Revert "Add systrace tag for system property"

Revert "Add systrace tag for system property"

Revert "Adding system property tracing"

Revert submission 1403568-sysprop_trace

Reason for revert: makes property get/set non-reentrant
Reverted Changes:
I6f85f3f52:Add systrace tag for system property
Id2b93acb2:Adding system property tracing
Id78992d23:Add systrace tag for system property
I1ba9fc7bd:Add systrace tag for system property

Ignore-AOSP-First: b/193050299#comment17

Bug: 193050299
Change-Id: I9305003531c6a86194d55dc72c613337d213b53d
Merged-In: I9305003531c6a86194d55dc72c613337d213b53d
Test: build and boot a device
(cherry picked from commit 18e0f65cbf)
2021-07-21 09:22:27 +08:00
Treehugger Robot
f9a9ee048c Merge "Revert "Revert "Remove unused String8::setPathName.""" 2021-07-20 19:38:55 +00:00
David Anderson
b0a9c30b6d libfiemap: Fix removal of corrupted split fiemaps.
If a split fiemap header gets corrupted, we could get ENAMETOOLONG and
removal fails. Handle this gracefully.

Bug: N/A
Test: fiemap_writer_test
Change-Id: I4af9ca7ad4b4fa87a91ff05b8fadac4258006ab6
2021-07-19 14:02:56 -07:00
David Anderson
d32f5df728 Merge "libsnapshot: Propagate merge phase across merge failures." 2021-07-19 21:01:06 +00:00
Greg Kaiser
d03851e549 Revert "Revert "Remove unused String8::setPathName.""
This reverts commit 70d9fb63e6.

Reason for revert: Outstanding usage of this method removed internally

Change-Id: Idcc00ec261aa1d97f11e47abdb08b10a37b5d20f
Test: Local build; treehugger (which I'll manually confirm runs on the appropriate targets)
2021-07-19 20:19:44 +00:00
David Anderson
edefadd242 Merge "fiemap: add fsync after write split file name" 2021-07-19 18:14:49 +00:00
Armelle Laine
bd1dbe2bb5 [trusty-base] Update Trusty Keymint properties
Support legacy 3DES algorithm
(property parity with software implementation)

Bug: 193715461
Change-Id: Id2c45b94b2b3375972dd53fa65186007eda35970
Test: atest VtsAidlKeyMintTargetTest
Signed-off-by: Armelle Laine <armellel@google.com>
2021-07-19 16:14:20 +00:00
David Drysdale
a2aba786fe Merge "Splitting out Trusty IPC into a library." 2021-07-19 09:16:47 +00:00
David Anderson
c2bb3ee6d6 libsnapshot: Propagate merge phase across merge failures.
If a merge fails we write a new snapshot status indicating that the merge
failed. If this happens to occur during the second merge phase, we fail
to propagate the phase counter to the new status. This means the merge
is unlikely to make progress and succeed later.

Bug: 193549218
Test: manual test
Change-Id: I31fdae6bde48e3a71b6f3fcc663541257f7ebd8f
2021-07-16 20:05:39 -07:00
Wenhao Wang
8b6dac42c9 Merge changes Ib90f8b28,I391ecff9
* changes:
  trusty:storageproxyd: Add wakelock to the UFS commands
  trusty:storageproxyd: Fix return paths on errors
2021-07-16 19:32:14 +00:00
Nikita Ioffe
1a257af822 Merge "Deflake libdm#CreateEmptyDevice test" 2021-07-16 11:15:32 +00:00
lijiazi
ebff7b8b97 fiemap: add fsync after write split file name
If device abnormal restart during upgrade, update_engine just
created split cow image file and wrote the name to xxx-cow-img.img.
After restart, update_engine will report following err:

06-30 08:48:06.466  root  8918  8920 E gsid    : Error removing image
product_b-cow-img: File name too long

That is because SplitFiemap::Create->DetermineMaximumFileSize
open xxx-cow-img.img to get some info, then fsync and unlink this
file.

On device use f2fs, after restart, f2fs_recover_fsync_data will
recover this file with inode block sync to ufs in following path:
DetermineMaximumFileSize
    ->FiemapWriter::Open
        ->AllocateFile
This make xxx-cow-img.img file content corruption.

Update_engine call TryCancelUpdate to clean up the residual files
of last upgrade, cannot read valid split file name from
xxx-cow-img.img, then report err log mentioned above.

Add fsync, f2fs can use correct inode to recover related files.
This can reduce the probability of this issue.

Test: abnormal restart when upgrade

Change-Id: Iceb3e5604d90495350c5fb1fb3433732372f3fec
Signed-off-by: lijiazi <lijiazi@xiaomi.com>
2021-07-16 16:25:31 +08:00
Wenhao Wang
6e0a762290 trusty:storageproxyd: Add wakelock to the UFS commands
We add a wakelock to the sequence of UFS commands so that
the sequence will not be disrrupted when devices get suspended.

Bug: 193456223
Test: Trusty storage tests
Change-Id: Ib90f8b284017cf261d2a2aea940834a42c21de02
2021-07-15 22:34:58 -07:00
Wenhao Wang
09b493b143 trusty:storageproxyd: Fix return paths on errors
The function send_ufs_rpmb_req is missing return paths on errors.
This patch fixes it so that any UFS command failure will return
error code to the function caller.

Bug: 193855098
Test: Trusty storage tests
Change-Id: I391ecff9ed3f892b7c3adae0ceeb18930791326f
2021-07-15 22:24:11 -07:00
Max Bires
a9362a4e60 Splitting out Trusty IPC into a library.
This allows the relevant IPC code to be included in the provisioner tool
easily as it's shuffled over into a non-AOSP component due to
chip specific requirements in provisioning Device IDs.

Bug: 178796950
Test: Stuff builds
Merged-In: I57482e89035e8648544f87291ec14c6aece09bd0
Change-Id: I57482e89035e8648544f87291ec14c6aece09bd0
2021-07-15 16:17:59 +01:00
Nikita Ioffe
7756779289 Deflake libdm#CreateEmptyDevice test
Judging from local experiments, it looks like device-mapper doesn't
always generate a uevent after DM_DEV_CREATE ioctl.

Test: presubmit
Bug: 193462349
Change-Id: I8a74375631b20c14a32a41dbaf38380ebc0078e6
2021-07-15 15:33:17 +01:00
Greg Kaiser
615bf4ef14 Merge "Revert "Remove unused String8::setPathName."" 2021-07-15 13:33:54 +00:00
Greg Kaiser
70d9fb63e6 Revert "Remove unused String8::setPathName."
This reverts commit c214426e0c.

Reason for revert: This is not unused; broke build internally

Change-Id: I18e8b7954256ae015ad32743fa6a75850b00913e
2021-07-15 13:33:10 +00:00
Treehugger Robot
d939aa2405 Merge "Revert "Re-land removing RECOVERY_AS_BOOT check for init_first_stage"" 2021-07-15 05:38:21 +00:00
David Anderson
16aa3c9573 Merge "libsnapshot: Fix inconsistency in how merge ops are counted." 2021-07-15 01:00:33 +00:00
David Anderson
0f707941d4 libsnapshot: Fix inconsistency in how merge ops are counted.
A recent change to libsnapshot caused us to filter out duplicate COW
ops. The merge consistency check relied on the old method of manually
counting ops, causing it to come up with a different number. Fix this by
using the already computed "official" count.

Bug: 193532829
Test: new test case in vts_libsnapshot_test
      manual test with incremental OTA
Change-Id: I68d1e41f5c140af20a04ba80e3db0780a916ecf8
2021-07-14 16:44:54 -07:00
Elliott Hughes
40a0664b84 Merge "Remove unused String8::setPathName." 2021-07-14 21:20:24 +00:00
Andrew Walbran
1ed24f477e Merge "virtualizationservice will clear its own temporary directory." 2021-07-14 18:29:04 +00:00
Seth Moore
8fe5602099 Merge "Client side implementation of Trusty IRPC HAL" 2021-07-14 16:35:37 +00:00
Andrew Walbran
1f885aee3d virtualizationservice will clear its own temporary directory.
Bug: 192917795
Bug: 193365943
Test: flashed on a VIM3L and booted
Change-Id: Ib9657843c4d13c428670982a3f8d0e5dfdb78211
2021-07-14 14:18:25 +00:00
Bowgo Tsai
ab079af28f Revert "Re-land removing RECOVERY_AS_BOOT check for init_first_stage"
This reverts commit 4818f74888.

The previous commit might introduce a build break on legacy
devices that with a smaller /boot partition size, because it
outputs the first-stage init and the second-stage init binaries
in the following locations, respectively (when
BOARD_USES_RECOVERY_AS_BOOT is true).

    * $OUT/recovery/root/first_stage_ramdisk/init
    * $OUT/recovery/root/system/bin/init

The first one is not needed because there is already a symlink
under $OUT/recovery/root:  init -> /system/bin/init.

Bug: 193565271
Test: `lunch aosp_flame-userdebug`, `make bootimage_debug` then
      checks the output under $OUT/debug_ramdisk/.
Test: Performs the same check for `lunch aosp_bramble-userdebug`.
Change-Id: I6277a6c4c0980bd976cc35db6ca99eafc6bf3f5a
2021-07-14 19:21:40 +08:00
David Anderson
6f70cc6f92 fastboot: Support casefolding in ext4 partitions.
Bug: 191929411
Test: manual test
Change-Id: I9bd0a906fa9a2605d56cc3f37247fcc2a3d5f858
2021-07-13 17:32:03 -07:00
Elliott Hughes
c214426e0c Remove unused String8::setPathName.
Test: treehugger
Change-Id: Idc8d7e748b0df4ce8a26227dc73a5eef2b04244f
2021-07-13 17:20:53 -07:00
Tri Vo
e3ec5f9363 Merge "trusty: Increase timeout for ConfirmationUI fuzzer" 2021-07-13 21:09:38 +00:00
Treehugger Robot
a7e63d9952 Merge "task_profiles.json: add taskprofile for dex2oat boot_complete policy" 2021-07-13 12:22:58 +00:00
Wei Wang
814673ace3 task_profiles.json: add taskprofile for dex2oat boot_complete policy
Since installation time is also critical and sometime we want a finer
control on its behavior for vendor. Instead of set dex2oat to background
group, add a new task profile.

The default policy is to mirror SP_BACKGROUND to be compatible with
legacy devices.

Test: Boot
Bug: 188947181
Signed-off-by: Wei Wang <wvw@google.com>
Change-Id: I7d5e113d1c368205f712eadad27775de226131ce
(cherry picked from commit 3745ce7aa8)
2021-07-12 18:49:52 -07:00
Treehugger Robot
df72c168d3 Merge "fs_mgr: License boilerplate" 2021-07-13 01:33:43 +00:00
Treehugger Robot
662729bc2e Merge "Re-land removing RECOVERY_AS_BOOT check for init_first_stage" 2021-07-13 01:32:21 +00:00
Tri Vo
f9cfeac49e trusty: Increase timeout for ConfirmationUI fuzzer
Bug: 192923547
Test: trusty_confirmationui_msg_fuzzer
Change-Id: I72755b0a35bbc3f2540672ca53acd14b1add38cb
2021-07-12 16:34:01 -07:00
Inseob Kim
4818f74888 Re-land removing RECOVERY_AS_BOOT check for init_first_stage
This has kept adb_debug.prop from being installed for
legacy devices with BOARD_USES_RECOVERY_AS_BOOT set to
true.

Bug: 192432810
Bug: 193291885
Test: `lunch aosp_flame-userdebug` and checks `get_build_var
      BOARD_USES_RECOVERY_AS_BOOT` is true.
Test: `make bootimage_debug` then checks
      $OUT/debug_ramdisk/adb_debug.prop exists
Test: build/soong/build_test.bash --dist --incremental

Change-Id: I28e2c082512791407167b610843f18731ed6d673
2021-07-10 23:42:53 +08:00
Bowgo Tsai
a8c6b9d27f fs_mgr: License boilerplate
Bug: 191507548
Test: TreeHugger
Change-Id: I2924d1733fc64de69681971ab42a526dc3bbcc1d
2021-07-09 06:24:04 +00:00
Treehugger Robot
1f92dc1a07 Merge changes I70c174c4,Ifc365e3b
* changes:
  Correctly implement a stub for ICowWriter::AddXorBlocks
  Add MockSnapshotWriter
2021-07-08 21:28:08 +00:00
Kelvin Zhang
c801d5b8f0 Correctly implement a stub for ICowWriter::AddXorBlocks
Test: th
Change-Id: I70c174c4d44ef979993063256e3eededf18bd086
2021-07-08 16:12:16 -04:00
Kelvin Zhang
e475852cf6 Add MockSnapshotWriter
Test: th
Change-Id: Ifc365e3bafc07f0708d9e2113afa434d73f32e28
2021-07-08 16:11:16 -04:00
Devin Moore
53ad66f41b Merge "init: remove extra space in list of bootconfig values" 2021-07-08 16:06:43 +00:00
Treehugger Robot
905ef0e025 Merge "init: Enable hwasan error reporting." 2021-07-08 15:56:07 +00:00
Max Bires
95b5b04872 Client side implementation of Trusty IRPC HAL
This change includes the code necessary to communicate to the
IRemotelyProvisionedComponent backend implementation running in Trusty.
It also makes the relevant changes to the manifest XML file to add the
IRemotelyProvisionedComponent HAL.

Bug: 192228022
Test: atest VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: I32c30ce2dc44e95ff91574ce405f10e3b5dc9699
Merged-In: I32c30ce2dc44e95ff91574ce405f10e3b5dc9699
2021-07-08 03:00:51 +00:00
Devin Moore
6d5445b9f4 init: remove extra space in list of bootconfig values
If a bootconfig argument has a list of values, it has a space between
them in /proc/bootconfig.

Example:
BOARD_BOOTCONFIG := parameter=value1,value2,value3

In /proc/bootconfig, it looks like:
parameter = "value1", "value2", "value3"

Before this CL, that example would end up with the value string of:
"value1, value2, value3"

To keep consistent behavior with kernel cmdline the value string should be:
"value1,value2,value3"

Test: Boot cuttlefish with test bootconfig params and verify ro.boot.*
Bug: 192257482
Change-Id: Iccdec451f53330162fa2c9ad2b7c2630f32b4168
2021-07-08 01:52:46 +00:00
David Anderson
8138717679 init: Enable hwasan error reporting.
Bug: 172541617
Test: builds with SANITIZE_TARGET=hwaddress
Change-Id: Ic749172bf9dd64bca0e8c7e34ac0b323685ad945
2021-07-07 18:49:19 -07:00
Nikita Ioffe
fb1e841a9f Merge "Also populate lastUpdateMillis in ActivateFlattenedApexesIfPossible" 2021-07-08 01:16:49 +00:00
Daniel Rosenberg
b19c333f2f Merge changes from topic "CowSequenceOp"
* changes:
  libsnapshot: Switch merge to CowRevMergeOpItr
  libsnapshot: Add seq op support to inspect_cow
  libsnapshot: Add CowRevMergeOpIter
  libsnapshot: Add IsOrderedOp
  libsnapshot: Cleanup iterators
  libsnapshot: Add Sequence Ops
2021-07-07 23:59:43 +00:00
Suren Baghdasaryan
86e0c6f409 Merge "libprocessgroup: Remove unnecessary permissions change in uid/pid hierarchy" 2021-07-07 23:09:48 +00:00