OSDN Git Service

cryptfs: round down dm-crypt device size to crypto sector boundary
authorEric Biggers <ebiggers@google.com>
Fri, 25 Jan 2019 18:47:55 +0000 (10:47 -0800)
committerEric Biggers <ebiggers@google.com>
Fri, 25 Jan 2019 21:42:02 +0000 (13:42 -0800)
commited45ec3ae8bf2c18f72550bdf660035e2fee6dc4
treea13000aaa0fb8e32bbc94de41c8c863cefe84b44
parentaaac873faf91fd540133e6fe8a041784b4ae16d1
cryptfs: round down dm-crypt device size to crypto sector boundary

This is needed to make adoptable storage volumes work with a 4K crypto
sector size when the block device size is not a multiple of 4K.

It is fine to do this because the filesystem ends on a 4K boundary
anyway and doesn't use any partial block at the end.

Bug: 123375298
Test: booted device configured to use FDE with sector size 4k, ran
      'sm set-virtual-disk true' and formatted the virtual SD card as
      adoptable storage.  Then did the same but with a temporary patch
      that changed kSizeVirtualDisk to be misaligned
Change-Id: I95ee6d7dcaaa8989c674aea9988c09116e830b0c
cryptfs.cpp