linux/fs/verity
Eric Biggers 947191ac8c fs-verity: support reading descriptor with ioctl
Add support for FS_VERITY_METADATA_TYPE_DESCRIPTOR to
FS_IOC_READ_VERITY_METADATA.  This allows a userspace server program to
retrieve the fs-verity descriptor of a file for serving to a client
which implements fs-verity compatible verification.  See the patch which
introduced FS_IOC_READ_VERITY_METADATA for more details.

"fs-verity descriptor" here means only the part that userspace cares
about because it is hashed to produce the file digest.  It doesn't
include the signature which ext4 and f2fs append to the
fsverity_descriptor struct when storing it on-disk, since that way of
storing the signature is an implementation detail.  The next patch adds
a separate metadata_type value for retrieving the signature separately.

This has been tested using a new xfstest which calls this ioctl via a
new subcommand for the 'fsverity' program from fsverity-utils.

Link: https://lore.kernel.org/r/20210115181819.34732-6-ebiggers@kernel.org
Reviewed-by: Victor Hsieh <victorhsieh@google.com>
Reviewed-by: Jaegeuk Kim <jaegeuk@kernel.org>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Eric Biggers <ebiggers@google.com>
2021-02-07 14:51:17 -08:00
..
enable.c fs-verity: rename "file measurement" to "file digest" 2020-11-16 11:40:12 -08:00
fsverity_private.h fs-verity: don't pass whole descriptor to fsverity_verify_signature() 2021-02-07 14:51:09 -08:00
hash_algs.c fs-verity: remove filenames from file comments 2020-11-16 11:40:10 -08:00
init.c fs-verity: remove filenames from file comments 2020-11-16 11:40:10 -08:00
Kconfig fs-verity: support builtin file signatures 2019-08-12 19:33:50 -07:00
Makefile fs-verity: add FS_IOC_READ_VERITY_METADATA ioctl 2021-02-07 14:51:11 -08:00
measure.c fs-verity: rename "file measurement" to "file digest" 2020-11-16 11:40:12 -08:00
open.c fs-verity: don't pass whole descriptor to fsverity_verify_signature() 2021-02-07 14:51:09 -08:00
read_metadata.c fs-verity: support reading descriptor with ioctl 2021-02-07 14:51:17 -08:00
signature.c fs-verity: don't pass whole descriptor to fsverity_verify_signature() 2021-02-07 14:51:09 -08:00
verify.c fs-verity: remove filenames from file comments 2020-11-16 11:40:10 -08:00