Commit graph

2961 commits

Author SHA1 Message Date
Paul Lawrence
4b1dad6065 Merge "Fix ext4/metadata/udc issue" am: ee867be1f1
am: 3096e373be

Change-Id: I99ba00610a8f48f58bc8f51952bad49c6dc73fb1
2019-08-27 08:51:50 -07:00
Paul Lawrence
3096e373be Merge "Fix ext4/metadata/udc issue"
am: ee867be1f1

Change-Id: I69b89b464a4d04b27e1da7d3990dcbec9525afe4
2019-08-27 08:45:00 -07:00
Paul Lawrence
ee867be1f1 Merge "Fix ext4/metadata/udc issue" 2019-08-27 15:21:58 +00:00
Paul Lawrence
9cd7fdc882 Merge "Fix crash in mainline" am: 3a0d51f6b7
am: 6c5944f899

Change-Id: I2d40676c59d364c02154bced41e6ce818b5d4886
2019-08-26 18:54:15 -07:00
Paul Lawrence
6c5944f899 Merge "Fix crash in mainline"
am: 3a0d51f6b7

Change-Id: I63925fd090707f56076a59349c237a83f4ec8234
2019-08-26 18:32:29 -07:00
Treehugger Robot
3a0d51f6b7 Merge "Fix crash in mainline" 2019-08-27 01:01:28 +00:00
Paul Lawrence
9a6d1f73e5 Fix crash in mainline
Current behavior:

Assume not checkpointing
cp_startCheckpoint creates the file in metadata
cp_needsCheckpoint will now set isCheckpointing to true
cp_commitCheckpoint will now think there is a checkpoint, and try to
commit it. This will fail on ext4 and it will return false, leading to
bad things.

cp_startCheckpoint is called when staging an apex module for update.
After this point, several things could go wrong:

If a keystore key is deleted, it calls cp_needsCheckpoint to see if the
delete should be deferred until cp_commitCheckpoint. The delete will now
be deferred, meaning that this key will never be deleted, using up the
key sots in trustzone

If a trim is scheduled through idle maintenance, this also calls
cp_needsCheckpoint, so the trims will not occur.

If either of these happens before a system crash, the device will not
recover since the system calls commitCheckpoint which will now crash.

When the system then goes on to reboot, the checkpoint will not be
triggered, since the commitCheckpoint call will have deleted the
checkpoint flag file before crashing.

Bug: 138952436
Test: vdc checkpoint startCheckpoint 5
      vdc checkpoint needsCheckpoint
      vdc checkpoint commitChanges
      stop;start

      commitChanges fails, then device loops

      After applying this test, commitChanges succeeds and device does
      not loop

Change-Id: I135099625f77344d1f8d2e8688735871c44ef2f5
2019-08-26 15:23:14 -07:00
Paul Lawrence
86bc2a32d8 Merge "Fix race condition is commitCheckpoint" am: 1059810759
am: 556bd755e6

Change-Id: Ie80a3c123a5d30915cade7ddc1aad2d790476448
2019-08-22 17:42:20 -07:00
Paul Lawrence
556bd755e6 Merge "Fix race condition is commitCheckpoint"
am: 1059810759

Change-Id: I3cb7931ee01d208cb6f5f435aa5fc40cacd78b65
2019-08-22 17:32:17 -07:00
Treehugger Robot
1059810759 Merge "Fix race condition is commitCheckpoint" 2019-08-23 00:11:38 +00:00
Paul Lawrence
1d57f686a3 Fix race condition is commitCheckpoint
If cp_commitCheckpoint is called twice at the same time, the second call
to setBowState will fail.

Add lock to remove possibility, and protect all uses of isCheckpointing

Bug: 138952436
Test: Boots after flashing in checkpoint mode
Change-Id: I131298adc506c3c176774d15e642b13d5f991087
2019-08-22 09:55:32 -07:00
Paul Lawrence
4b140d397f Fix ext4/metadata/udc issue
Test: Cannot test since no device supports this combo
Bug: 137924328
Change-Id: I451c90e0826ede71876f3e4f260e7083f3ab3fdb
2019-08-14 10:00:09 -07:00
David Anderson
d26cb98c4d Merge "libdm now requires linking to libext2_uuid." am: 9e821da9fe
am: e91c2686e9

