Commit graph

3153 commits

Author SHA1 Message Date
Paul Lawrence
315855b541 [automerger skipped] Fix crash in mainline
am: 1b535e41fd -s ours
am skip reason: change_id I135099625f77344d1f8d2e8688735871c44ef2f5 with SHA1 9a6d1f73e5 is in history

Change-Id: Ibfc9efb88aaac867a710529631a30fe33ba570d3
2019-09-19 02:03:24 -07:00
Paul Lawrence
1b535e41fd 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
Merged-In: I135099625f77344d1f8d2e8688735871c44ef2f5
2019-09-18 23:22:30 +00:00
Paul Crowley
a7e15f91ac [automerger skipped] Create a per-boot key on each boot
am: ccc84dec96 -s ours
am skip reason: change_id I74077bf8f727dab726c25f512ed7406a74cbe0bf with SHA1 c8a3ef3f3c is in history

Change-Id: I25f74556643e36061dd82c9947e1c5bd23563d13
2019-09-18 10:29:49 -07:00
Paul Crowley
ccc84dec96 Create a per-boot key on each boot
Bug: 140882488
Test: Booted twice, checked logs to ensure encryption
    is different each time, adb created files in directory.
Cherry-Picked-From: c8a3ef3f3c
Merged-In: I74077bf8f727dab726c25f512ed7406a74cbe0bf
Change-Id: I74077bf8f727dab726c25f512ed7406a74cbe0bf
2019-09-17 18:44:18 +00:00
Paul Crowley
d678142ac6 Merge "Create a per-boot key on each boot" am: dab5ddf663 am: 6db7fa72a5
am: 03336816a7

Change-Id: I79b13f2fa4c002d5242a5d498ec5db385b7199bd
2019-09-16 23:14:14 -07:00
Paul Crowley
03336816a7 Merge "Create a per-boot key on each boot" am: dab5ddf663
am: 6db7fa72a5

Change-Id: I2543c7cd24fcdbd13b08e9afc4d1e0a448dc3373
2019-09-16 23:07:10 -07:00
Paul Crowley
6db7fa72a5 Merge "Create a per-boot key on each boot"
am: dab5ddf663

Change-Id: Iee4dabdcccedcbf652ae23edb4d20404947a765c
2019-09-16 23:01:13 -07:00
Paul Crowley
dab5ddf663 Merge "Create a per-boot key on each boot" 2019-09-17 05:40:05 +00:00
Eric Biggers
81adf14c15 Merge "vold: use system-clang-format" am: 7e65d8dd00 am: c302876a95
am: acafcd49a8

Change-Id: Ibaad762902b51eb7fee705b2667a023cf3cea433
2019-09-16 14:43:31 -07:00
Eric Biggers
acafcd49a8 Merge "vold: use system-clang-format" am: 7e65d8dd00
am: c302876a95

Change-Id: Id9e2301657352c7d8f06bea899574f01d316a1c9
2019-09-16 14:31:42 -07:00
Eric Biggers
c302876a95 Merge "vold: use system-clang-format"
am: 7e65d8dd00

Change-Id: Ib0e898e67aa0032d53e52676a93b56b0640e11cf
2019-09-16 14:20:47 -07:00
Eric Biggers
7e65d8dd00 Merge "vold: use system-clang-format" 2019-09-16 21:03:26 +00:00
Eric Biggers
f220170923 vold: use system-clang-format
Link .clang-format to the standard .clang-format file (4-space-indent
version) from build/soong, rather than use a custom file.

Among other changes, the standard file has the "IncludeBlocks: Preserve"
setting, so include blocks stay in order.

Don't actually reformat all the code yet.

Test: Tried 'clang-format -i $(find . -name \*.cpp -o -name \*.h)'
      and checked that the changes look sane.
Change-Id: I11ecbd03b31e44ba7b3e01175a6fc317f8173ab0
2019-09-16 12:00:40 -07:00
Paul Crowley
c62ddd2a6f Merge "Add ebiggers to OWNERS" am: 88dba9a558 am: a462a57b18
am: b5b55b999a

