aboutsummaryrefslogtreecommitdiff
path: root/drivers/md/dm-verity-target.c
Commit message (Collapse)AuthorAgeFilesLines
* ANDROID: dm verity: add minimum prefetch sizeKeun-young Park2018-01-051-1/+8
| | | | | | | | | | | | | - For device like eMMC, it gives better performance to read more hash blocks at a time. - For android, set it to default 128. For other devices, set it to 1 which is the same as now. - saved boot-up time by 300ms in tested device bug: 32246564 Cc: Sami Tolvanen <samitolvanen@google.com> Signed-off-by: Keun-young Park <keunyoung@google.com>
* ANDROID: dm: Add android verity targetBadhri Jagan Sridharan2017-12-271-8/+8
| | | | | | | | | | | | | | This device-mapper target is virtually a VERITY target. This target is setup by reading the metadata contents piggybacked to the actual data blocks in the block device. The signature of the metadata contents are verified against the key included in the system keyring. Upon success, the underlying verity target is setup. BUG: 27175947 Change-Id: I7e99644a0960ac8279f02c0158ed20999510ea97 Signed-off-by: Badhri Jagan Sridharan <Badhri@google.com>
* dm verity: add ignore_zero_blocks featureSami Tolvanen2017-12-271-8/+80
| | | | | | | | | | | If ignore_zero_blocks is enabled dm-verity will return zeroes for blocks matching a zero hash without validating the content. Bug: 21893453 Change-Id: Ib9552f872bd82b1ba6a090686d2934a9551a3b48 Signed-off-by: Sami Tolvanen <samitolvanen@google.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com> (cherry picked from commit 0b7462a60aad0c0819a138608c43998f3c46d6a8)
* dm verity: add support for forward error correctionSami Tolvanen2017-12-271-6/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for correcting corrupted blocks using Reed-Solomon. This code uses RS(255, N) interleaved across data and hash blocks. Each error-correcting block covers N bytes evenly distributed across the combined total data, so that each byte is a maximum distance away from the others. This makes it possible to recover from several consecutive corrupted blocks with relatively small space overhead. In addition, using verity hashes to locate erasures nearly doubles the effectiveness of error correction. Being able to detect corrupted blocks also improves performance, because only corrupted blocks need to corrected. For a 2 GiB partition, RS(255, 253) (two parity bytes for each 253-byte block) can correct up to 16 MiB of consecutive corrupted blocks if erasures can be located, and 8 MiB if they cannot, with 16 MiB space overhead. Bug: 21893453 Change-Id: Ib0372f49f45127e33bfe6b7182b0d608f56f3c7e Signed-off-by: Sami Tolvanen <samitolvanen@google.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com> (cherry picked from commit a431c56bf1764448c12fd2d545b15466d552460c)
* dm verity: factor out verity_for_bv_block()Sami Tolvanen2017-12-271-27/+58
| | | | | | | | | | verity_for_bv_block() will be re-used by optional dm-verity object. Bug: 21893453 Change-Id: I82a3e6efdd95a488770a2fea6794befa8f5a35ce Signed-off-by: Sami Tolvanen <samitolvanen@google.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com> (cherry picked from commit cce43a8a989fb5e245f5ca457e39edc22941c42e)
* dm verity: factor out structures and functions useful to separate objectSami Tolvanen2017-12-271-109/+16
| | | | | | | | | | | Prepare for an optional verity object to make use of existing dm-verity structures and functions. Bug: 21893453 Change-Id: I68b32d2a2ba044b73074410d9c8d916f44fb638d Signed-off-by: Sami Tolvanen <samitolvanen@google.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com> (cherry picked from commit 212032ee8b4123dd001861e87fbde57084c3494e)
* dm verity: move dm-verity.c to dm-verity-target.cSami Tolvanen2017-12-271-0/+1094
Prepare for extending dm-verity with an optional object. Follows the naming convention used by other DM targets (e.g. dm-cache and dm-era). Bug: 21893453 Change-Id: If5e416de81b7f8e7a7e20fb9fcc723af19b8067d Signed-off-by: Sami Tolvanen <samitolvanen@google.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com> (cherry picked from commit 13e0ef92e4308e5541d1abf462bf12d80545a516)