Change-Id: I585749bae8d30931a164b5f2a7900fea2fe1aa29
2019-07-12 16:53:04 -07:00
David Anderson
e91c2686e9 Merge "libdm now requires linking to libext2_uuid."
am: 9e821da9fe

Change-Id: Id33c9fc83352535cb45f27e70dec6000c73b07a5
2019-07-12 16:25:24 -07:00
David Anderson
9e821da9fe Merge "libdm now requires linking to libext2_uuid." 2019-07-12 23:03:41 +00:00
Xin Li
49304ac627 [automerger skipped] Merge "DO NOT MERGE - Merge pie-platform-release (PPRL.190705.004) into master" am: 711f4faac3 -s ours
am: e7487087d0 -s ours
am skip reason: subject contains skip directive

Change-Id: I94ad8ca99f9a6b2aa522e8371794d43ae8840117
2019-07-09 16:27:56 -07:00
Xin Li
e7487087d0 [automerger skipped] Merge "DO NOT MERGE - Merge pie-platform-release (PPRL.190705.004) into master"
am: 711f4faac3 -s ours
am skip reason: subject contains skip directive

Change-Id: I334dfe94d70709434fd3c98c581a80cc4a7c00a4
2019-07-09 16:22:08 -07:00
Xin Li
4c373e4563 [automerger skipped] DO NOT MERGE - Merge pie-platform-release (PPRL.190705.004) into master am: 33080d8b49 -s ours
am: 2c1e06e589 -s ours
am skip reason: subject contains skip directive

Change-Id: If8cd430d5b10fbc50fc0cde9314644ec34b2309b
2019-07-09 16:00:55 -07:00
Xin Li
2c1e06e589 [automerger skipped] DO NOT MERGE - Merge pie-platform-release (PPRL.190705.004) into master
am: 33080d8b49 -s ours
am skip reason: subject contains skip directive

Change-Id: Id76bbc6615fa330e65f857c365e96c446855a242
2019-07-09 15:18:16 -07:00
Xin Li
711f4faac3 Merge "DO NOT MERGE - Merge pie-platform-release (PPRL.190705.004) into master" 2019-07-09 21:38:47 +00:00
Xin Li
33080d8b49 DO NOT MERGE - Merge pie-platform-release (PPRL.190705.004) into master
Bug: 136196576
Change-Id: I2fc2c9bb2631e627ebe74b6f081819c1eb0f3fcd
2019-07-09 11:24:40 -07:00
android-build-team Robot
ec0cb71ca1 Snap for 5622519 from 59295fbb94 to pi-platform-release
Change-Id: I402d144258df8eefe4c87766616ba32221bfbb67
2019-07-08 23:36:54 +00:00
Xin Li
aaea4b51ed DO NOT MERGE - Merge qt-dev-plus-aosp-without-vendor (5699924) into stage-aosp-master
Bug: 134405016
Change-Id: I19ac2279aa2cb1c5ad444d25484aa1ec0d7efac6
2019-07-01 21:00:30 +00:00
Paul Lawrence
d5fe5cfcb5 [automerger skipped] Merge "Add property to prevent commit for Vts test" am: 5bcfb5bf45
am: 3507d68556 -s ours
am skip reason: change_id I20441964dbc7b6ad5b445fa17a1374c1282bbbd8 with SHA1 3f1ce062d5 is in history

Change-Id: I2a5fe3fc7bbf3af55facde1ab07bd0559d8e7d87
2019-06-27 16:46:06 -07:00
Paul Lawrence
3507d68556 Merge "Add property to prevent commit for Vts test"
am: 5bcfb5bf45

Change-Id: Ic6b0e863fb9c6ddea2cb19390a9520c3c87cf704
2019-06-27 16:26:57 -07:00
Paul Lawrence
13539f79f5 [automerger skipped] Merge "Make ext4 userdata checkpoints work with metadata encryption" into qt-dev
am: dde9704664 -s ours
am skip reason: change_id I8365a40298b752af4bb10d00d9ff58ce04beab1f with SHA1 236e5e800e is in history

