OSDN Git Service

Make ext4 userdata checkpoints work with metadata encryption
authorPaul Lawrence <paullawrence@google.com>
Tue, 25 Jun 2019 21:44:33 +0000 (14:44 -0700)
committerPaul Lawrence <paullawrence@google.com>
Thu, 27 Jun 2019 17:42:25 +0000 (17:42 +0000)
commitb5ebd7d9c7fe8d2b4bc60d54f1f5ad70cac4e28e
treea4b4d9f0f1c4827f1b56f8a082695ffa87f5d747
parent3f1ce062d55628878dfe4d68094b5e4de951745e
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
Checkpoint.cpp
EncryptInplace.cpp
EncryptInplace.h
MetadataCrypt.cpp
MetadataCrypt.h
VoldNativeService.cpp
VoldNativeService.h
binder/android/os/IVold.aidl
vdc.cpp