xref: /linux/fs/verity/Kconfig (revision 4b65b859f55b036649a4525f09fa7c5bbbab384e)
1671e67b4SEric Biggers# SPDX-License-Identifier: GPL-2.0
2671e67b4SEric Biggers
3671e67b4SEric Biggersconfig FS_VERITY
4671e67b4SEric Biggers	bool "FS Verity (read-only file-based authenticity protection)"
5246d9216SMimi Zohar	select CRYPTO_HASH_INFO
6*998646b3SEric Biggers	select CRYPTO_LIB_SHA256
7*998646b3SEric Biggers	select CRYPTO_LIB_SHA512
8671e67b4SEric Biggers	help
9671e67b4SEric Biggers	  This option enables fs-verity.  fs-verity is the dm-verity
10671e67b4SEric Biggers	  mechanism implemented at the file level.  On supported
118da572c5SEric Biggers	  filesystems (currently ext4, f2fs, and btrfs), userspace can
128da572c5SEric Biggers	  use an ioctl to enable verity for a file, which causes the
138da572c5SEric Biggers	  filesystem to build a Merkle tree for the file.  The filesystem
148da572c5SEric Biggers	  will then transparently verify any data read from the file
158da572c5SEric Biggers	  against the Merkle tree.  The file is also made read-only.
16671e67b4SEric Biggers
17671e67b4SEric Biggers	  This serves as an integrity check, but the availability of the
18671e67b4SEric Biggers	  Merkle tree root hash also allows efficiently supporting
19671e67b4SEric Biggers	  various use cases where normally the whole file would need to
20671e67b4SEric Biggers	  be hashed at once, such as: (a) auditing (logging the file's
21671e67b4SEric Biggers	  hash), or (b) authenticity verification (comparing the hash
22671e67b4SEric Biggers	  against a known good value, e.g. from a digital signature).
23671e67b4SEric Biggers
24671e67b4SEric Biggers	  fs-verity is especially useful on large files where not all
25671e67b4SEric Biggers	  the contents may actually be needed.  Also, fs-verity verifies
26671e67b4SEric Biggers	  data each time it is paged back in, which provides better
27671e67b4SEric Biggers	  protection against malicious disks vs. an ahead-of-time hash.
28671e67b4SEric Biggers
29671e67b4SEric Biggers	  If unsure, say N.
30671e67b4SEric Biggers
31432434c9SEric Biggersconfig FS_VERITY_BUILTIN_SIGNATURES
32432434c9SEric Biggers	bool "FS Verity builtin signature support"
33432434c9SEric Biggers	depends on FS_VERITY
34432434c9SEric Biggers	select SYSTEM_DATA_VERIFICATION
35432434c9SEric Biggers	help
36672d6ef4SEric Biggers	  This option adds support for in-kernel verification of
37672d6ef4SEric Biggers	  fs-verity builtin signatures.
38432434c9SEric Biggers
39672d6ef4SEric Biggers	  Please take great care before using this feature.  It is not
40672d6ef4SEric Biggers	  the only way to do signatures with fs-verity, and the
41672d6ef4SEric Biggers	  alternatives (such as userspace signature verification, and
42672d6ef4SEric Biggers	  IMA appraisal) can be much better.  For details about the
43672d6ef4SEric Biggers	  limitations of this feature, see
44672d6ef4SEric Biggers	  Documentation/filesystems/fsverity.rst.
45432434c9SEric Biggers
46432434c9SEric Biggers	  If unsure, say N.
47