Change-Id: I11c77206000895c27aee9ad8326778ec95e233df
2019-06-27 16:25:58 -07:00
Treehugger Robot
5bcfb5bf45 Merge "Add property to prevent commit for Vts test" 2019-06-27 22:39:57 +00:00
TreeHugger Robot
dde9704664 Merge "Make ext4 userdata checkpoints work with metadata encryption" into qt-dev 2019-06-27 22:36:27 +00:00
David Anderson
10de69d7bb libdm now requires linking to libext2_uuid.
Bug: 135771280
Test: mm vold -j
Change-Id: Id71c71926841581d4d3bc4a66f4c06294df21028
2019-06-27 13:41:03 -07:00
Paul Lawrence
4ad86a9315 Merge "Make ext4 userdata checkpoints work with metadata encryption" am: 2c792e0720
am: 5f19ef31c8

Change-Id: I7da7077c70484cb5873b9316058bc73158c19ab6
2019-06-27 11:03:03 -07:00
Paul Lawrence
5f19ef31c8 Merge "Make ext4 userdata checkpoints work with metadata encryption"
am: 2c792e0720

Change-Id: I1aed54ccf98fb73b29ed13fa971bbfbb25a489ae
2019-06-27 10:50:06 -07:00
Paul Lawrence
b5ebd7d9c7 Make ext4 userdata checkpoints work with metadata encryption
When both ext4 user data checkpoints and metadata encryption are
enabled, we are creating two stacked dm devices. This had not been
properly thought through or debugged.

Test: Enable metadata encryption on taimen (add
keydirectory=/metadata/vold/metadata_encryption to flags for userdata in
fstab.hardware)
    Unfortunately metadata is not wiped by fastboot -w, so it is
    necessary to rm metadata/vold -rf whenever you wipe data.
    fastboot flashall -w works
    fastboot reboot -w works
    A normal boot works
    Disable checkpoint commits with
    setprop persist.vold.dont_commit_checkpoint 1
    vdc checkpoint startCheckpoint 10
    adb reboot
    wait for device to fully boot then
    adb reboot
    Wait for device to fully boot then
    adb logcat -d | grep Checkpoint shows the rollback in the logs

    This tests encryption on top of checkpoints with commit, encryption
    without checkpoints, and rollback, which seems to be the key cases.

    Also ran same tests on unmodified Taimen and Blueline

Bug: 135905679
Merged-In: I8365a40298b752af4bb10d00d9ff58ce04beab1f
Change-Id: I8365a40298b752af4bb10d00d9ff58ce04beab1f
2019-06-27 17:42:25 +00:00
Treehugger Robot
2c792e0720 Merge "Make ext4 userdata checkpoints work with metadata encryption" 2019-06-27 17:29:03 +00:00
Tri Vo
a4a04f5717 Merge "vold: use RAII wake locks" am: b585363d93
am: 99fd2a4b5a

Change-Id: I8e37d315ecb6bad994d2a9c748cfc835756e265e
2019-06-26 19:43:21 -07:00
Tri Vo
99fd2a4b5a Merge "vold: use RAII wake locks"
am: b585363d93

Change-Id: I21be9e28c19901c9ca3aa91eb2f7394d1f788ff2
2019-06-26 19:30:09 -07:00
Tri Vo
b585363d93 Merge "vold: use RAII wake locks" 2019-06-27 01:59:08 +00:00
Paul Lawrence
236e5e800e Make ext4 userdata checkpoints work with metadata encryption
When both ext4 user data checkpoints and metadata encryption are
enabled, we are creating two stacked dm devices. This had not been
properly thought through or debugged.

