Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1487364f authored by Patrik Torstensson's avatar Patrik Torstensson Committed by Greg Kroah-Hartman
Browse files

BACKPORT: dm verity: add 'check_at_most_once' option to only validate hashes once



This allows platforms that are CPU/memory contrained to verify data
blocks only the first time they are read from the data device, rather
than every time.  As such, it provides a reduced level of security
because only offline tampering of the data device's content will be
detected, not online tampering.

Hash blocks are still verified each time they are read from the hash
device, since verification of hash blocks is less performance critical
than data blocks, and a hash block will not be verified any more after
all the data blocks it covers have been verified anyway.

This option introduces a bitset that is used to check if a block has
been validated before or not.  A block can be validated more than once
as there is no thread protection for the bitset.

These changes were developed and tested on entry-level Android Go
devices.

Bug: 72664474
Change-Id: I1c31fa6bc47c723501ecf9fb9405ba664ad120ca
Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
(cherry picked from commit 843f38d382b1ca2f6f4ae2ef7c35933e6319ffbb)
(changed alloc/free to vzalloc/vfree)
(changed per_bio_data_size variable)
(fixed includes)
Signed-off-by: default avatarPatrik Torstensson <totte@google.com>
parent e608693e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment