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)" 5*a3000002SEric Biggers # Filesystems cache the Merkle tree at a 64K aligned offset in the 6*a3000002SEric Biggers # pagecache. That approach assumes the page size is at most 64K. 7*a3000002SEric Biggers depends on PAGE_SHIFT <= 16 8246d9216SMimi Zohar select CRYPTO_HASH_INFO 9998646b3SEric Biggers select CRYPTO_LIB_SHA256 10998646b3SEric Biggers select CRYPTO_LIB_SHA512 11671e67b4SEric Biggers help 12671e67b4SEric Biggers This option enables fs-verity. fs-verity is the dm-verity 13671e67b4SEric Biggers mechanism implemented at the file level. On supported 148da572c5SEric Biggers filesystems (currently ext4, f2fs, and btrfs), userspace can 158da572c5SEric Biggers use an ioctl to enable verity for a file, which causes the 168da572c5SEric Biggers filesystem to build a Merkle tree for the file. The filesystem 178da572c5SEric Biggers will then transparently verify any data read from the file 188da572c5SEric Biggers against the Merkle tree. The file is also made read-only. 19671e67b4SEric Biggers 20671e67b4SEric Biggers This serves as an integrity check, but the availability of the 21671e67b4SEric Biggers Merkle tree root hash also allows efficiently supporting 22671e67b4SEric Biggers various use cases where normally the whole file would need to 23671e67b4SEric Biggers be hashed at once, such as: (a) auditing (logging the file's 24671e67b4SEric Biggers hash), or (b) authenticity verification (comparing the hash 25671e67b4SEric Biggers against a known good value, e.g. from a digital signature). 26671e67b4SEric Biggers 27671e67b4SEric Biggers fs-verity is especially useful on large files where not all 28671e67b4SEric Biggers the contents may actually be needed. Also, fs-verity verifies 29671e67b4SEric Biggers data each time it is paged back in, which provides better 30671e67b4SEric Biggers protection against malicious disks vs. an ahead-of-time hash. 31671e67b4SEric Biggers 32671e67b4SEric Biggers If unsure, say N. 33671e67b4SEric Biggers 34432434c9SEric Biggersconfig FS_VERITY_BUILTIN_SIGNATURES 35432434c9SEric Biggers bool "FS Verity builtin signature support" 36432434c9SEric Biggers depends on FS_VERITY 37432434c9SEric Biggers select SYSTEM_DATA_VERIFICATION 38432434c9SEric Biggers help 39672d6ef4SEric Biggers This option adds support for in-kernel verification of 40672d6ef4SEric Biggers fs-verity builtin signatures. 41432434c9SEric Biggers 42672d6ef4SEric Biggers Please take great care before using this feature. It is not 43672d6ef4SEric Biggers the only way to do signatures with fs-verity, and the 44672d6ef4SEric Biggers alternatives (such as userspace signature verification, and 45672d6ef4SEric Biggers IMA appraisal) can be much better. For details about the 46672d6ef4SEric Biggers limitations of this feature, see 47672d6ef4SEric Biggers Documentation/filesystems/fsverity.rst. 48432434c9SEric Biggers 49432434c9SEric Biggers If unsure, say N. 50