fs-verity: add data verification hooks for ->readpages()
authorEric Biggers <ebiggers@google.com>
Mon, 22 Jul 2019 16:26:22 +0000 (09:26 -0700)
committerEric Biggers <ebiggers@google.com>
Sun, 28 Jul 2019 23:59:16 +0000 (16:59 -0700)
commit8a1d0f9cacc997bedc017056a94f35dc823394ed
tree90d55ad08622ed954361629d906d11469919abae
parentc1d9b584e2cf3f0562d8fcf34574c044d17853a1
fs-verity: add data verification hooks for ->readpages()

Add functions that verify data pages that have been read from a
fs-verity file, against that file's Merkle tree.  These will be called
from filesystems' ->readpage() and ->readpages() methods.

Since data verification can block, a workqueue is provided for these
methods to enqueue verification work from their bio completion callback.

See the "Verifying data" section of
Documentation/filesystems/fsverity.rst for more information.

Reviewed-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Eric Biggers <ebiggers@google.com>
fs/verity/Makefile
fs/verity/fsverity_private.h
fs/verity/init.c
fs/verity/open.c
fs/verity/verify.c [new file with mode: 0644]
include/linux/fsverity.h