Change-Id: Ia8a5e7d5b1edb38a67bf3a54ca973d63203ed1ee
2019-09-16 10:56:18 -07:00
Paul Crowley
b5b55b999a Merge "Add ebiggers to OWNERS" am: 88dba9a558
am: a462a57b18

Change-Id: Ibb0b2be5469661a8eb7a8c08e317a3f6094564cb
2019-09-16 10:48:06 -07:00
Paul Crowley
a462a57b18 Merge "Add ebiggers to OWNERS"
am: 88dba9a558

Change-Id: I70868eab667ea5566164ec4d8a5d19e230a89736
2019-09-16 10:42:06 -07:00
Paul Crowley
88dba9a558 Merge "Add ebiggers to OWNERS" 2019-09-16 17:23:02 +00:00
Paul Crowley
c8a3ef3f3c Create a per-boot key on each boot
Bug: 140882488
Test: Booted twice, checked logs to ensure encryption
    is different each time, adb created files in directory.
Change-Id: I74077bf8f727dab726c25f512ed7406a74cbe0bf
2019-09-13 15:46:48 -07:00
Paul Crowley
a13d33af46 Add ebiggers to OWNERS
Test: n/a
Change-Id: I08ece80400dae0c0d25c2fcef7168bbed9034745
2019-09-13 15:06:45 -07:00
Shawn Willden
d63541df6a Merge "Request rollback resistance for FBE keys." am: aae52f4816 am: 0b895c13bc
am: a15dbc415d

Change-Id: I67443abaf053401704482066df945b64f9ad325c
2019-09-12 09:43:02 -07:00
Shawn Willden
a15dbc415d Merge "Request rollback resistance for FBE keys." am: aae52f4816
am: 0b895c13bc

Change-Id: Ic3ad961ae342d65dd86bc7fd6a06201d55101eba
2019-09-12 09:36:44 -07:00
Shawn Willden
0b895c13bc Merge "Request rollback resistance for FBE keys."
am: aae52f4816

Change-Id: Ie2143da9b9b1d2e76faa958d1a04d2be6b0045e7
2019-09-12 09:29:15 -07:00
Treehugger Robot
aae52f4816 Merge "Request rollback resistance for FBE keys." 2019-09-12 15:20:45 +00:00
Xin Li
203ab466d7 [automerger skipped] Merge qt-r1-dev-plus-aosp-without-vendor (5817612) into stage-aosp-master am: 69a1fd86d3 -s ours
am: 5ccd3e3c39 -s ours
am skip reason: change_id I24f07ba89ba6e6dac8adc2a6bb654d75d2b73d3e with SHA1 e3b772e0f7 is in history

Change-Id: I5113813143261cd2779447fe8f30c8c30d0167a3
2019-09-11 15:02:35 -07:00
Xin Li
5ccd3e3c39 [automerger skipped] Merge qt-r1-dev-plus-aosp-without-vendor (5817612) into stage-aosp-master
am: 69a1fd86d3 -s ours
am skip reason: change_id I24f07ba89ba6e6dac8adc2a6bb654d75d2b73d3e with SHA1 e3b772e0f7 is in history

Change-Id: If121600192dd236e9b868d579459c566eaddbd69
2019-09-11 14:15:18 -07:00
Xin Li
69a1fd86d3 Merge qt-r1-dev-plus-aosp-without-vendor (5817612) into stage-aosp-master
Bug: 135460123
Change-Id: I1605f33ede34c8289a6eede94b62c8695df81b63
Merged-In: I24f07ba89ba6e6dac8adc2a6bb654d75d2b73d3e
2019-09-08 13:07:03 -07:00
Steven Moreland
caeeec6490 Merge "Remove libhwbinder/libhidltransport deps" am: 88a19b6fe1 am: e3b772e0f7
am: 149f8d0754

Change-Id: I5748a2bf1d10a872d45d4e4906434f8243fb54c6
2019-09-06 16:07:06 -07:00
Steven Moreland
149f8d0754 Merge "Remove libhwbinder/libhidltransport deps" am: 88a19b6fe1
am: e3b772e0f7

Change-Id: I85611b0fb0615505d06f447e46083ed2f214e8e4
2019-09-06 14:55:27 -07:00
Steven Moreland
e3b772e0f7 Merge "Remove libhwbinder/libhidltransport deps"
am: 88a19b6fe1

Change-Id: I24f07ba89ba6e6dac8adc2a6bb654d75d2b73d3e
2019-09-06 14:32:26 -07:00
Treehugger Robot
88a19b6fe1 Merge "Remove libhwbinder/libhidltransport deps" 2019-09-06 20:12:41 +00:00
Xin Li
ae4ee5e447 [automerger skipped] Merge "DO NOT MERGE - Merge Android 10 into master" am: d3ceab2566 -s ours am: 9938a041f4
am: 33658d3c27

Change-Id: If628c65b83bedcf79aa654a257db39886af2f5f1
2019-09-05 14:56:46 -07:00
Steven Moreland
4496ef9d34 Remove libhwbinder/libhidltransport deps
Since these were combined into libhidlbase.

Bug: 135686713
Test: build only (libhwbinder/libhidltransport are empty)
Change-Id: I890b572d537d66ecb49effd8efc782279c52956e
2019-09-05 14:18:22 -07:00
Xin Li
33658d3c27 [automerger skipped] Merge "DO NOT MERGE - Merge Android 10 into master" am: d3ceab2566 -s ours
am: 9938a041f4

Change-Id: If7462b1223a40a9ac8f886e116e6674f9f96e8e3
2019-09-05 14:18:12 -07:00
Xin Li
9938a041f4 [automerger skipped] Merge "DO NOT MERGE - Merge Android 10 into master"
am: d3ceab2566 -s ours
am skip reason: subject contains skip directive

Change-Id: Icfb843d38c7e0ed07d1f09982bffdbfaa290d1f6
2019-09-05 13:47:41 -07:00
Xin Li
d3ceab2566 Merge "DO NOT MERGE - Merge Android 10 into master" 2019-09-05 16:53:32 +00:00
Xin Li
85a94961df DO NOT MERGE - Merge Android 10 into master
Bug: 139893257
Change-Id: I9dc8417f0d87c87eac13437834e69a52c1887258
2019-09-04 13:35:31 -07:00
Paul Lawrence
68094b8d13 Merge "Fix ext4/metadata/udc issue" am: ee867be1f1 am: 3096e373be am: 4b1dad6065
am: d0282ac35d

Change-Id: I4d52cc2fe823ba8f18ff6f349259d77ab131bf1f
2019-08-27 09:19:35 -07:00
Paul Lawrence
d0282ac35d Merge "Fix ext4/metadata/udc issue" am: ee867be1f1 am: 3096e373be
am: 4b1dad6065

Change-Id: I667b5dca43a554a7f9445e18f0d536e3c7582df4
2019-08-27 09:10:04 -07:00
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
0f3c17b50f Merge "Fix crash in mainline" am: 3a0d51f6b7 am: 6c5944f899 am: 9cd7fdc882
am: 06bd0c427f

Change-Id: I689671afb25643d2e36e65e13374dd69051341b2
2019-08-26 21:20:56 -07:00
Paul Lawrence
06bd0c427f Merge "Fix crash in mainline" am: 3a0d51f6b7 am: 6c5944f899
am: 9cd7fdc882

Change-Id: I13d6316005c1df1482f8426a25d672519873b4d1
2019-08-26 19:23:40 -07: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
18aca481ff Merge "Fix race condition is commitCheckpoint" am: 1059810759 am: 556bd755e6 am: 86bc2a32d8
am: 466c1c07dd

Change-Id: Iedcdde19dc54a2a9ee5a1b104f1bcc9c46ca8af7
2019-08-22 18:00:13 -07:00
Paul Lawrence
466c1c07dd Merge "Fix race condition is commitCheckpoint" am: 1059810759 am: 556bd755e6
am: 86bc2a32d8

Change-Id: Ie255d33f5f6efd049c0a3e8a619c1333069c0e8c
2019-08-22 17:51:31 -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