Test: Enable metadata encryption on taimen (add
keydirectory=/metadata/vold/metadata_encryption to flags for userdata in
fstab.hardware)
    Unfortunately metadata is not wiped by fastboot -w, so it is
    necessary to rm metadata/vold -rf whenever you wipe data.
    fastboot flashall -w works
    fastboot reboot -w works
    A normal boot works
    Disable checkpoint commits with
    setprop persist.vold.dont_commit_checkpoint 1
    vdc checkpoint startCheckpoint 10
    adb reboot
    wait for device to fully boot then
    adb reboot
    Wait for device to fully boot then
    adb logcat -d | grep Checkpoint shows the rollback in the logs

    This tests encryption on top of checkpoints with commit, encryption
    without checkpoints, and rollback, which seems to be the key cases.

Bug: 135905679
Change-Id: I8365a40298b752af4bb10d00d9ff58ce04beab1f
2019-06-26 15:19:24 -07:00
Xin Li
0092301976 [automerger skipped] Restore historical behavior with fsck_msdos (always accept fixes).
am: 3601f4790b -s ours
am skip reason: change_id I1d50a7e52fda34e59eb6f051c7fde115a6cd5255 with SHA1 3d3a9a7f1c is in history

Change-Id: Ib97568c9eaecb3c52e4703f7d14a8235b9cc0cc4
2019-06-26 15:09:02 -07:00
Tri Vo
15bbe22879 vold: use RAII wake locks
Prevents wake lock leaks, e.g. b/133175847

Bug: 133175847
Test: boot blueline
Change-Id: Icda4c81e00a61adec6a12c61c329867fef284dc5
2019-06-26 10:20:30 -07:00
Xin Li
3601f4790b Restore historical behavior with fsck_msdos (always accept fixes).
Bug: 133725065
Merged-In: I1d50a7e52fda34e59eb6f051c7fde115a6cd5255
Change-Id: I1d50a7e52fda34e59eb6f051c7fde115a6cd5255
2019-06-26 10:02:17 -07:00
Ruslan Tkhakokhov
0e2317857b Merge "Merged-In Revert "vold: use RAII wake locks"" am: 2ebb5c5b96
am: fce081efa6

Change-Id: If58a55eecb04453f69e51cdc242f5ab71fb7ddc1
2019-06-21 08:27:57 -07:00
Ruslan Tkhakokhov
fce081efa6 Merge "Merged-In Revert "vold: use RAII wake locks""
am: 2ebb5c5b96

Change-Id: I6fe423a47de01eaf3d5bcc27fbfd7d96ea184156
2019-06-21 08:08:21 -07:00
Ruslan Tkhakokhov
2ebb5c5b96 Merge "Merged-In Revert "vold: use RAII wake locks"" 2019-06-21 10:34:43 +00:00
Ruslan Tkhakokhov
a37c01756f Merged-In Revert "vold: use RAII wake locks"
This reverts commit 242130f3f8.

Reason for revert: breaks the build

Change-Id: Ide809a114b2a04538f3ba4ed8af934bf326e54f3
2019-06-21 10:33:30 +00:00
David Anderson
4d0dadb629 Merge "Block and wait for /dev/block/loop<N> to appear in case it was created asynchronously." am: ee5eb39169
am: 5973b8cf00

Change-Id: Ieb48b5b3ca4e5576d22b7db9bcc229b8fb2f47fb
2019-06-20 18:16:56 -07:00
David Anderson
5973b8cf00 Merge "Block and wait for /dev/block/loop<N> to appear in case it was created asynchronously."
am: ee5eb39169

Change-Id: Ib82969daab218360712f1b3bf2c2069c95932ee2
2019-06-20 18:06:16 -07:00
David Anderson
ee5eb39169 Merge "Block and wait for /dev/block/loop<N> to appear in case it was created asynchronously." 2019-06-20 23:59:47 +00:00
Tri Vo
c3d9197784 Merge "vold: use RAII wake locks" am: 798aa303da
am: 56c6681ba8

Change-Id: I3f87e1ad31701c24fdc426c3bd562a47871e3631
2019-06-20 15:57:53 -07:00
Tri Vo
56c6681ba8 Merge "vold: use RAII wake locks"
am: 798aa303da

Change-Id: I157e8ceb8ece246d00ce345bd110023977a6d208
2019-06-20 15:25:46 -07:00
Tri Vo
798aa303da Merge "vold: use RAII wake locks" 2019-06-20 19:42:50 +00:00